import type { InferRecordKey, LexiconRecordKey, RecordSchema } from '@atproto/lex-schema'; import type { DidString, Service } from './types.ts'; type NonReadonly = { -readonly [K in keyof T]: T[K]; }; export type WithDefaults, TDefaults extends Record[]> = TDefaults extends [infer First, ...infer Rest extends any[]] ? TOptions & WithDefaults, Rest> : TOptions; export declare function applyDefaults>, TDefaults extends Readonly>[]>(options: TOptions, ...defaults: TDefaults): WithDefaults; /** * Type guard to check if a value is {@link Blob}-like. * * Handles both native Blobs and polyfilled Blob implementations * (e.g., fetch-blob from node-fetch). * * @param value - The value to check * @returns `true` if the value is a Blob or Blob-like object */ export declare function isBlobLike(value: unknown): value is Blob; export declare function isAsyncIterable(value: T): value is unknown extends T ? T & AsyncIterable : Extract>; export declare function asUint8ArrayArrayBuffer(bytes: Uint8Array): Uint8Array; export type XrpcRequestHeadersOptions = { /** * Additional custom HTTP headers to include in the request. * * @note "atproto-proxy" and "atproto-accept-labelers" headers might change * depending on the `service` and `labelers` options, respectively, if they * are provided (which is always the case when using {@link Client.xrpc}). */ headers?: HeadersInit; /** * Labeler DIDs to request labels from for content moderation. * * When `undefined`, will default to the client instance's default. When * `null`, it will cause any existing `atproto-accept-labelers` header * (including one provided through the * {@link XrpcRequestHeadersOptions.headers} option) to be removed. */ labelers?: null | Iterable; /** * Labeler DIDs to request labels from for content moderation. Values here * will always be applied with the ";redact" suffix, which indicates that the * client is requesting that the labeler redact content that is deemed * inappropriate. */ appLabelers?: null | Iterable; /** * Service proxy identifier for routing requests through a specific service. * * When `undefined`, will default to the client instance's default. When not * used against a client instance (e.g., when using the {@link xrpc} helper * function), the default is to not alter the `atproto-proxy` header (e.g. if * one is provided in the {@link XrpcRequestHeadersOptions.headers}). * * When defined (as either `null` or a string), it will override any * `atproto-proxy` header provided in the * {@link XrpcRequestHeadersOptions.headers} option. */ service?: null | Service; }; /** * Builds HTTP headers for AT Protocol requests. * * Adds or removes the following headers based on the provided options: * - `atproto-proxy`: Service routing header (if service is specified) * - `atproto-accept-labelers`: Comma-separated list of labeler DIDs * * @see {@link XrpcRequestHeadersOptions} * @returns A new Headers object with AT Protocol headers added */ export declare function buildXrpcRequestHeaders({ service, labelers, appLabelers, headers: headersInit, }: XrpcRequestHeadersOptions): Headers; export declare function toReadableStream(data: AsyncIterable): ReadableStream; export declare function toReadableStreamPonyfill(data: AsyncIterable): ReadableStream; export type RecordKeyOptions = T['key'] extends `literal:${string}` | AlsoOptionalWhenRecordKeyIs ? { rkey?: InferRecordKey; } : { rkey: InferRecordKey; }; export declare function getDefaultRecordKey(schema: T): undefined | InferRecordKey; export declare function getLiteralRecordKey(schema: T): InferRecordKey; export declare function mergeHeaders(defaultHeaders: HeadersInit, requestHeaders: HeadersInit): Headers; export declare function wait(ms: number, { signal }?: { signal?: AbortSignal; }): Promise; export declare function trim(value: string): string; export {}; //# sourceMappingURL=util.d.ts.map