diff --git a/sheetify/index.d.ts b/sheetify/index.d.ts new file mode 100644 index 0000000000..d6711c5bd9 --- /dev/null +++ b/sheetify/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for sheetify 6.0 +// Project: https://github.com/stackcss/sheetify +// Definitions by: Todd Kennedy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace sheetify { + export function getPrefix(css: string): string; +} + +declare function sheetify(src: string | TemplateStringsArray, filename?: string, options?: {[prop: string]: any}, done?: (err: Error, css: string, prefix: string) => void): string; +declare function sheetify(src: string | TemplateStringsArray, options: {[prop: string]: any}): void; + +export = sheetify; diff --git a/sheetify/sheetify-tests.ts b/sheetify/sheetify-tests.ts new file mode 100644 index 0000000000..7287ba1499 --- /dev/null +++ b/sheetify/sheetify-tests.ts @@ -0,0 +1,20 @@ +import * as sheetify from 'sheetify'; + +function done1 (err: Error, css: string, prefix: string) {}; +function done2 (err: Error, css: string) {}; +function done3 (err: Error) {}; + +const test1 = sheetify('foobar'); +const test2 = sheetify('foobar', {global: true}); +const test3 = sheetify('foobar', 'beep.css', {global: true}); +const test4 = sheetify('foobar', 'beep.css'); +const test5 = sheetify('foobar', 'beep.css', {global: true}, done1); +const test6 = sheetify('foobar', 'beep.css', {global: true}, done2); +const test7 = sheetify('foobar', 'beep.css', {global: true}, done3); +const test8 = sheetify` +.test { + border: 1px soild black; +} +` + +const prefix = sheetify.getPrefix('boop'); \ No newline at end of file diff --git a/sheetify/tsconfig.json b/sheetify/tsconfig.json new file mode 100644 index 0000000000..d3654efcd7 --- /dev/null +++ b/sheetify/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "sheetify-tests.ts" + ] +} diff --git a/sheetify/tslint.json b/sheetify/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/sheetify/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" }