type InternalHandler = (value: Value, state: State) => Value; interface State { cache: WeakMap; clone: InternalHandler; } /** * The set of per-type copier functions that {@link Options.handler} can override. * * Every key is optional, so a single custom handler (e.g. `{ Date: myFn }`) is * enough — the rest fall back to the built-in defaults. Only the types listed here * are dispatched through the handler table; typed arrays are always cloned via the * `ArrayBuffer` handler, so they have no dedicated keys. */ type Handlers = { Array: InternalHandler; ArrayBuffer: InternalHandler; Blob: InternalHandler; DataView: InternalHandler; Date: InternalHandler; Error: InternalHandler; File: InternalHandler; Function: InternalHandler; Map: InternalHandler>; Object: InternalHandler>; Promise: InternalHandler>; RegExp: InternalHandler; Set: InternalHandler>; SharedArrayBuffer: InternalHandler; WeakMap: InternalHandler>; WeakSet: InternalHandler>; }; type Options = { handler?: Partial; strict?: boolean; }; type TypedArray = BigInt64Array | BigUint64Array | Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array; export { Handlers as H, Options as O, State as S, TypedArray as T };