Skip to content

Commit

Permalink
fix: typing improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
azukaar committed Aug 19, 2019
1 parent 645db64 commit 61c5a56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';

Expand Down
2 changes: 2 additions & 0 deletions tests/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 61c5a56

Please sign in to comment.