-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: #54699 Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: James M Snell <[email protected]>
- Loading branch information
Showing
3 changed files
with
59 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { TypedArray } from '../globals'; | ||
|
||
declare namespace InternalZlibBinding { | ||
class ZlibBase { | ||
// These attributes are not used by the C++ binding, but declared on JS side. | ||
buffer?: TypedArray; | ||
cb?: VoidFunction; | ||
availOutBefore?: number; | ||
availInBefore?: number; | ||
inOff?: number; | ||
flushFlag?: number; | ||
|
||
reset(): void; | ||
close(): void; | ||
params(level: number, strategy: number): void; | ||
write(flushFlag: number, input: TypedArray, inputOff: number, inputLen: number, out: TypedArray, outOff: number, outLen: number): void; | ||
writeSync(flushFlag: number, input: TypedArray, inputOff: number, inputLen: number, out: TypedArray, outOff: number, outLen: number): void; | ||
} | ||
|
||
class Zlib extends ZlibBase{ | ||
constructor(mode: number) | ||
init(windowBits: number, level: number, memLevel: number, strategy: number, writeState: Uint32Array, callback: VoidFunction, dictionary: Uint32Array): number; | ||
} | ||
|
||
class BrotliDecoder extends ZlibBase { | ||
constructor(mode: number); | ||
init(initParamsArray: Uint32Array, writeState: Uint32Array, callback: VoidFunction): boolean; | ||
} | ||
|
||
class BrotliEncoder extends ZlibBase { | ||
constructor(mode: number); | ||
init(initParamsArray: Uint32Array, writeState: Uint32Array, callback: VoidFunction): boolean; | ||
} | ||
} | ||
|
||
export interface ZlibBinding { | ||
BrotliDecoder: typeof InternalZlibBinding.BrotliDecoder; | ||
BrotliEncoder: typeof InternalZlibBinding.BrotliEncoder; | ||
Zlib: typeof InternalZlibBinding.Zlib; | ||
} |