Merge pull request #21072 from maroy1986/master

Added types for npm guid package
This commit is contained in:
Daniel Rosenwasser
2017-11-07 00:31:34 -08:00
committed by GitHub
4 changed files with 64 additions and 0 deletions

18
types/guid/guid-tests.ts Normal file
View File

@@ -0,0 +1,18 @@
import guid = require('guid');
// $ExpectType object
guid.create();
// $ExpectType string
guid.raw();
const newRawGuid = guid.raw();
// $ExpectType boolean
guid.isGuid(newRawGuid);
// $ExpectType string
guid.EMPTY;
// $ExpectType object
guid(guid.create());

22
types/guid/index.d.ts vendored Normal file
View File

@@ -0,0 +1,22 @@
// Type definitions for guid 1.0
// Project: https://github.com/dandean/guid
// Definitions by: Marc-Andre Roy <https://github.com/maroy1986>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
export = guid;
declare function guid(guid: object): object;
declare namespace guid {
const EMPTY: string;
const prototype: {
};
function create(): object;
function isGuid(value: string): boolean;
function raw(): string;
}

23
types/guid/tsconfig.json Normal file
View File

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

1
types/guid/tslint.json Normal file
View File

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