mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-04 17:20:09 +00:00
Add types/tests for deindent (#36549)
This commit is contained in:
31
types/deindent/deindent-tests.ts
Normal file
31
types/deindent/deindent-tests.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import deindent = require('deindent');
|
||||
|
||||
// as a string function
|
||||
deindent(`
|
||||
this
|
||||
is
|
||||
the ${'end'}
|
||||
my only
|
||||
friend
|
||||
the end
|
||||
`);
|
||||
|
||||
// as a template tag
|
||||
deindent`
|
||||
this
|
||||
is
|
||||
the ${'end'}
|
||||
my only
|
||||
friend
|
||||
the end
|
||||
`;
|
||||
|
||||
// as a higher-order template tag
|
||||
deindent(String.raw)`
|
||||
this
|
||||
is
|
||||
the ${'end'}
|
||||
my only
|
||||
friend
|
||||
the end
|
||||
`;
|
||||
12
types/deindent/index.d.ts
vendored
Normal file
12
types/deindent/index.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Type definitions for deindent 0.1
|
||||
// Project: https://github.com/deanlandolt/deindent
|
||||
// Definitions by: Avi Vahl <https://github.com/AviVahl>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function deindent(
|
||||
tagFn: (template: TemplateStringsArray, ...substitutions: any[]) => string
|
||||
): (template: TemplateStringsArray, ...substitutions: any[]) => string;
|
||||
declare function deindent(template: TemplateStringsArray, ...substitutions: any[]): string;
|
||||
declare function deindent(input: string): string;
|
||||
|
||||
export = deindent;
|
||||
23
types/deindent/tsconfig.json
Normal file
23
types/deindent/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"deindent-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/deindent/tslint.json
Normal file
1
types/deindent/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user