diff --git a/types/indefinite/indefinite-tests.ts b/types/indefinite/indefinite-tests.ts new file mode 100644 index 0000000000..8d22c17768 --- /dev/null +++ b/types/indefinite/indefinite-tests.ts @@ -0,0 +1,9 @@ +import indefinite from "indefinite"; + +const anApple = indefinite("apple"); // "an apple" +const aBanana = indefinite('banana'); // "a banana" +const AnApple = indefinite('apple', { capitalize: true }); // "An apple" +const anEight = indefinite("8"); // "an 8" +const anEightAsNumber = indefinite(8); // "an 8" +const a1892 = indefinite("1892"); // "a 1892" -> read "a one thousand eight hundred ninety-two" +const a1892AsColloquial = indefinite("1892", { numbers: "colloquial" }); // "an 1892" -> read "an eighteen ninety-two" diff --git a/types/indefinite/index.d.ts b/types/indefinite/index.d.ts new file mode 100644 index 0000000000..7d703e1e59 --- /dev/null +++ b/types/indefinite/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for indefinite 2.2 +// Project: https://github.com/tandrewnichols/indefinite +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "indefinite" { + interface Options { + capitalize?: boolean; + caseInsensitive?: boolean; + numbers?: "colloquial"; + } + export default function(word: string | number, opts?: Options): string; +} + \ No newline at end of file diff --git a/types/indefinite/tsconfig.json b/types/indefinite/tsconfig.json new file mode 100644 index 0000000000..346dedd4e0 --- /dev/null +++ b/types/indefinite/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "indefinite-tests.ts" + ] +} diff --git a/types/indefinite/tslint.json b/types/indefinite/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/indefinite/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }