import type { VirtualFS } from '../virtual-fs';
export declare const DEFAULT_NEON_API_HOST = "https://console.neon.tech/api/v2";
export declare const DEFAULT_NEON_OAUTH_HOST = "https://oauth2.neon.tech";
export declare const DEFAULT_NEON_CLIENT_ID = "neonctl";
export declare const DEFAULT_NEON_CONFIG_DIR = "/home/user/.config/neonctl";
export declare const NEON_CREDENTIALS_PATH = "/home/user/.config/neonctl/credentials.json";
export declare const NEON_PENDING_AUTH_PATH = "/home/user/.config/neonctl/pending-auth.json";
export declare const NEON_CALLBACK_REDIRECT_URI = "http://127.0.0.1:44555/callback";
export interface NeonCredentials {
    access_token?: string;
    refresh_token?: string;
    token_type?: string;
    scope?: string;
    expires_in?: number;
    expires_at?: number;
    id_token?: string;
    user_id?: string;
    personal_api_key?: string;
    personal_api_key_id?: string;
    personal_api_key_name?: string;
}
export interface NeonPendingAuthState {
    state: string;
    code_verifier: string;
    oauth_host?: string;
    client_id?: string;
    redirect_uri?: string;
    created_at?: number;
}
export declare function normalizeNeonApiHost(value?: string | null): string;
export declare function normalizeNeonOauthHost(value?: string | null): string;
export declare function readNeonCredentials(vfs: VirtualFS, filePath?: string): NeonCredentials | null;
export declare function readPendingNeonAuthState(vfs: VirtualFS, filePath?: string): NeonPendingAuthState | null;
export declare function writeNeonCredentials(vfs: VirtualFS, credentials: NeonCredentials, filePath?: string): void;
export declare function writePendingNeonAuthState(vfs: VirtualFS, state: NeonPendingAuthState, filePath?: string): void;
export declare function deleteNeonCredentials(vfs: VirtualFS, filePath?: string): boolean;
export declare function deletePendingNeonAuthState(vfs: VirtualFS, filePath?: string): boolean;
export declare function getNeonIdentityLabel(credentials: NeonCredentials | null): string | null;
export declare function getDefaultNeonConfigDir(env?: Record<string, string>): string;
export declare function getNeonCredentialsPath(configDir: string): string;
export declare function getNeonPendingAuthPath(configDir: string): string;
export declare function buildNeonAuthorizationUrl(options: {
    oauthHost?: string;
    clientId?: string;
    redirectUri?: string;
    state: string;
    codeChallenge: string;
}): string;
export declare function createNeonPkcePair(): Promise<{
    codeVerifier: string;
    codeChallenge: string;
    state: string;
}>;
export declare function exchangeNeonAuthorizationCode(options: {
    oauthHost?: string;
    clientId?: string;
    code: string;
    codeVerifier: string;
    redirectUri?: string;
}): Promise<NeonCredentials>;
export declare function refreshNeonCredentials(credentials: NeonCredentials, options?: {
    oauthHost?: string;
    clientId?: string;
}): Promise<NeonCredentials>;
export declare const DEFAULT_NEON_PERSONAL_API_KEY_PREFIX = "almostnode-webide";
export declare function buildDefaultNeonApiKeyName(now?: Date): string;
export declare function deleteNeonApiKey(accessToken: string, keyId: string, options?: {
    apiHost?: string;
}): Promise<boolean>;
export declare function ensureNeonPersonalApiKey(vfs: VirtualFS, options?: {
    apiHost?: string;
    keyName?: string;
    filePath?: string;
}): Promise<NeonCredentials | null>;
export declare function createNeonApiKey(accessToken: string, options: {
    apiHost?: string;
    keyName: string;
}): Promise<{
    id: string | number | null;
    key: string;
    name: string | null;
}>;
//# sourceMappingURL=neon-auth.d.ts.map