mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 14:59:37 +08:00
Add types to string-width
This commit is contained in:
9
types/string-width/index.d.ts
vendored
Normal file
9
types/string-width/index.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
// Type definitions for string-width 2.0
|
||||
// Project: https://github.com/sindresorhus/string-width
|
||||
// Definitions by: Rong Shen <https://github.com/jacobbubu>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
declare function stringWidth(text: string): number;
|
||||
export = stringWidth;
|
||||
4
types/string-width/string-width-tests.ts
Normal file
4
types/string-width/string-width-tests.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import stringWidth = require("string-width");
|
||||
|
||||
stringWidth("古");
|
||||
// => 2
|
||||
16
types/string-width/tsconfig.json
Normal file
16
types/string-width/tsconfig.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "string-width-tests.ts"]
|
||||
}
|
||||
1
types/string-width/tslint.json
Normal file
1
types/string-width/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user