diff --git a/types/camelcase-keys-deep/camelcase-keys-deep-tests.ts b/types/camelcase-keys-deep/camelcase-keys-deep-tests.ts new file mode 100644 index 0000000000..0cac59699b --- /dev/null +++ b/types/camelcase-keys-deep/camelcase-keys-deep-tests.ts @@ -0,0 +1,15 @@ +import camelcaseKeysDeep = require('camelcase-keys-deep'); + +interface Point { + point_x: number; + point_y: number; +} + +const foo: Point = { + point_x: 1, + point_y: 2, +}; + +camelcaseKeysDeep(foo) as Point; // => {pointX: 1, pointY: 2} + +camelcaseKeysDeep({ unicorn_rainbow: { foo_bar: 1 } }); // => unicornRainbow: {fooBar: 1} diff --git a/types/camelcase-keys-deep/index.d.ts b/types/camelcase-keys-deep/index.d.ts new file mode 100644 index 0000000000..57571742d5 --- /dev/null +++ b/types/camelcase-keys-deep/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for camelcase-keys-deep 0.1 +// Project: https://github.com/rxaviers/camelcase-keys-deep +// Definitions by: Søren Englund +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +declare function camelcaseKeysDeep(obj: object): {}; + +export = camelcaseKeysDeep; diff --git a/types/camelcase-keys-deep/tsconfig.json b/types/camelcase-keys-deep/tsconfig.json new file mode 100644 index 0000000000..1715407a09 --- /dev/null +++ b/types/camelcase-keys-deep/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", + "camelcase-keys-deep-tests.ts" + ] +} diff --git a/types/camelcase-keys-deep/tslint.json b/types/camelcase-keys-deep/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/camelcase-keys-deep/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }