/** View declaration types carried by plugins and the host view presentation policy. */ import type { CollapsedView, ViewDeclaration } from "../types/plugin.js"; import type { ViewKind } from "../types/view-kind.js"; export type { ViewKind } from "../types/view-kind.js"; /** * The two user-controllable toggles. `system` and `release` are always on, so * they are not represented here. */ export interface EnabledViewKinds { /** Show `developer`-kind views. Default: off on every build. */ developer: boolean; /** Show `preview`-kind views. Default: off on every build. */ preview: boolean; } /** A declaration that can be sorted into a {@link ViewKind}. */ export interface ViewKindBearer { /** Four-tier visibility category; absent values default to release. */ viewKind?: ViewKind; } /** Presentation/runtime family for a view. */ export type ViewType = "gui" | "tui" | "xr"; /** * A surface a view renders on. Same set as {@link ViewType}; named separately * because a single view declaration can render on several modalities at once * while the shipped view bundle can remain focused on the GUI renderer. */ export type ViewModality = ViewType; /** The four view kinds, in escalating "exposure" order. */ export declare const VIEW_KINDS: readonly ["system", "release", "developer", "preview"]; /** Missing kinds default to release; system views must opt in explicitly. */ export declare function resolveViewKind(decl: ViewKindBearer | null | undefined): ViewKind; /** * Whether a given kind is visible under the current enabled set. `system` and * `release` are always visible; `developer` and `preview` follow their toggles. */ export declare function isViewKindEnabled(kind: ViewKind, enabled: EnabledViewKinds): boolean; /** * Whether a view-like declaration is visible under the current enabled set. * Combines {@link resolveViewKind} + {@link isViewKindEnabled} — the single * predicate every visibility filter should call. */ export declare function isViewVisible(decl: ViewKindBearer | null | undefined, enabled: EnabledViewKinds): boolean; /** Whether a kind is always on (not user-toggleable). */ export declare function isAlwaysOnViewKind(kind: ViewKind): boolean; /** Presentation metadata for each kind — labels/descriptions for Settings. */ export declare const VIEW_KIND_META: Record; /** Order + de-duplicate a modality list as gui, xr, tui. */ export declare function dedupeModalities(mods: readonly ViewModality[]): ViewModality[]; /** * The surfaces a view declaration renders on: the explicit `modalities` list * when set, otherwise the single `viewType` (default "gui"). */ export declare function getViewModalities(view: Pick): ViewModality[]; /** * Collapse view declarations to one entry per `id`, unioning the surfaces each * declaration supports. The "gui" declaration (clean label, no surface suffix) * is preferred as the canonical base. This is the single source the view * catalog and modality hosts use so a view appears once with modality badges * instead of one duplicate row per future surface variant. */ export declare function collapseViewDeclarations(views: readonly ViewDeclaration[]): CollapsedView[];