import { type Brand } from '../im/lark/lark-hosts.js';
export interface TokenStore {
    access_token: string;
    refresh_token: string;
    token_type: string;
    expires_at: string;
    refresh_expires_at: string;
    scope: string;
    /**
     * token 所属应用 / 品牌。旧的单文件没有这两个字段（undefined）——按"属于升级前
     * 唯一的那个 feishu bot"兼容处理（见 {@link loadTokenForApp}）。
     */
    appId?: string;
    brand?: Brand;
}
/**
 * Resolve a valid User Access Token.
 * Returns access_token string, or null if unavailable.
 */
export declare function resolveUserToken(appId: string, appSecret: string, brand?: Brand): Promise<string | null>;
/**
 * 飞书文档订阅入口（/subscribe-lark-doc）专用的额外 OAuth scope。**不进**全局
 * DEFAULT_SCOPES —— 否则所有 bot 的通用 /login（图片下载用）都会请求这些 scope，
 * 没在开发者后台启用它们的 app 会一起 20043 失败。改由 /subscribe-lark-doc 在
 * 需要时通过 generateAuthUrl 的 extraScopes 单独带上。
 *
 * 每个 scope 都对着 src/setup/lark-scopes.json 校验过（错名会触发 authorize 报
 * 错 20043）。使用前仍需在开发者后台为该 app 启用这些 scope 并订阅评论事件。
 */
export declare const DOC_COMMENT_OAUTH_SCOPES: string[];
/**
 * Generate an OAuth authorization URL. Returns the URL and stores pending state.
 * Called by /login command handler.
 */
export declare function generateAuthUrl(appId: string, appSecret: string, brand?: Brand, extraScopes?: string[]): {
    authUrl: string;
    state: string;
};
/**
 * Try to parse a callback URL and exchange the code for a token.
 * Returns a success message or null if the URL is not a valid callback.
 */
export declare function handleCallbackUrl(url: string): Promise<string | null>;
/**
 * Check if a message looks like an OAuth callback URL.
 */
export declare function isCallbackUrl(text: string): boolean;
/**
 * Get current token status for /login status display. Per-app: reports the
 * token belonging to this bot (appId/brand), not whatever was last written.
 */
export declare function getTokenStatus(appId: string, brand?: Brand): string;
//# sourceMappingURL=user-token.d.ts.map