MCPcopy
hub / github.com/wavetermdev/waveterm / ViewModel

Interface ViewModel

frontend/types/custom.d.ts:306–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304 type ViewModelClass = new (initOpts: ViewModelInitType) => ViewModel;
305
306 interface ViewModel {
307 // The type of view, used for identifying and rendering the appropriate component.
308 viewType: string;
309
310 useTermHeader?: jotai.Atom<boolean>;
311
312 hideViewName?: jotai.Atom<boolean>;
313
314 // Icon representing the view, can be a string or an IconButton declaration.
315 viewIcon?: jotai.Atom<string | IconButtonDecl>;
316
317 // Display name for the view, used in UI headers.
318 viewName?: jotai.Atom<string>;
319
320 // Optional header text or elements for the view.
321 viewText?: jotai.Atom<string | HeaderElem[]>;
322
323 termDurableStatus?: jotai.Atom<BlockJobStatusData | null>;
324 termConfigedDurable?: jotai.Atom<null | boolean>;
325
326 // Icon button displayed before the title in the header.
327 preIconButton?: jotai.Atom<IconButtonDecl>;
328
329 // Icon buttons displayed at the end of the block header.
330 endIconButtons?: jotai.Atom<IconButtonDecl[]>;
331
332 // Background styling metadata for the block.
333 blockBg?: jotai.Atom<MetaType>;
334
335 noHeader?: jotai.Atom<boolean>;
336
337 // Whether the block manages its own connection (e.g., for remote access).
338 manageConnection?: jotai.Atom<boolean>;
339
340 // If true, filters out 'nowsh' connections (when managing connections)
341 filterOutNowsh?: jotai.Atom<boolean>;
342
343 // If true, removes padding inside the block content area.
344 noPadding?: jotai.Atom<boolean>;
345
346 // Atoms used for managing search functionality within the block.
347 searchAtoms?: SearchAtoms;
348
349 // The main view component associated with this ViewModel.
350 viewComponent: ViewComponent<ViewModel>;
351
352 // Function to determine if this is a basic terminal block.
353 isBasicTerm?: (getFn: jotai.Getter) => boolean;
354
355 // Returns menu items for the settings dropdown.
356 getSettingsMenuItems?: () => ContextMenuItem[];
357
358 // Attempts to give focus to the block, returning true if successful.
359 giveFocus?: () => boolean;
360
361 // Handles keydown events within the block.
362 keyDownHandler?: (e: WaveKeyboardEvent) => boolean;
363

Callers

nothing calls this directly

Implementers 10

ProcessViewerViewModelfrontend/app/view/processviewer/proces
AiFileDiffViewModelfrontend/app/view/aifilediff/aifiledif
SysinfoViewModelfrontend/app/view/sysinfo/sysinfo.tsx
TermViewModelfrontend/app/view/term/term-model.ts
QuickTipsViewModelfrontend/app/view/quicktipsview/quickt
WebViewModelfrontend/app/view/webview/webview.tsx
LauncherViewModelfrontend/app/view/launcher/launcher.ts
WaveAiModelfrontend/app/view/waveai/waveai.tsx
PreviewModelfrontend/app/view/preview/preview-mode
WaveConfigViewModelfrontend/app/view/waveconfig/waveconfi

Calls

no outgoing calls

Tested by

no test coverage detected