diff --git a/src/index.ts b/src/index.ts index 2f44d8e..e067960 100644 --- a/src/index.ts +++ b/src/index.ts @@ -208,7 +208,14 @@ const jsonToCss = function (_css, className = "", refresh = () => { }) { } } -const CSS = function (rules, name = 'class') { +const CSS = function (rules, name = 'class') : { + getStyle(): string; + inject(): void; + remove(callbackOnFirstSwap?: () => void): boolean; + refresh(): any; + toString(): string; + inherit(): any; +} | string { let className = name + randomId(); let temp = ''; diff --git a/tests/index.spec.js b/tests/index.spec.js index 44c62cc..6888d94 100644 --- a/tests/index.spec.js +++ b/tests/index.spec.js @@ -108,6 +108,8 @@ describe('', () => { for (let unit in units) { if (unit === 'pct') { expect(units[unit](1)).toBe('1%'); + } else if (unit === 'inch') { + expect(units[unit](1)).toBe('1in'); } else { expect(units[unit](1)).toBe('1' + unit); }