Add typings for common-prefix (#27195)

This commit is contained in:
Sean Genabe
2018-07-13 00:47:45 +08:00
committed by Ryan Cavanaugh
parent bf441f07a9
commit 6994703ab6
4 changed files with 36 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
import common = require('common-prefix'); // common is(string: ReadOnlyArray<string>) => string
// $ExpectType string
common(['a']);

8
types/common-prefix/index.d.ts vendored Normal file
View File

@@ -0,0 +1,8 @@
// Type definitions for common-prefix 1.1
// Project: https://github.com/hughsk/common-prefix
// Definitions by: Sean Marvi Oliver Genabe <https://github.com/seangenabe>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function common(strings: ReadonlyArray<string>): string;
export = common;

View File

@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"strictFunctionTypes": true
},
"files": [
"index.d.ts",
"common-prefix-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }