Add types for capitalize (#16156)

Add an optional extended description…
This commit is contained in:
Frederick Fogerty
2017-04-26 14:47:50 -07:00
committed by Sheetal Nandi
parent b86db17028
commit 2a78cc163a
4 changed files with 54 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
import * as capitalize from "capitalize";
import { words } from "capitalize";
capitalize("united states");
capitalize.words("united states");
capitalize.words('hello-cañapolísas');
capitalize.words("it's a nice day");
words("united states");
+19
View File
@@ -0,0 +1,19 @@
// Type definitions for capitalize 1.0
// Project: https://github.com/grncdr/js-capitalize
// Definitions by: Frederick Fogerty <https://github.com/frederickfogerty/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/**
* Capitalize the first letter of a string
* @param input the string to capitalize
*/
declare function capitalize(input: string): string;
declare namespace capitalize {
/**
* Capitalize each word in a string
* @param input the string to capitalize
*/
function words(input: string): string;
}
export = capitalize;
+22
View 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",
"capitalize-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }