snappy
Version:
Fastest Snappy compression library in Node.js
35 lines (26 loc) • 1.38 kB
TypeScript
/* tslint:disable */
/* eslint-disable */
/* auto-generated by NAPI-RS */
export interface DecOptions {
asBuffer?: boolean
/**
* do not use `create_external_buffer` to create the output buffer
* set this option to `true` will make the API slower
* for compatibility with electron >= 21
* see https://www.electronjs.org/blog/v8-memory-cage and https://github.com/electron/electron/issues/35801#issuecomment-1261206333
*/
copyOutputData?: boolean
}
export interface EncOptions {
/**
* do not use `create_external_buffer` to create the output buffer
* for compatibility with electron >= 21
* set this option to `true` will make the API slower
* see https://www.electronjs.org/blog/v8-memory-cage and https://github.com/electron/electron/issues/35801#issuecomment-1261206333
*/
copyOutputData?: boolean
}
export function compressSync(input: string | Buffer, options?: EncOptions | undefined | null): Buffer
export function compress(input: string | Buffer, options?: EncOptions | undefined | null, signal?: AbortSignal | undefined | null): Promise<Buffer>
export function uncompressSync(input: string | Buffer, options?: DecOptions | undefined | null): string | Buffer
export function uncompress(input: string | Buffer, options?: DecOptions | undefined | null, signal?: AbortSignal | undefined | null): Promise<string | Buffer>