import type { Language } from "../../i18n.js"; export interface FeishuCredentials { appId: string; appSecret: string; } export declare function loadCredentials(): FeishuCredentials | null; /** * Write the credentials to the legacy JSON file. Returns whether the write * succeeded. * * The file is a mirror, not the source of truth, so a failure here is not fatal * — the running instance holds the values in memory and connects fine. But it is * the difference between "onboarded once" and "onboarded again on every boot", * and only the caller can tell the user which one they got. */ export declare function saveCredentials(credentials: FeishuCredentials): boolean; /** * Extra hooks for callers that drive the flow themselves — the settings pane's * one-click button, which needs the link *before* the flow resolves and needs * the failure code to report. All optional, so the CLI path * (`register()` → `onboardFeishu(logger, language)`) is unchanged. */ export interface OnboardHooks { /** Called once, synchronously, with the device-authorization link — before polling starts. */ onQRCodeReady?: (info: { url: string; expireIn: number; }) => void; /** Called with the SDK error code just before a failed flow resolves `null`. */ onError?: (code: string) => void; /** * Aborts polling and invalidates the link. **Only ever pass a signal a human * explicitly cancelled** — the link is single-use and single-person, so an * incidental abort (an HTTP response closing, a component unmounting) burns * the user's only chance and forces a whole new scan. */ signal?: AbortSignal; } /** * Run the one-click onboarding flow. Resolves with the created app credentials, * or `null` when the user aborts / the flow fails. The returned link (also * printable) is valid for ~10 minutes and usable by exactly one person. */ export declare function onboardFeishu(logger?: { warn?: (...args: unknown[]) => void; }, language?: Language, hooks?: OnboardHooks): Promise; //# sourceMappingURL=onboard.d.ts.map