import type { DatabaseConnection } from '@pondoknusa/database'; import type { OAuthAuthorizeContext, OAuthExchangeContext, SocialOAuthDriver, SocialOAuthDriverConstructor } from './social/types.js'; import type { OAuthProviderConfig } from './types.js'; import type { Authenticatable, UserModelConstructor } from './types.js'; import type { OAuthUserProfile } from './oauth-types.js'; export type { OAuthUserProfile } from './oauth-types.js'; export type { OAuthAuthorizeContext, OAuthExchangeContext } from './social/types.js'; export type { PkcePair } from './social/pkce.js'; export { createPkcePair } from './social/pkce.js'; export type OAuthDriver = SocialOAuthDriver; export type OAuthDriverConstructor = SocialOAuthDriverConstructor; export { AppleOAuthDriver, BitbucketOAuthDriver, DiscordOAuthDriver, FacebookOAuthDriver, GithubOAuthDriver, GitlabOAuthDriver, GoogleOAuthDriver, LinkedInOAuthDriver, MicrosoftOAuthDriver, SlackOAuthDriver, SpotifyOAuthDriver, TwitchOAuthDriver, XOAuthDriver, } from './social/builtin-drivers.js'; export declare function registerOAuthDriver(name: string, ctor: SocialOAuthDriverConstructor): void; export declare function clearOAuthDriversForTesting(): void; export declare class OAuthStateError extends Error { constructor(message?: string); } export declare function bindOAuthState(session: import('./session.js').Session, provider: string, state: string): void; export declare function consumeOAuthState(session: import('./session.js').Session, provider: string, state: string): void; export declare class OAuthManager { private readonly connection; private readonly accountsTable; private readonly userModel; private readonly drivers; private readonly hasher; constructor(providers: Record, connection: DatabaseConnection, accountsTable: string, userModel: UserModelConstructor); createState(): string; bindOAuthState(session: import('./session.js').Session, provider: string, state: string): void; consumeOAuthState(session: import('./session.js').Session, provider: string, state: string): void; createPkcePair(): import("./social/pkce.js").PkcePair; redirectUrl(provider: string, state: string, authorize?: OAuthAuthorizeContext): string; handleCallback(provider: string, code: string, exchange?: OAuthExchangeContext, options?: { state?: string; session?: import('./session.js').Session; /** Opt out of CSRF state verification for non-browser (e.g. machine-to-machine) flows. */ skipStateVerification?: boolean; }): Promise; driverUsesPkce(provider: string): boolean; findOrCreateUser(provider: string, profile: OAuthUserProfile): Promise; } //# sourceMappingURL=oauth.d.ts.map