## API Report File for "@tldraw/utils" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts // @internal export function annotateError(error: unknown, annotations: Partial): void; // @internal (undocumented) export const assert: (value: unknown, message?: string) => asserts value; // @internal (undocumented) export const assertExists: (value: T, message?: string | undefined) => NonNullable; // @internal (undocumented) export function compact(arr: T[]): NonNullable[]; // @public export function debounce(callback: (...args: T) => PromiseLike | U, wait: number): { (...args: T): Promise; cancel(): void; }; // @public export function dedupe(input: T[], equals?: (a: any, b: any) => boolean): T[]; // @public export function deepCopy(obj: T): T; // @public (undocumented) export type ErrorResult = { readonly ok: false; readonly error: E; }; // @internal (undocumented) export function exhaustiveSwitchError(value: never, property?: string): never; // @internal (undocumented) export function getErrorAnnotations(error: Error): ErrorAnnotations; // @public export function getFirstFromIterable(set: Map | Set): T; // @public export function getHashForObject(obj: any): string; // @public export function getHashForString(string: string): string; // @internal (undocumented) export function getOwnProperty(obj: Partial>, key: K): undefined | V; // @internal (undocumented) export function getOwnProperty(obj: object, key: string): unknown; // @internal (undocumented) export function hasOwnProperty(obj: object, key: string): boolean; // @public export function isDefined(value: T): value is typeof value extends undefined ? never : T; // @public export function isNonNull(value: T): value is typeof value extends null ? never : T; // @public export function isNonNullish(value: T): value is typeof value extends undefined ? never : typeof value extends null ? never : T; // @internal (undocumented) export function last(arr: readonly T[]): T | undefined; // @public export function lerp(a: number, b: number, t: number): number; // @public (undocumented) export function lns(str: string): string; // @internal (undocumented) export function minBy(arr: readonly T[], fn: (item: T) => number): T | undefined; // @public export function modulate(value: number, rangeA: number[], rangeB: number[], clamp?: boolean): number; // @internal export function objectMapEntries(object: { [K in Key]: Value; }): Array<[Key, Value]>; // @internal export function objectMapKeys(object: { readonly [K in Key]: unknown; }): Array; // @internal export function objectMapValues(object: { [K in Key]: Value; }): Array; // @public (undocumented) export type OkResult = { readonly ok: true; readonly value: T; }; // @internal export function omitFromStackTrace, Return>(fn: (...args: Args) => Return): (...args: Args) => Return; // @internal export function partition(arr: T[], predicate: (item: T) => boolean): [T[], T[]]; // @internal (undocumented) export function promiseWithResolve(): Promise & { resolve: (value: T) => void; reject: (reason?: any) => void; }; // @public (undocumented) export type Result = ErrorResult | OkResult; // @public (undocumented) export const Result: { ok(value: T): OkResult; err(error: E): ErrorResult; }; // @public export function rng(seed?: string): () => number; // @public export function rotateArray(arr: T[], offset: number): T[]; // @public (undocumented) const structuredClone_2: (i: T) => T; export { structuredClone_2 as structuredClone } // @public export function throttle any>(func: T, limit: number): (...args: Parameters) => ReturnType; // (No @packageDocumentation comment for this package) ```