@atproto/oauth-client
Version:
OAuth client for ATPROTO PDS. This package serves as common base for environment-specific implementations (NodeJS, Browser, React-Native).
25 lines • 1.57 kB
TypeScript
export type Awaitable<T> = T | PromiseLike<T>;
export type Simplify<T> = {
[K in keyof T]: T[K];
} & NonNullable<unknown>;
/**
* @todo (?) move to common package
*/
export declare const timeoutSignal: (timeout: number, options?: {
signal?: AbortSignal;
}) => AbortSignal & Disposable;
export declare function contentMime(headers: Headers): string | undefined;
/**
* Ponyfill for `CustomEvent` constructor.
*/
export declare const CustomEvent: typeof globalThis.CustomEvent;
export declare class CustomEventTarget<EventDetailMap extends Record<string, unknown>> {
readonly eventTarget: EventTarget;
addEventListener<T extends Extract<keyof EventDetailMap, string>>(type: T, callback: (event: CustomEvent<EventDetailMap[T]>) => void, options?: AddEventListenerOptions | boolean): void;
removeEventListener<T extends Extract<keyof EventDetailMap, string>>(type: T, callback: (event: CustomEvent<EventDetailMap[T]>) => void, options?: EventListenerOptions | boolean): void;
dispatchCustomEvent<T extends Extract<keyof EventDetailMap, string>>(type: T, detail: EventDetailMap[T], init?: EventInit): boolean;
}
export type SpaceSeparatedValue<Value extends string> = `${Value}` | `${Value} ${string}` | `${string} ${Value}` | `${string} ${Value} ${string}`;
export declare const includesSpaceSeparatedValue: <Value extends string>(input: string, value: Value) => input is SpaceSeparatedValue<Value>;
export declare function combineSignals(signals: readonly (AbortSignal | undefined)[]): AbortController & Disposable;
//# sourceMappingURL=util.d.ts.map