mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Update typings for 1.5.0 (#42096)
- Add 64-bit integer function definitions [u]int64{le, be}
- Bump required TS version to 3.2 due to bigint usage
- Add seek (skip alias)
This commit is contained in:
parent
66386e9f82
commit
9d2652f706
@ -118,3 +118,17 @@ const result = parser6.parse(Buffer.from([0x01, 0x02, 0x03, 0x04, 0x05]));
|
||||
result.nested.points[0].x;
|
||||
result.nested.points[1].y;
|
||||
result.optional.number;
|
||||
|
||||
const parser7 = new Parser()
|
||||
// Signed 64-bit integer
|
||||
.int64('a')
|
||||
// Unsigned 64-bit integer
|
||||
.uint64('b')
|
||||
// Signed 64-bit integer (little endian)
|
||||
.int64le('c')
|
||||
// Signed 64-bit integer (big endian)
|
||||
.int64be('d')
|
||||
// Unsigned 64-bit integer (little endian)
|
||||
.uint64le('e')
|
||||
// Unsigned 64-bit integer (big endian)
|
||||
.uint64be('f');
|
||||
|
||||
16
types/binary-parser/index.d.ts
vendored
16
types/binary-parser/index.d.ts
vendored
@ -1,10 +1,11 @@
|
||||
// Type definitions for binary-parser 1.3
|
||||
// Type definitions for binary-parser 1.5
|
||||
// Project: https://github.com/keichi/binary-parser
|
||||
// Definitions by: Benjamin Riggs <https://github.com/riggs>,
|
||||
// Dolan Miu <https://github.com/dolanmiu>,
|
||||
// Yu Shimura <https://github.com/yuhr>
|
||||
// Yu Shimura <https://github.com/yuhr>,
|
||||
// John Mark Gabriel Caguicla <https://github.com/caguiclajmg>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
// TypeScript Version: 3.2
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
@ -30,6 +31,13 @@ export interface Parser<O extends object | undefined = undefined> {
|
||||
uint32le<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
|
||||
uint32be<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
|
||||
|
||||
int64<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, bigint>;
|
||||
uint64<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, bigint>;
|
||||
int64le<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, bigint>;
|
||||
int64be<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, bigint>;
|
||||
uint64le<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, bigint>;
|
||||
uint64be<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, bigint>;
|
||||
|
||||
bit1<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
|
||||
bit2<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
|
||||
bit3<N extends string>(name: N, options?: Parser.Options): Parser.Next<O, N, number>;
|
||||
@ -109,6 +117,8 @@ export interface Parser<O extends object | undefined = undefined> {
|
||||
|
||||
skip(length: number): Parser<O>;
|
||||
|
||||
seek(length: number): Parser<O>;
|
||||
|
||||
endianess(endianess: Parser.Endianness): Parser<O>; /* [sic] */
|
||||
|
||||
namely(alias: string): Parser<O>;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user