/** * This bundle's configuration card on its page in the sidebar's Plugins panel * (`plugins.bundle.config`, * keyed by the package name). * * The staging model, the field controls, and the form frame are the harness's * own (`SettingsFormModel` + `SettingsForm` + `Switch`); the card only declares * WHICH fields it edits and how a switch renders. Two switches, nothing else — * the rest of the entry's `Config` is ordinary configuration and deliberately * stays in the profile file, exactly as it was before DSH 0.1.7 collapsed this * plugin's two settings namespaces into one entry. * * The switch field spec clears rather than pins when the draft lands back on the * schema default, so the page and the `/approval-*` commands leave the document * in the same shape (see `booleanSwitchField`). * * @module dsh-edit-approval/client/settings-card */ import { SettingsFormModel } from '@deepseek-ai/dsh-client-ui-primitives'; import type { SettingsFieldState, SettingsFormActions, SettingsFormLabels, SettingsFormScope, SettingsFormShell } from '@deepseek-ai/dsh-client-ui-primitives'; import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'; import { type ApprovalSwitchField } from './policy.ts'; import { NS, type ApprovalKey } from './locales.ts'; declare module '@deepseek-ai/dsh-client-ui-slots' { interface LocaleNamespaceMap { /** The config card and the panel labels read the plugin's own `edit-approval` dictionary. */ 'edit-approval': ApprovalKey; } } /** * The profile entry whose form this is: the bundle's package name, which is the * profile row id the host addresses the configuration by (the bundle patch * declares the row with `id` = `name` = package name). */ export declare const APPROVAL_ENTRY_ID = "dsh-edit-approval"; /** * The two fields the card edits — the entry's volatile set, and nothing else. * * Derived from {@link ApprovalSwitchField} rather than restated, so the card's * field set cannot drift from the contract `tests/config.spec.ts` pins against * the real schema. */ export type ApprovalPolicy = Readonly>; /** Card layout: the switch rows and their state hints, on the harness's rhythm. */ export declare const CARD_STYLE: string; /** One form snapshot as this card reads it: the frame's state plus both switch drafts. */ export interface ApprovalCardSnapshot extends SettingsFormShell { readonly editEnabled: SettingsFieldState; readonly bashEnabled: SettingsFieldState; } /** * The bound snapshot store the slot renderer rebinds as the card's * `useApprovalCard` selector hook. */ export interface ApprovalCardStore { getSnapshot(): ApprovalCardSnapshot; subscribe(listener: (() => void)): () => void; } /** The face the slot registration injects into the card. */ export interface SettingsApprovalFace extends SettingsFormActions { readonly hooks: { readonly approvalCard: ApprovalCardStore; }; } /** * Props the Plugins panel binds for this bundle's configuration card: the slot's * runtime owner share (`view`), the locale `t` seat, and the injected form face * with its `hooks` compartment rebound as the `useApprovalCard` selector hook. */ export type SettingsApprovalCardProps = PropsRuntime<'plugins.bundle.config'> & PropsLocale & InjectFace; /** The form frame's copy, read from this plugin's dictionary. */ export declare function formLabels(t: (key: ApprovalKey) => string): SettingsFormLabels; /** * Build the staged form over this entry's configuration. * * `ctx.configForms.get(entryId)` is structurally the `SettingsFormScope` the * model wants, so it is passed straight in — no cast, exactly as the official * settings pages do. * * @param scope - the shared per-entry configuration form. * @returns the model plus the card's bound read hook. */ export declare function approvalForm(scope: SettingsFormScope): { form: SettingsFormModel>>; store: import("@deepseek-ai/dsh-client-store").SnapshotStore; }; /** * The bundle's configuration card. * * @param props - the view, the card's read hook, the locale seat, and the form actions. * @returns the form, or null for the summary view. */ export declare function SettingsApprovalCard(props: SettingsApprovalCardProps): import("react").JSX.Element | null;