Added definitions for react-native-uuid

Added definitions for react-native-uuid class.
This commit is contained in:
Haseeb Majid
2019-03-21 23:13:17 +00:00
parent 14d3206770
commit 1dced7785a
4 changed files with 60 additions and 0 deletions

35
types/react-native-uuid/index.d.ts vendored Normal file
View File

@@ -0,0 +1,35 @@
// Type definitions for react-native-uuid 1.4
// Project: https://github.com/eugenehp/react-native-uuid
// Definitions by: hmajid2301 <https://github.com/hmajid2301>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface v1 {
options?: {
node: number[],
clockseq: number,
msec: number | Date,
nsec: number
},
buffer?: ArrayBuffer,
offset?: number
}
interface v4 {
options?: {
random: number[],
rng: (...args: any) => void,
},
buffer?: ArrayBuffer,
offset?: number
}
interface UUID {
v1: (options: v1) => string;
v4: (options: v4) => string;
parse: (id: string, buffer?: ArrayBuffer, offset?: number) => ArrayBuffer;
unparse: (id: string, buffer?: ArrayBuffer, offset?: number) => string;
noConflict: () => void;
}
export const uuid: UUID;

View File

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

View File

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