mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Add typings for indefinite
This commit is contained in:
parent
767a63a86d
commit
10e9b1cf8b
9
types/indefinite/indefinite-tests.ts
Normal file
9
types/indefinite/indefinite-tests.ts
Normal file
@ -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"
|
||||
14
types/indefinite/index.d.ts
vendored
Normal file
14
types/indefinite/index.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
// Type definitions for indefinite 2.2
|
||||
// Project: https://github.com/tandrewnichols/indefinite
|
||||
// Definitions by: My Self <https://github.com/me>
|
||||
// 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;
|
||||
}
|
||||
|
||||
22
types/indefinite/tsconfig.json
Normal file
22
types/indefinite/tsconfig.json
Normal file
@ -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"
|
||||
]
|
||||
}
|
||||
1
types/indefinite/tslint.json
Normal file
1
types/indefinite/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user