mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 09:01:45 +08:00
Add sheetify (#12960)
This commit is contained in:
13
sheetify/index.d.ts
vendored
Normal file
13
sheetify/index.d.ts
vendored
Normal 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;
|
||||
20
sheetify/sheetify-tests.ts
Normal file
20
sheetify/sheetify-tests.ts
Normal 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
19
sheetify/tsconfig.json
Normal 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
1
sheetify/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Reference in New Issue
Block a user