/** * Layout preferences shared by the dashboard's Settings section and the * client registration half (`./index.tsx`). * * These two sides must agree on two placement choices, and neither may import * the other (the registration half mounts the dashboard, so the reverse import * would be a cycle). Keeping the stores in their own module lets both read and * write the same persisted values. */ import { type Store } from './store.ts'; /** The global panel id shared by the `main` slot entry and the sidebar entry * that selects it. Stable: it is only ever compared within this package. */ export declare const QUOTA_PANEL_ID = "quota"; /** Where the optional「额度」shortcut, if enabled, lives in the sidebar. */ export type SidebarEntryPlacement = 'off' | 'top' | 'bottom'; /** * `off` keeps the host's sidebar untouched (the default, so updating the * plugin never silently adds chrome). `top` joins the global-panel icon row; * `bottom` sits beside Settings in the sidebar foot. */ export declare const sidebarEntryStore: Store; /** * Position of the「额度」tab among the registered conversation views, as an * index in the live tab roster (0 = first). The registration half maps it onto * a slot `order` relative to the neighbouring entries, so it survives host * plugins arriving with their own orders. Default 2 reproduces the historical * fixed position: 对话, 轨迹, 额度. */ export declare const quotaTabIndexStore: Store; /** One `conversation.view` slot entry, as far as ordering needs to see it. */ export interface ViewOrderEntry { options: { id?: string; order?: number; }; } /** * Clamp a persisted roster index into `[0, count]`; `count` itself is the * legal "end of the list" insertion position when there are `count` tabs. */ export declare function clampTabIndex(index: number, count: number): number; /** * Turn a 0-based roster position into the `order` for our own view entry. * * The host sorts list entries by `order` (ties keep registration order), so * the placement is expressed relative to the live neighbours rather than as an * absolute number: the first/last positions step outside the current range, * and an interior position lands between the two adjacent orders (including * the degenerate equal-order case). Other entries are never touched. * @param entries - live `conversation.view` entries. * @param index - desired 0-based position in the roster *including* our tab. * @param selfId - this plugin's entry id (excluded from the anchor list). * @param fallback - order used while the host has no other view registered. * @returns the slot `order` for our registration. */ export declare function viewOrderForIndex(entries: readonly ViewOrderEntry[], index: number, selfId?: string, fallback?: number): number;