import type { AtprotoDid } from '@atproto/did';
import type { AtprotoOAuthScope, OAuthAuthorizationServerMetadata } from '@atproto/oauth-types';
import { type Fetch } from '@atproto-labs/fetch';
import type { OAuthServerAgent, TokenSet } from './oauth-server-agent.js';
import type { SessionGetter } from './session-getter.js';
export type { AtprotoDid, AtprotoOAuthScope };
export type TokenInfo = {
    expiresAt?: Date;
    expired?: boolean;
    scope: AtprotoOAuthScope;
    iss: string;
    aud: string;
    sub: AtprotoDid;
};
export declare class OAuthSession {
    readonly server: OAuthServerAgent;
    readonly sub: AtprotoDid;
    private readonly sessionGetter;
    protected dpopFetch: Fetch<unknown>;
    constructor(server: OAuthServerAgent, sub: AtprotoDid, sessionGetter: SessionGetter, fetch?: Fetch);
    get did(): AtprotoDid;
    get serverMetadata(): Readonly<OAuthAuthorizationServerMetadata>;
    /**
     * @param refresh When `true`, the credentials will be refreshed even if they
     * are not expired. When `false`, the credentials will not be refreshed even
     * if they are expired. When `undefined`, the credentials will be refreshed
     * if, and only if, they are (about to be) expired. Defaults to `undefined`.
     */
    protected getTokenSet(refresh: boolean | 'auto'): Promise<TokenSet>;
    getTokenInfo(refresh?: boolean | 'auto'): Promise<TokenInfo>;
    signOut(): Promise<void>;
    fetchHandler(pathname: string, init?: RequestInit): Promise<Response>;
}
//# sourceMappingURL=oauth-session.d.ts.map