import { type ChatGPTCodexAuthSnapshot, type ChatGPTCodexPublicSnapshot } from "./codexAuth.js";
export type ChatGPTCodexTokenSet = {
    idToken: string;
    accessToken: string;
    refreshToken: string;
};
export type CodexAuthJsonRecord = {
    auth_mode: "chatgpt";
    OPENAI_API_KEY: null;
    tokens: {
        id_token: string;
        access_token: string;
        refresh_token: string;
        account_id?: string;
    };
    last_refresh: string;
};
export type CodexAuthPersistencePlan = {
    record: CodexAuthJsonRecord;
    authJsonText: string;
    snapshot: ChatGPTCodexAuthSnapshot;
    publicSnapshot: ChatGPTCodexPublicSnapshot;
    publicSafe: false;
};
export type CodexAuthJsonWriter = (request: {
    targetPath?: string;
    authJsonText: string;
    publicSnapshot: ChatGPTCodexPublicSnapshot;
}) => void | Promise<void>;
export declare function createCodexAuthJsonPersistencePlan(input: {
    tokens: ChatGPTCodexTokenSet;
    lastRefresh?: string;
    now?: Date | (() => Date);
}): CodexAuthPersistencePlan;
export declare function persistCodexAuthJson(input: {
    plan: CodexAuthPersistencePlan;
    targetPath?: string;
    writeAuthJson: CodexAuthJsonWriter;
}): Promise<{
    ok: true;
    targetPath?: string;
    publicSafe: true;
    events: readonly string[];
}>;
