Merge pull request #29965 from fredj/pbf_constructor_type

[pbf] Add ArrayBuffer to the constructor argument type
This commit is contained in:
Daniel Rosenwasser
2018-10-30 12:47:44 -07:00
committed by GitHub
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ declare class Pbf {
type: number;
length: number;
constructor(buffer?: Uint8Array);
constructor(buffer?: Uint8Array|ArrayBuffer);
destroy(): void;
readFields<T>(readField: (tag: number, result?: T, pbf?: Pbf) => void, result?: T, end?: number): T;
+1
View File
@@ -2,6 +2,7 @@ import Pbf = require('pbf');
const pbf = new Pbf(new Uint8Array(1));
new Pbf();
new Pbf(new ArrayBuffer(8));
pbf.buf;
pbf.pos;
pbf.type;