mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-28 08:17:54 +08:00
Merge pull request #21072 from maroy1986/master
Added types for npm guid package
This commit is contained in:
18
types/guid/guid-tests.ts
Normal file
18
types/guid/guid-tests.ts
Normal 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
22
types/guid/index.d.ts
vendored
Normal 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
23
types/guid/tsconfig.json
Normal 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
1
types/guid/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user