import type { LongLivedToken, OAuthConfig, ShortLivedToken } from "./types.ts"; export declare function createOAuth(config: OAuthConfig): { /** * Generate the authorization URL to redirect users to. */ getAuthorizationUrl(opts?: { scopes?: string[]; state?: string; }): string; /** * Exchange authorization code for a short-lived token. */ exchangeCode(code: string): Promise; /** * Exchange short-lived token for a long-lived token (60 days). */ exchangeForLongLived(shortLivedToken: string): Promise; /** * Refresh a long-lived token before it expires. * Returns a new token valid for another 60 days. * Can only refresh tokens that are at least 24 hours old and not expired. */ refreshToken(longLivedToken: string): Promise; /** * Full OAuth flow helper: exchange code -> get long-lived token in one call. */ completeOAuth(code: string): Promise<{ token: LongLivedToken; userId: string; }>; }; //# sourceMappingURL=oauth.d.ts.map