import * as Effect from "effect/Effect";
declare const OAuthError_base: new = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
readonly _tag: "OAuthError";
} & Readonly;
export declare class OAuthError extends OAuthError_base<{
error: string;
errorDescription: string;
}> {
}
export interface OAuthCredentials {
type: "oauth";
access: string;
refresh: string;
expires: number;
scopes: string[];
}
export interface Authorization {
url: string;
state: string;
verifier: string;
}
/**
* Generate an authorization URL with PKCE for the given scopes.
*/
export declare function authorize(scopes: string[]): Authorization;
/**
* Exchange an authorization code for OAuth credentials.
*/
export declare const exchange: (code: string, verifier: string) => Effect.Effect;
/**
* Refresh expired OAuth credentials.
*/
export declare const refresh: (credentials: OAuthCredentials) => Effect.Effect;
/**
* Revoke OAuth credentials.
*/
export declare const revoke: (credentials: OAuthCredentials) => Effect.Effect;
/**
* Exchange a code copied from the hosted relay page, or extract the code from
* either the hosted or loopback callback URL.
*/
export declare const exchangeCallbackInput: (input: string, authorization: Authorization) => Effect.Effect;
/**
* Start a local HTTP server to listen for the OAuth callback, exchange
* the authorization code, and return the credentials.
*
* Times out after 5 minutes.
*/
export declare const callback: (authorization: Authorization) => Effect.Effect;
export {};
//# sourceMappingURL=OAuthClient.d.ts.map