DefinitelyTyped/types/react-native-uuid/react-native-uuid-tests.ts
Haseeb Majid a5c4b9a021 Added react-native-uuid (#34117)
* Added definitions for react-native-uuid

Added definitions for react-native-uuid class.

* Added Changes

* Added Suggested Changes
2019-03-25 09:50:51 -07:00

20 lines
447 B
TypeScript

import uuid from 'react-native-uuid';
uuid.v1({
node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
clockseq: 0x1234,
msecs: new Date('2011-11-01').getTime(),
nsecs: 5678
});
uuid.v4({
random: [
0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,
0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36
]
});
const bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10');
const string = uuid.unparse(bytes);
const myUuid = uuid.noConflict();