diff --git a/types/deindent/deindent-tests.ts b/types/deindent/deindent-tests.ts new file mode 100644 index 0000000000..313ee72cc3 --- /dev/null +++ b/types/deindent/deindent-tests.ts @@ -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 +`; diff --git a/types/deindent/index.d.ts b/types/deindent/index.d.ts new file mode 100644 index 0000000000..67411d06c0 --- /dev/null +++ b/types/deindent/index.d.ts @@ -0,0 +1,12 @@ +// Type definitions for deindent 0.1 +// Project: https://github.com/deanlandolt/deindent +// Definitions by: Avi Vahl +// 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; diff --git a/types/deindent/tsconfig.json b/types/deindent/tsconfig.json new file mode 100644 index 0000000000..d75cd10a6e --- /dev/null +++ b/types/deindent/tsconfig.json @@ -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" + ] +} diff --git a/types/deindent/tslint.json b/types/deindent/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/deindent/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }