mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-11 12:40:15 +00:00
Merge pull request #33022 from djcsdy/cssesc
[cssesc] Add type definitions
This commit is contained in:
35
types/cssesc/cssesc-tests.ts
Normal file
35
types/cssesc/cssesc-tests.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import cssesc = require("cssesc");
|
||||
|
||||
// $ExpectType string
|
||||
cssesc('Ich ♥ Bücher');
|
||||
|
||||
// $ExpectType string
|
||||
cssesc('123a2b', {
|
||||
isIdentifier: true
|
||||
});
|
||||
|
||||
// $ExpectType string
|
||||
cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
|
||||
quotes: 'single'
|
||||
});
|
||||
|
||||
// $ExpectType string
|
||||
cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
|
||||
quotes: 'double'
|
||||
});
|
||||
|
||||
// $ExpectType string
|
||||
cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
|
||||
quotes: 'single',
|
||||
wrap: true
|
||||
});
|
||||
|
||||
// $ExpectType string
|
||||
cssesc('lolwat"foo\'bar', {
|
||||
escapeEverything: true
|
||||
});
|
||||
|
||||
cssesc.options.escapeEverything = false;
|
||||
|
||||
// $ExpectType string
|
||||
cssesc.version;
|
||||
22
types/cssesc/index.d.ts
vendored
Normal file
22
types/cssesc/index.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// Type definitions for cssesc 3.0
|
||||
// Project: https://mths.be/cssesc
|
||||
// Definitions by: Daniel Cassidy <https://github.com/djcsdy>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
export = cssesc;
|
||||
|
||||
declare function cssesc(string: string, options?: Readonly<Partial<cssesc.Options>>): string;
|
||||
|
||||
declare namespace cssesc {
|
||||
interface Options {
|
||||
escapeEverything: boolean;
|
||||
isIdentifier: boolean;
|
||||
quotes: string;
|
||||
wrap: boolean;
|
||||
}
|
||||
|
||||
const options: Options;
|
||||
|
||||
const version: string;
|
||||
}
|
||||
23
types/cssesc/tsconfig.json
Normal file
23
types/cssesc/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"cssesc-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/cssesc/tslint.json
Normal file
1
types/cssesc/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user