import { type AsyncFunctionConstructor, type Base64String, type CodePoint, type ReadonlyTuple } from "./types.js"; import type { AsyncOrSync, DeepReadonly, DeepWritable, Newable } from "ts-essentials"; import { type PrimitiveTypeE, type TypeofMapE } from "./typeof.js"; import { type Options } from "browser-util-inspect"; import AsyncLock from "async-lock"; export type KeyModifier = "Alt" | "Ctrl" | "Meta" | "Shift"; export declare class EventEmitterLite { #private; protected static readonly emitLock = "emit"; protected readonly lock: AsyncLock; emit(...args: A): Promise; listen(listener: (...args: A) => unknown): () => void; } export type PromisePromise = Promise<{ readonly promise: Promise; readonly resolve: (value: AsyncOrSync) => void; readonly reject: (reason?: unknown) => void; }>; export declare class Functions extends Array unknown : Async extends false ? (...args: Args) => void : never> { protected readonly options: { readonly async: Async; readonly settled?: boolean; }; constructor(options: { readonly async: Async; readonly settled?: boolean; }, ...args: readonly (Async extends true ? (...args: Args) => unknown : Async extends false ? (...args: Args) => void : never)[]); transform(func: (self0: this[number][]) => readonly this[number][]): Functions; call(...args: Args): Async extends true ? Promise : Async extends false ? void : never; call0(thisArg: unknown, ...args: Args): Async extends true ? Promise : Async extends false ? void : never; } export declare function acquireConditionally(lock: AsyncLock, key: string[] | string, condition: boolean, fn: () => PromiseLike | T): Promise; export declare function alternativeRegExp(strs: readonly string[]): RegExp; export declare function anyToError(obj: unknown): Error; export declare function aroundIdentityFactory unknown>(): (proto: T) => (this: ThisParameterType, ...args: Parameters) => ReturnType; export declare function assignExact>>(self0: T, key: K & keyof T, value?: T[K]): typeof value; export declare function asyncDebounce(func: (resolve: (value: AsyncOrSync) => void, reject: (reason?: unknown) => void, ...args: A) => unknown): (...args: A) => Promise; export declare function asyncFunction(self0: typeof globalThis): AsyncFunctionConstructor; export declare function base64ToBytes(base64: Base64String): Uint8Array; export declare function base64ToString(base64: Base64String): string; export declare function basename(path: string, ext?: string): string; export declare function bigIntReplacer(): (key: string, value: unknown) => unknown; export declare function bracket(self0: T, key: K): { readonly valid: false; readonly value?: never; } | { readonly valid: true; readonly value: T[K & keyof T]; }; export declare function bytesToBase64(bytes: Uint8Array): Base64String; export declare function capitalize(str: string, locales?: string[] | string): string; export declare function cartesianProduct(...arrays: T): readonly ({ readonly [I in keyof T]: T[I][number]; } & { readonly length: T["length"]; })[]; export declare function clear(self0: unknown[]): void; export declare function clearProperties(self0: object): void; export declare function cloneAsFrozen(obj: T, cloner?: (value: V) => V): DeepReadonly; export declare function cloneAsWritable(obj: T, cloner?: (value: V) => V): DeepWritable; export declare function consumeEvent(event: Event): void; export declare function copyOnWrite(obj: DeepReadonly, mutator: (obj: DeepWritable) => void): DeepReadonly; export declare function copyOnWriteAsync(obj: DeepReadonly, mutator: (obj: DeepWritable) => unknown): Promise>; export declare function createChildElement(element: ParentNode & { readonly ownerDocument: Document; }, type: K, callback?: (_element: HTMLElementTagNameMap[K]) => void, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; export declare function createDocumentFragment(self0: Document, callback: (fragment: DocumentFragment) => void): DocumentFragment; export declare function deepFreeze(value: T): DeepReadonly; export declare function escapeJavaScriptString(value: string): string; export declare function escapeQuerySelectorAttribute(value: string): string; export declare function extname(path: string): string; export declare function getKeyModifiers(event: KeyboardEvent): readonly KeyModifier[]; export declare function typedIn(self0: T, key: K): (() => T[K & keyof T]) | null; export declare function typedOwnKeys(self0: T): (keyof T & (string | number | symbol))[]; export declare function typedKeys(): > : never>(obj: O) => Readonly; export declare function inSet(set: T, obj: unknown): obj is T[number]; export declare function insertAt(self0: T[], index: number, ...items: readonly T[]): void; export declare function instanceOf(self0: unknown, type: Newable): self0 is T; export declare function isHomogenousArray(types: readonly T[], value: unknown): value is TypeofMapE[T][]; export declare function isNonNil(value: T & (null | undefined) extends never ? never : T): value is T & (null | undefined) extends never ? never : NonNullable; export declare function lazyInit(initializer: () => T): () => T; export declare function lazyProxy(initializer: () => T): T; export declare function logFormat(options: Options, ...args: readonly unknown[]): string; export declare function mapFirstCodePoint(str: string, map: (value: string) => string, mapRest?: (value: string) => string): string; export declare function multireplace(self0: string, replacements: Map): string; export declare function onResize(element: Element, callback: (entry: ResizeObserverEntry) => void): ResizeObserver; export declare function onVisible(element: Element, callback: (entry: IntersectionObserverEntry) => void, transient?: boolean): IntersectionObserver; export declare function openExternal(self0: Window, url?: URL | string): Window | null; export declare function promisePromise(): PromisePromise; export declare function randomNotIn(self0: readonly string[], generator?: () => string): string; export declare function rangeCodePoint(start: CodePoint, end?: CodePoint, step?: number): readonly string[]; export declare function remove(self0: T[], item: T): T | undefined; export declare function removeAt(self0: T[], index: number): T | undefined; export declare function replaceAllRegex(string: string): RegExp; export declare function splitLines(str: string, delimiter?: RegExp): readonly string[]; export declare function startCase(str: string, locales?: string[] | string): string; export declare function stringToBase64(string: string): Base64String; export declare function toJSONOrString(value: unknown, replacer?: (this: unknown, key: string, value: unknown) => unknown, space?: string | number): string; export declare function activeSelf(reference?: Element | UIEvent | null): Window & typeof globalThis; export declare function sleep2(self0: WindowOrWorkerGlobalScope, timeInSeconds: number): Promise; export declare function swap(self0: unknown[], left: number, right: number): void; export declare function uncapitalize(str: string, locales?: string[] | string): string; export declare function unexpected(): never; //# sourceMappingURL=utils.d.ts.map