type Session = Record & { sessionId: string; status: string; }; type Schedule = Record & { id: string; }; export interface StoreSnapshot { sessions: ReadonlyMap; schedules: ReadonlyMap; online: boolean; version: number; /** Effective schedule timezone (IANA) the scheduler fires in — used to render * schedule nextRunAt/lastRunAt in the SAME zone regardless of browser zone. * Empty ⇒ fall back to the browser's local zone (legacy behavior). */ scheduleTimeZone: string; /** P1-14:本次身份能否读到排程。Workbench-only(飞书 H5 / 平台 teammate|guest) * 身份对 `/api/schedules` 是明确的 401,取不到就是取不到——UI 该隐藏排程区块, * 而不是画一个永远为空的面板。false 同时覆盖「没有能力所以没请求」和「请求 * 失败」两种情况。 */ schedulesAvailable: boolean; /** True once the first authoritative `/api/sessions` snapshot has been * installed. UI uses it to hold a skeleton instead of flashing an empty * list before the bootstrap fetch lands. Stays true forever after. */ bootstrapped: boolean; } declare class Store { sessions: Map; schedules: Map; online: boolean; scheduleTimeZone: string; schedulesAvailable: boolean; private bootstrapped; private version; private snapshot; private listeners; private botsListeners; setScheduleTimeZone(tz: string): void; /** * `schedules === null` ⇒ 本次身份读不到排程(无能力,或请求 401/403/非 JSON)。 * 排程表清空并标记 {@link StoreSnapshot.schedulesAvailable} 为 false,但**会话 * 快照照常落库**——P1-14 的整个要害就是别让排程的失败连累会话列表。 */ replaceSnapshot(rows: Session[], schedules: Schedule[] | null, scheduleTimeZone?: string): void; applySse(type: string, body: any): void; onBotsChanged(fn: () => void): () => boolean; setOnline(v: boolean): void; on(fn: () => void): () => boolean; getSnapshot(): StoreSnapshot; private emit; } export declare const store: Store; export interface DashboardBootstrapOptions { /** * P1-14:本次身份是否具备 `/api/schedules` 读能力。 * * 本机管理身份有;`publicReadOnly` 下的匿名访客有(脱敏版);**Workbench-only * 身份没有**——飞书 H5 会话与平台 teammate/guest 走的是 `decideWorkbenchH5Auth` * 窄门禁,排程不在能力表里,服务端明确回 401 + HTML 登录页。所以这里先按能力 * 决定要不要发这一跳请求,省掉一次注定 401 的往返。 * * 缺省 true 只是保持既有调用方的行为:**无论返回真假,排程都不会拖垮会话 * 快照**——那条容错在 {@link fetchSchedulesSnapshot} 里兜底。 */ canReadSchedules?: () => boolean; } export declare function bootstrap(options?: DashboardBootstrapOptions): Promise; export {}; //# sourceMappingURL=store.d.ts.map