mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Add typings for uuid-parse
This commit is contained in:
25
types/uuid-parse/index.d.ts
vendored
Normal file
25
types/uuid-parse/index.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// Type definitions for uuid-parse 1.0
|
||||
// Project: https://github.com/zefferus/uuid-parse
|
||||
// Definitions by: Christian Rackerseder <https://github.com/screendriver>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
import 'node';
|
||||
|
||||
/**
|
||||
* Parse a UUID into it's component bytes
|
||||
* @param id UUID (-like) string
|
||||
* @param buffer Array or buffer where UUID bytes are to be written. Default: A new Buffer is used
|
||||
* @param offset Starting index in buffer at which to begin writing. Default: 0
|
||||
*/
|
||||
export function parse(
|
||||
id: string,
|
||||
buffer?: Buffer | any[],
|
||||
offset?: number,
|
||||
): Buffer;
|
||||
|
||||
/**
|
||||
* Convert UUID byte array (ala parse()) into a string
|
||||
* @param buffer Array or buffer where UUID bytes are read.
|
||||
* @param offset Starting index in buffer at which to begin reading. Default: 0
|
||||
*/
|
||||
export function unparse(buffer: Buffer, offset?: number): string;
|
||||
23
types/uuid-parse/tsconfig.json
Normal file
23
types/uuid-parse/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",
|
||||
"uuid-parse-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/uuid-parse/tslint.json
Normal file
1
types/uuid-parse/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
9
types/uuid-parse/uuid-parse-tests.ts
Normal file
9
types/uuid-parse/uuid-parse-tests.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import * as uuidParse from 'uuid-parse';
|
||||
|
||||
uuidParse.parse('797ff043-11eb-11e1-80d6-510998755d10');
|
||||
uuidParse.parse('797ff043-11eb-11e1-80d6-510998755d10', []);
|
||||
uuidParse.parse('797ff043-11eb-11e1-80d6-510998755d10', new Buffer(''));
|
||||
uuidParse.parse('797ff043-11eb-11e1-80d6-510998755d10', new Buffer(''), 123);
|
||||
|
||||
uuidParse.unparse(new Buffer(''));
|
||||
uuidParse.unparse(new Buffer(''), 123);
|
||||
Reference in New Issue
Block a user