diff --git a/types/codegen.macro/codegen.macro-tests.ts b/types/codegen.macro/codegen.macro-tests.ts new file mode 100644 index 0000000000..40f884cd5d --- /dev/null +++ b/types/codegen.macro/codegen.macro-tests.ts @@ -0,0 +1,5 @@ +import codegen = require('codegen.macro'); + +const eg1: string = codegen`module.exports = "'hello world'"`; +const eg2: number = codegen`module.exports = "42"`; +const eg3: { [key: string]: string } = codegen`module.exports = "({ hello: 'world' })"`; diff --git a/types/codegen.macro/index.d.ts b/types/codegen.macro/index.d.ts new file mode 100644 index 0000000000..351b4618aa --- /dev/null +++ b/types/codegen.macro/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for codegen.macro 3.0 +// Project: https://github.com/kentcdodds/codegen.macro +// Definitions by: Charlee Li +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function codegen(strings: TemplateStringsArray, ...values: any[]): any; +export = codegen; diff --git a/types/codegen.macro/tsconfig.json b/types/codegen.macro/tsconfig.json new file mode 100644 index 0000000000..280910b6eb --- /dev/null +++ b/types/codegen.macro/tsconfig.json @@ -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", + "codegen.macro-tests.ts" + ] +} diff --git a/types/codegen.macro/tslint.json b/types/codegen.macro/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/codegen.macro/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }