import _crypto from 'crypto'; import { inspect as nodeUtilsInspect, types as nodeUtilsTypes } from 'util'; import type { JSONSerializable } from './conversion'; export declare function getTypedObjectEntries(obj: T): Array<[keyof T, T[keyof T]]>; export type DistributiveOmit = T extends T ? Omit : never; export declare function validateBase64ToBuffer(input: string): Buffer; export declare function bufferToArrayBuffer(input: Buffer): ArrayBuffer; export declare function bufferToBigInt(buffer: Buffer): bigint; /** * Check if a value is an integer or a bigint. */ export declare function isIntegerOrBigInt(value: unknown): boolean; /** * Check if a value is a Buffer. This exists due to an inconsistency with the * way `Buffer.isBuffer` is defined in `@types/node` and differs from similar * functionality such as `Array.isArray`. This leads `Buffer.isBuffer` to * result in an unbound method reference error despite being a static call. * Eslint Rule: eslint@typescript-eslint/unbound-method */ export declare function isBuffer(value: unknown): value is Buffer; export declare function arrayRepeat(value: T, length: number): T[]; /** * Waits a specific number of ticks and then resolves */ export declare function waitTicks(ticks: number): Promise; /** * Returns env variable, or default * Throws if neither are defined */ export declare function env(name: string, defaultValue?: string): string; export declare function booleanEnv(name: string, defaultValue?: boolean): boolean; /** * Generate a random string from length provided (default 32) */ export declare function randomString(requestedLength?: number): string; export declare function randomInt(min: number, max: number): number; export declare function asleep(time_ms: number): Promise; export declare function promiseGenerator(): { promise: Promise; resolve: (value: T) => void; reject: (error: any) => void; }; export declare function objectToBuffer(input: any): Buffer; export declare function debugPrintableObject(input: any): JSONSerializable; interface Constructor { new (...args: any[]): T; } interface IsInstance { check(obj: any, strict?: boolean): obj is T; } export declare function checkableGenerator

, T = InstanceType

>(parent: P, defaultStrict?: boolean): IsInstance['check']; export declare function nonNullable(value: T): NonNullable; export type DeepMutable = { -readonly [P in keyof T]: DeepMutable; }; interface WithIsInstance extends Constructor { isInstance(arg: any): arg is Inst; } type EncodeFunc = (a: Inst) => Enc; type DecodeFunc = (a: Enc) => Inst; type CanBeArray = T | T[]; interface InstanceSet extends Set { add(data: CanBeArray): this; forEach(callbackfn: (value: Instance, value2: Instance, set: InstanceSet) => void, thisArg?: any): void; hasInternal(data: Encoded): boolean; addInternal(data: Encoded): this; deleteInternal(data: Encoded): boolean; valuesInternal(): IterableIterator; toArray(): Instance[]; toArrayInternal(): Encoded[]; isSubsetOf(data: InstanceSet): boolean; isEqualTo(data: InstanceSet): boolean; } /** * AsyncDisposableStack https://github.com/tc39/proposal-explicit-resource-management */ export declare const AsyncDisposableStack: AsyncDisposableStackConstructor; export interface InstanceSetConstructor { new (data?: Iterable<(Instance)>): InstanceSet; } export declare function setGenerator

, E extends EncodeFunc, D extends DecodeFunc, Instance = InstanceType

, Encoded = ReturnType>(parent: P, rawEncode: E, rawDecode: D): InstanceSetConstructor; export declare const crypto: { randomUUID: typeof _crypto.randomUUID | (() => string); randomBytes: typeof _crypto.randomBytes; createCipheriv: typeof _crypto.createCipheriv; createDecipheriv: typeof _crypto.createDecipheriv; createHash: typeof _crypto.createHash; createHmac: typeof _crypto.createHmac; }; export declare const util: { inspect: typeof nodeUtilsInspect; types: typeof nodeUtilsTypes; }; export {};