import type { ClientOAuth2TokenData } from '@n8n/client-oauth2';
import type { IExecuteFunctions, ILoadOptionsFunctions, ISupplyDataFunctions } from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow';
type TokenContext = IExecuteFunctions | ISupplyDataFunctions | ILoadOptionsFunctions;
export type OAuth2TokenData = Partial<ClientOAuth2TokenData>;
export interface OAuth2UserCredential {
    oauthTokenData?: OAuth2TokenData;
    tokenExpiredStatusCode?: number;
}
export interface RefreshingTokenSource {
    getToken: () => Promise<string>;
    refreshAfterRejection?: () => Promise<string | null>;
    expiredStatus?: number;
}
export declare class OAuth2SessionExpiredError extends NodeOperationError {
}
export declare function findSessionExpiredError(error: unknown): OAuth2SessionExpiredError | undefined;
export declare function createRefreshingOAuth2TokenProvider(options: {
    ctx: TokenContext;
    credentialType: string;
    credential: OAuth2UserCredential;
    serviceName: string;
}): RefreshingTokenSource;
export {};
