Add sheetify (#12960)

This commit is contained in:
Todd Kennedy
2016-11-29 10:53:32 -08:00
committed by Andy
parent 50149743cd
commit cbb5d22f09
4 changed files with 53 additions and 0 deletions

13
sheetify/index.d.ts vendored Normal file
View File

@@ -0,0 +1,13 @@
// Type definitions for sheetify 6.0
// Project: https://github.com/stackcss/sheetify
// Definitions by: Todd Kennedy <https://github.com/toddself>
// 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;

View File

@@ -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');

19
sheetify/tsconfig.json Normal file
View File

@@ -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"
]
}

1
sheetify/tslint.json Normal file
View File

@@ -0,0 +1 @@
{ "extends": "../tslint.json" }