From 4e87195739f2a5d9a05451b48773c8afdc680765 Mon Sep 17 00:00:00 2001 From: akiyamn Date: Sun, 24 Sep 2023 23:22:21 +1000 Subject: Initial commit (by create-cloudflare CLI) --- node_modules/blake3-wasm/esm/base/hash-reader.d.ts | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 node_modules/blake3-wasm/esm/base/hash-reader.d.ts (limited to 'node_modules/blake3-wasm/esm/base/hash-reader.d.ts') diff --git a/node_modules/blake3-wasm/esm/base/hash-reader.d.ts b/node_modules/blake3-wasm/esm/base/hash-reader.d.ts new file mode 100644 index 0000000..ad6a8fa --- /dev/null +++ b/node_modules/blake3-wasm/esm/base/hash-reader.d.ts @@ -0,0 +1,61 @@ +import { IDisposable } from './disposable'; +/** + * The maximum number of bytes that can be read from the hash. + * + * Calculated out 2^64-1, since `Xn` syntax (for `Xn ** Yn`) requires TS + * targeting esnext/es2020 which includes features that Node 10 doesn't + * yet supported. + */ +export declare const maxHashBytes: bigint; +/** + * The HashReader is a type returned from any of the hash functions. It can + */ +export interface IHashReader extends IDisposable { + /** + * Returns the position of the reader in the hash. Can be written to to seek. + */ + position: bigint; + /** + * Reads data from the hash into the target array. The target will always + * be completely filled with data. + */ + readInto(target: Uint8Array): void; + /** + * Reads and returns the given number of bytes from the hash, advancing + * the position of the reader. + */ + read(bytes: number): T; +} +/** + * Underlying native or wasm module code backing the reader. + * @hidden + */ +export interface IInternalReader { + free?(): void; + fill(target: Uint8Array): void; + set_position(position: bigint): void; +} +/** + * Base hash reader implementation. + */ +export declare abstract class BaseHashReader implements IHashReader { + private reader; + private pos; + get position(): bigint; + set position(value: bigint); + constructor(reader: IInternalReader); + /** + * @inheritdoc + */ + readInto(target: Uint8Array): void; + /** + * @inheritdoc + */ + read(bytes: number): T; + /** + * @inheritdoc + */ + dispose(): void; + protected abstract alloc(bytes: number): T; + private boundsCheck; +} -- cgit v1.2.3