import { Stream } from 'node:stream'; import { Buffer } from 'node:buffer'; /** * @module * * Zurk utility functions * * @example * ```ts * import {randomId} from 'zurk/util' * * randomId() // 'kdrx9bngrb' * ``` */ export declare const g: typeof globalThis; export declare const immediate: typeof setImmediate; export declare const noop: () => void; export declare const asyncVoidCall: (cb: TVoidCallback) => () => Promise; export declare const randomId: () => string; export type PromiseResolve = (value: T | PromiseLike) => void; export type TVoidCallback = (...any: any) => void; export type Promisified = { [K in keyof T]: T[K] extends (...args: any) => infer R ? (...args: Parameters) => Promise : Promise; }; export declare const makeDeferred: () => { promise: Promise; resolve: PromiseResolve; reject: PromiseResolve; }; export declare const isPromiseLike: (value: any) => boolean; export declare const isStringLiteral: (pieces: any, ...rest: any[]) => pieces is TemplateStringsArray; export declare const assign: (target: T, ...extras: E[]) => T; export declare const quote: (arg: string) => string; export declare function quotePwsh(arg: string): string; export type TQuote = (input: string) => string; export declare const buildCmd: (quote: TQuote, pieces: TemplateStringsArray, args: any[], subs?: TSubstitute) => string | Promise; export type TSubstitute = (arg: any) => string; export declare const substitute: TSubstitute; export declare const parseInput: (input: any) => string | Buffer | Stream | null; export declare const pFinally: (p: Promise, cb: TVoidCallback) => Promise;