import type { MarkSet } from "@tooee/marks"; import type { AnyContent } from "../types.js"; /** * The `view` field contributed to the command context (see augmentation below). * * This slice is content-only. Row state — cursor, selection, active and * selected rows — is generic to every row document and lives on `ctx.document`, * which `DocumentScreen` provides alongside this. */ export interface ViewCommandContext { content: AnyContent; format: string; title?: string; data?: unknown; /** Reload the content from its provider. */ reload: () => void; marks: { setMarkSet: (set: MarkSet) => void; clearNamespace: (namespace: string) => void; clearAll: () => void; userMarks: MarkSet[]; providerMarks: MarkSet[]; }; } declare module "@tooee/commands" { interface CommandContext { view?: ViewCommandContext; } } export interface CreateViewCommandContextOptions { /** * Content represented by this command context. Custom/headless surfaces may * omit it; the builder will synthesize a minimal custom content object. */ content?: AnyContent; format?: string; title?: string; data?: unknown; reload?: () => void; marks?: Partial; } export type ProvideViewCommandContextOptions = CreateViewCommandContextOptions; type ViewCommandContextInput = ProvideViewCommandContextOptions | (() => ProvideViewCommandContextOptions); export declare const createViewCommandContext: ({ content, format, title, data, reload, marks, }: CreateViewCommandContextOptions) => ViewCommandContext; export declare const useProvideViewCommandContext: (options: ViewCommandContextInput) => void; export {}; //# sourceMappingURL=use-view-command-context.d.ts.map