diff --git a/types/react-native-uuid/index.d.ts b/types/react-native-uuid/index.d.ts new file mode 100644 index 0000000000..723e8dbaa5 --- /dev/null +++ b/types/react-native-uuid/index.d.ts @@ -0,0 +1,35 @@ +// Type definitions for react-native-uuid 1.4 +// Project: https://github.com/eugenehp/react-native-uuid +// Definitions by: 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; diff --git a/types/react-native-uuid/react-native-uuid-tests.ts b/types/react-native-uuid/react-native-uuid-tests.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/react-native-uuid/tsconfig.json b/types/react-native-uuid/tsconfig.json new file mode 100644 index 0000000000..ff3ad0a6a1 --- /dev/null +++ b/types/react-native-uuid/tsconfig.json @@ -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" + ] +} \ No newline at end of file diff --git a/types/react-native-uuid/tslint.json b/types/react-native-uuid/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-native-uuid/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }