deck-plugin-sdk 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deck-plugin-sdk",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Build a plugin for Deck, outside the Deck repository.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/shim/bridge.js CHANGED
@@ -10,12 +10,47 @@ const b = () => {
10
10
  return x;
11
11
  };
12
12
 
13
+ export const adblockConfig = (...a) => b().adblockConfig(...a);
14
+ export const adblockInfo = (...a) => b().adblockInfo(...a);
15
+ export const adblockRebuild = (...a) => b().adblockRebuild(...a);
16
+ export const adblockUpdate = (...a) => b().adblockUpdate(...a);
13
17
  export const agentClis = (...a) => b().agentClis(...a);
14
18
  export const agentMcpStatus = (...a) => b().agentMcpStatus(...a);
15
19
  export const askSudoPassword = (...a) => b().askSudoPassword(...a);
16
20
  export const backupExport = (...a) => b().backupExport(...a);
17
21
  export const backupInspect = (...a) => b().backupInspect(...a);
18
22
  export const backupRestore = (...a) => b().backupRestore(...a);
23
+ export const bookmarksBarMode = (...a) => b().bookmarksBarMode(...a);
24
+ export const browserAgentAnswer = (...a) => b().browserAgentAnswer(...a);
25
+ export const browserAgentConfig = (...a) => b().browserAgentConfig(...a);
26
+ export const browserAgentFillAnswer = (...a) => b().browserAgentFillAnswer(...a);
27
+ export const browserBounds = (...a) => b().browserBounds(...a);
28
+ export const browserCapture = (...a) => b().browserCapture(...a);
29
+ export const browserCdp = (...a) => b().browserCdp(...a);
30
+ export const browserClear = (...a) => b().browserClear(...a);
31
+ export const browserClose = (...a) => b().browserClose(...a);
32
+ export const browserDefaultRegister = (...a) => b().browserDefaultRegister(...a);
33
+ export const browserDefaultStatus = (...a) => b().browserDefaultStatus(...a);
34
+ export const browserDevtools = (...a) => b().browserDevtools(...a);
35
+ export const browserDownload = (...a) => b().browserDownload(...a);
36
+ export const browserFind = (...a) => b().browserFind(...a);
37
+ export const browserHistoryCount = (...a) => b().browserHistoryCount(...a);
38
+ export const browserHistoryForgetRange = (...a) => b().browserHistoryForgetRange(...a);
39
+ export const browserHistoryForgetUrl = (...a) => b().browserHistoryForgetUrl(...a);
40
+ export const browserHistoryList = (...a) => b().browserHistoryList(...a);
41
+ export const browserHistoryRecent = (...a) => b().browserHistoryRecent(...a);
42
+ export const browserHistorySuggest = (...a) => b().browserHistorySuggest(...a);
43
+ export const browserHistoryVisit = (...a) => b().browserHistoryVisit(...a);
44
+ export const browserMute = (...a) => b().browserMute(...a);
45
+ export const browserNav = (...a) => b().browserNav(...a);
46
+ export const browserOpen = (...a) => b().browserOpen(...a);
47
+ export const browserPermissionSet = (...a) => b().browserPermissionSet(...a);
48
+ export const browserPermissions = (...a) => b().browserPermissions(...a);
49
+ export const browserPrivacy = (...a) => b().browserPrivacy(...a);
50
+ export const browserSetKeys = (...a) => b().browserSetKeys(...a);
51
+ export const browserSite = (...a) => b().browserSite(...a);
52
+ export const browserSiteClear = (...a) => b().browserSiteClear(...a);
53
+ export const browserZoom = (...a) => b().browserZoom(...a);
19
54
  export const claudePlanLimits = (...a) => b().claudePlanLimits(...a);
20
55
  export const claudeUsage = (...a) => b().claudeUsage(...a);
21
56
  export const clearWallpaper = (...a) => b().clearWallpaper(...a);
@@ -28,9 +63,18 @@ export const dbConnect = (...a) => b().dbConnect(...a);
28
63
  export const dbDisconnect = (...a) => b().dbDisconnect(...a);
29
64
  export const dbQuery = (...a) => b().dbQuery(...a);
30
65
  export const dbSchema = (...a) => b().dbSchema(...a);
66
+ export const deckReady = (...a) => b().deckReady(...a);
31
67
  export const deleteIconPack = (...a) => b().deleteIconPack(...a);
32
68
  export const dirsDownload = (...a) => b().dirsDownload(...a);
33
69
  export const exec = (...a) => b().exec(...a);
70
+ export const extensionInstallFolder = (...a) => b().extensionInstallFolder(...a);
71
+ export const extensionInstallStore = (...a) => b().extensionInstallStore(...a);
72
+ export const extensionPopup = (...a) => b().extensionPopup(...a);
73
+ export const extensionPopupClose = (...a) => b().extensionPopupClose(...a);
74
+ export const extensionReload = (...a) => b().extensionReload(...a);
75
+ export const extensionRemove = (...a) => b().extensionRemove(...a);
76
+ export const extensionSetEnabled = (...a) => b().extensionSetEnabled(...a);
77
+ export const extensionsList = (...a) => b().extensionsList(...a);
34
78
  export const footerOrder = (...a) => b().footerOrder(...a);
35
79
  export const fsCopy = (...a) => b().fsCopy(...a);
36
80
  export const fsCreateDir = (...a) => b().fsCreateDir(...a);
@@ -97,6 +141,7 @@ export const installFromRegistry = (...a) => b().installFromRegistry(...a);
97
141
  export const isFullscreen = (...a) => b().isFullscreen(...a);
98
142
  export const languagesDir = (...a) => b().languagesDir(...a);
99
143
  export const launchFiles = (...a) => b().launchFiles(...a);
144
+ export const launchUrls = (...a) => b().launchUrls(...a);
100
145
  export const listApps = (...a) => b().listApps(...a);
101
146
  export const listInstalled = (...a) => b().listInstalled(...a);
102
147
  export const logLatest = (...a) => b().logLatest(...a);
@@ -138,6 +183,26 @@ export const sshTunnelClose = (...a) => b().sshTunnelClose(...a);
138
183
  export const sshTunnelOpen = (...a) => b().sshTunnelOpen(...a);
139
184
  export const startupMarks = (...a) => b().startupMarks(...a);
140
185
  export const toggleFullscreen = (...a) => b().toggleFullscreen(...a);
186
+ export const vaultChangePassword = (...a) => b().vaultChangePassword(...a);
187
+ export const vaultConfig = (...a) => b().vaultConfig(...a);
188
+ export const vaultCreate = (...a) => b().vaultCreate(...a);
189
+ export const vaultDelete = (...a) => b().vaultDelete(...a);
190
+ export const vaultExport = (...a) => b().vaultExport(...a);
191
+ export const vaultFill = (...a) => b().vaultFill(...a);
192
+ export const vaultFillNew = (...a) => b().vaultFillNew(...a);
193
+ export const vaultGenerate = (...a) => b().vaultGenerate(...a);
194
+ export const vaultImport = (...a) => b().vaultImport(...a);
195
+ export const vaultList = (...a) => b().vaultList(...a);
196
+ export const vaultLock = (...a) => b().vaultLock(...a);
197
+ export const vaultMatches = (...a) => b().vaultMatches(...a);
198
+ export const vaultNeverList = (...a) => b().vaultNeverList(...a);
199
+ export const vaultNeverRemove = (...a) => b().vaultNeverRemove(...a);
200
+ export const vaultOfferAnswer = (...a) => b().vaultOfferAnswer(...a);
201
+ export const vaultSave = (...a) => b().vaultSave(...a);
202
+ export const vaultSecret = (...a) => b().vaultSecret(...a);
203
+ export const vaultStatus = (...a) => b().vaultStatus(...a);
204
+ export const vaultTotp = (...a) => b().vaultTotp(...a);
205
+ export const vaultUnlock = (...a) => b().vaultUnlock(...a);
141
206
  export const vpsRunsPull = (...a) => b().vpsRunsPull(...a);
142
207
  export const watchFiles = (...a) => b().watchFiles(...a);
143
208
 
package/shim/ui.d.ts CHANGED
@@ -6,6 +6,7 @@ export * from "../types/components/ConfirmDialog";
6
6
  export * from "../types/components/NamePrompt";
7
7
  export * from "../types/components/ContextMenu";
8
8
  export * from "../types/components/Toast";
9
+ export * from "../types/core/notifyapi";
9
10
  export * from "../types/components/useResize";
10
11
  export * from "../types/modules/editor/MarkdownLive";
11
12
  export * from "../types/components/TreeRow";
package/shim/ui.js CHANGED
@@ -10,13 +10,17 @@ const u = () => {
10
10
  };
11
11
 
12
12
  export const ActivityBar = (...a) => u().ActivityBar(...a);
13
+ export const Chip = (...a) => u().Chip(...a);
13
14
  export const ConfirmDialog = (...a) => u().ConfirmDialog(...a);
14
15
  export const ContextMenu = (...a) => u().ContextMenu(...a);
16
+ export const CountChip = (...a) => u().CountChip(...a);
15
17
  export const DayPicker = (...a) => u().DayPicker(...a);
18
+ export const EmptyState = (...a) => u().EmptyState(...a);
16
19
  export const Field = (...a) => u().Field(...a);
17
20
  export const FileIcon = (...a) => u().FileIcon(...a);
18
21
  export const FontViewer = (...a) => u().FontViewer(...a);
19
22
  export const GhostButton = (...a) => u().GhostButton(...a);
23
+ export const IconButton = (...a) => u().IconButton(...a);
20
24
  export const ImageViewer = (...a) => u().ImageViewer(...a);
21
25
  export const MarkdownLive = (...a) => u().MarkdownLive(...a);
22
26
  export const MarkdownToolbar = (...a) => u().MarkdownToolbar(...a);
@@ -50,6 +54,7 @@ export const cmSurface = (...a) => u().cmSurface(...a);
50
54
  export const collectFiles = (...a) => u().collectFiles(...a);
51
55
  export const conflict = (...a) => u().conflict(...a);
52
56
  export const decodeText = (...a) => u().decodeText(...a);
57
+ export const dismissNotification = (...a) => u().dismissNotification(...a);
53
58
  export const dispatch = (...a) => u().dispatch(...a);
54
59
  export const forLanguage = (...a) => u().forLanguage(...a);
55
60
  export const formatChord = (...a) => u().formatChord(...a);
@@ -60,6 +65,7 @@ export const mediaKind = (...a) => u().mediaKind(...a);
60
65
  export const modelOptionsFor = (...a) => u().modelOptionsFor(...a);
61
66
  export const monacoOptionsFrom = (...a) => u().monacoOptionsFrom(...a);
62
67
  export const normalizeChord = (...a) => u().normalizeChord(...a);
68
+ export const notify = (...a) => u().notify(...a);
63
69
  export const onKey = (...a) => u().onKey(...a);
64
70
  export const onKeys = (...a) => u().onKeys(...a);
65
71
  export const parseChord = (...a) => u().parseChord(...a);
@@ -75,6 +81,7 @@ export const subscribeEditorSettings = (...a) => u().subscribeEditorSettings(...
75
81
  export const themeById = (...a) => u().themeById(...a);
76
82
  export const toMonaco = (...a) => u().toMonaco(...a);
77
83
  export const toast = (...a) => u().toast(...a);
84
+ export const tone = (...a) => u().tone(...a);
78
85
  export const updateEditorSettings = (...a) => u().updateEditorSettings(...a);
79
86
  export const useEditorSettings = (...a) => u().useEditorSettings(...a);
80
87
  export const useIconThemesVersion = (...a) => u().useIconThemesVersion(...a);
@@ -5,5 +5,5 @@
5
5
  "icon": "Sparkles",
6
6
  "color": "#a78bfa",
7
7
  "version": "0.1.0",
8
- "minDeck": "1.5.0"
8
+ "minDeck": "1.6.0"
9
9
  }
@@ -11,10 +11,12 @@ export interface ActivityView<Id extends string> {
11
11
  onClick?: (el: HTMLElement) => void;
12
12
  }
13
13
  export default ActivityBar;
14
- export declare function ActivityBar<Id extends string>({ views, active, onSelect, trailing, }: {
14
+ export declare function ActivityBar<Id extends string>({ views, active, onSelect, trailing, grouped, }: {
15
15
  views: readonly ActivityView<Id>[];
16
16
  active: Id;
17
17
  onSelect: (id: Id) => void;
18
18
  /** Fixed controls pinned to the right — present for every view, or the icons shift. */
19
19
  trailing?: React.ReactNode;
20
+ /** The icons together in one rounded group, smaller, rather than loose pills. */
21
+ grouped?: boolean;
20
22
  }): import("react").JSX.Element;
@@ -26,6 +26,9 @@ export interface MenuItem {
26
26
  /** A setting rather than an action: renders a checkbox and does NOT close the menu, so several
27
27
  * can be flipped in one visit. The caller re-renders with the new value. */
28
28
  checked?: boolean;
29
+ /** Controls of its own at the row's right (a zoom's − and +, a slider): the row is not
30
+ * clicked itself, and using them leaves the menu open. */
31
+ controls?: React.ReactNode;
29
32
  }
30
33
  export type MenuEntry = MenuItem | "sep";
31
34
  export declare function ContextMenu({ x, y, items, alignRight, onClose, onReorder, flipAt, up }: {
@@ -12,7 +12,7 @@ export interface TabItem {
12
12
  /** Tooltip for the close button; defaults to "Close". */
13
13
  closeTitle?: string;
14
14
  }
15
- export declare function TabStrip({ tabs, activeId, onSelect, onClose, onReorder, onDoubleClick, trailing, pill, onAdd, addTitle, }: {
15
+ export declare function TabStrip({ tabs, activeId, onSelect, onClose, onReorder, onDoubleClick, leading, trailing, pill: pillProp, chip, onAdd, addTitle, }: {
16
16
  tabs: readonly TabItem[];
17
17
  activeId: string | null;
18
18
  onSelect: (id: string) => void;
@@ -20,11 +20,16 @@ export declare function TabStrip({ tabs, activeId, onSelect, onClose, onReorder,
20
20
  /** Moves `from` to `to`'s position. Omit to make the strip non-reorderable. */
21
21
  onReorder?: (from: string, to: string) => void;
22
22
  onDoubleClick?: (id: string) => void;
23
+ /** Controls before the first tab. */
24
+ leading?: ReactNode;
23
25
  /** Right-aligned controls after the tabs — view toggles, save state. */
24
26
  trailing?: ReactNode;
25
27
  /** Rounded tabs with the active one lit in the accent, the look of the workspace tabs in the
26
28
  * title bar, instead of the editor-style boxed row. */
27
29
  pill?: boolean;
30
+ /** Rounded like `pill`, with the open tab raised on the card colour rather than lit in the
31
+ * accent: the editor's tabs, where the accent already marks the open file in the tree. */
32
+ chip?: boolean;
28
33
  /** A + right after the last tab, as the workspace tabs have. */
29
34
  onAdd?: () => void;
30
35
  addTitle?: string;
@@ -58,10 +58,14 @@ export declare function DayPicker({ value, onChange, }: {
58
58
  onChange: (days: string[]) => void;
59
59
  }): import("react").JSX.Element;
60
60
  /** One readout in the footer strip: an icon, a short label, and an optional click. */
61
- export declare function StatusItem({ icon, color, label, title, onClick, }: {
61
+ export declare function StatusItem({ icon, color, label, detail, meter, title, onClick, }: {
62
62
  icon: React.ReactNode;
63
63
  color: string;
64
64
  label: string;
65
+ /** A second, quieter part after the label: a branch, a commit. */
66
+ detail?: string;
67
+ /** 0 to 100: a small bar before the label, in the item's colour (a limit's use). */
68
+ meter?: number;
65
69
  title?: string;
66
70
  onClick?: () => void;
67
71
  }): import("react").JSX.Element;
@@ -100,3 +104,46 @@ export declare function Toggle({ on, onChange }: {
100
104
  on: boolean;
101
105
  onChange: (v: boolean) => void;
102
106
  }): import("react").JSX.Element;
107
+ /** A state in its colour: Ready, Running, Paused, Failed. `color` is any CSS colour; a `--tone-*`
108
+ * one (`tone("green")`) follows a light theme. */
109
+ export declare function Chip({ color, title, children }: {
110
+ color: string;
111
+ title?: string;
112
+ children: ReactNode;
113
+ }): import("react").JSX.Element;
114
+ /** A `--tone-*` colour as CSS, for a Chip, a dot or text: `tone("amber")`. */
115
+ export declare function tone(name: "red" | "emerald" | "amber" | "blue" | "green" | "cyan" | "sky" | "violet" | "pink" | "orange", shade?: 300 | 400): string;
116
+ /** How many, after a heading or a row. */
117
+ export declare function CountChip({ n, title }: {
118
+ n: number;
119
+ title?: string;
120
+ }): import("react").JSX.Element;
121
+ /**
122
+ * What a space is for and the way in, when it has nothing to show: a sentence and, usually, a
123
+ * button. `card` puts it in a quiet card, for when it is the only thing on screen.
124
+ */
125
+ export declare function EmptyState({ icon, title, children, action, card }: {
126
+ icon?: ReactNode;
127
+ /** A short line above the sentence, when the space needs naming. */
128
+ title?: string;
129
+ children: ReactNode;
130
+ action?: {
131
+ label: string;
132
+ onClick: () => void;
133
+ };
134
+ card?: boolean;
135
+ }): import("react").JSX.Element;
136
+ /**
137
+ * An icon-only button. `toolbar` (size-7) for a panel's own actions, `row` (size-5) for one inside
138
+ * a list row, shown on the row's hover by the caller. `danger` turns it red on hover only; `active`
139
+ * marks a toggle that is on. `title` is required: it is the only label the button has.
140
+ */
141
+ export declare function IconButton({ title, onClick, children, size, danger, active, disabled }: {
142
+ title: string;
143
+ onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
144
+ children: ReactNode;
145
+ size?: "toolbar" | "row";
146
+ danger?: boolean;
147
+ active?: boolean;
148
+ disabled?: boolean;
149
+ }): import("react").JSX.Element;
@@ -19,7 +19,7 @@ export declare function useNarrow(px: number): [boolean, (el: HTMLElement | null
19
19
  * Listeners go on `window`, not the divider, so a fast drag that outruns the pointer keeps
20
20
  * resizing instead of stopping the moment the cursor leaves the 4px handle.
21
21
  */
22
- export declare function useResize({ initial, min, max, direction, invert, }: {
22
+ export declare function useResize({ initial, min, max, direction, invert, collapseBelow, onCollapse, }: {
23
23
  initial: number;
24
24
  min: number;
25
25
  max: number;
@@ -31,6 +31,13 @@ export declare function useResize({ initial, min, max, direction, invert, }: {
31
31
  * would grow a pane that is actually being squeezed from above.
32
32
  */
33
33
  invert?: boolean;
34
+ /**
35
+ * Dragged this far down (below `min`), the drag ends and `onCollapse` runs: the pane snaps shut
36
+ * rather than stopping at its minimum. Its size goes back to what it was when the drag began, so
37
+ * opening it again gives the width it had.
38
+ */
39
+ collapseBelow?: number;
40
+ onCollapse?: () => void;
34
41
  }): readonly [number, {
35
42
  readonly onMouseDown: (e: React.MouseEvent) => void;
36
43
  }, boolean];
@@ -0,0 +1,79 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ export interface BookmarkNode {
3
+ id: string;
4
+ title: string;
5
+ /** A page has a URL; a folder has children instead. */
6
+ url?: string;
7
+ children?: BookmarkNode[];
8
+ }
9
+ export interface Bookmarks {
10
+ bar: BookmarkNode[];
11
+ other: BookmarkNode[];
12
+ }
13
+ export declare const EMPTY: Bookmarks;
14
+ export declare const isFolder: (n: BookmarkNode) => boolean;
15
+ /** An id unique within this run and across runs: time, then a counter. */
16
+ export declare const newId: () => string;
17
+ /** Every page in the tree, depth first, with the folder titles above it. */
18
+ export declare function pages(b: Bookmarks): {
19
+ node: BookmarkNode;
20
+ path: string[];
21
+ }[];
22
+ /** The bookmark for `url`, if there is one (the first, when it was saved twice). */
23
+ export declare const findByUrl: (b: Bookmarks, url: string) => BookmarkNode | undefined;
24
+ /** Every folder, for a "save in" list: the two roots first, then each folder by its path. */
25
+ export declare function folders(b: Bookmarks): {
26
+ id: string;
27
+ path: string;
28
+ }[];
29
+ /** Add `node` at the end of `folder`. */
30
+ export declare const add: (b: Bookmarks, folder: string, node: BookmarkNode) => Bookmarks;
31
+ /** Remove the node with `id`, wherever it is (a folder goes with what is in it). */
32
+ export declare function remove(b: Bookmarks, id: string): Bookmarks;
33
+ /** Change a node's title or URL. */
34
+ export declare function update(b: Bookmarks, id: string, patch: Partial<Pick<BookmarkNode, "title" | "url">>): Bookmarks;
35
+ /** The node with `id`, and the id of the folder it is in. */
36
+ export declare function locate(b: Bookmarks, id: string): {
37
+ node: BookmarkNode;
38
+ folder: string;
39
+ } | null;
40
+ /** Move a node to the end of another folder. A folder cannot go inside itself. */
41
+ export declare function move(b: Bookmarks, id: string, folder: string): Bookmarks;
42
+ /**
43
+ * A Chromium browser's Bookmarks file (Chrome, Edge, Brave all keep the same JSON) as Deck's
44
+ * nodes: its bar, its other bookmarks, and on Chrome its mobile ones, each as given. Anything that
45
+ * is not a page or a folder (a separator, an app link) is left out.
46
+ */
47
+ export declare function fromChrome(json: string): {
48
+ bar: BookmarkNode[];
49
+ other: BookmarkNode[];
50
+ };
51
+ /** An import, as one folder in each root named after where it came from ("From Chrome"), left out
52
+ * of a root it has nothing for. */
53
+ export declare function addImport(b: Bookmarks, from: string, got: {
54
+ bar: BookmarkNode[];
55
+ other: BookmarkNode[];
56
+ }): Bookmarks;
57
+ /** How many pages a set of nodes holds. */
58
+ export declare const countPages: (ns: readonly BookmarkNode[]) => number;
59
+ /** Deck's bookmarks as a bookmarks HTML file. */
60
+ export declare function toHtml(b: Bookmarks): string;
61
+ /** A bookmarks HTML file as Deck's two roots. Read by its tags, not as a page: folders (H3) open
62
+ * the list (DL) that follows them, pages are links (A HREF). */
63
+ export declare function fromHtml(html: string): {
64
+ bar: BookmarkNode[];
65
+ other: BookmarkNode[];
66
+ };
67
+ /**
68
+ * An import merged in: a folder joins the folder of the same name where it lands (made if there
69
+ * is none), and a page already bookmarked anywhere is left out. So a file exported from Deck
70
+ * restores into the same places, and importing one twice adds nothing the second time.
71
+ * Returns the bookmarks and how many pages were added.
72
+ */
73
+ export declare function mergeImport(b: Bookmarks, got: {
74
+ bar: BookmarkNode[];
75
+ other: BookmarkNode[];
76
+ }): {
77
+ bookmarks: Bookmarks;
78
+ added: number;
79
+ };
@@ -1,8 +1,192 @@
1
1
  // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
2
  import { type DebugTarget } from "./debugtargets";
3
3
  import type { Accent, Background, Density, Palette, TermCustom, TermTheme } from "./theme";
4
+ import type { SearchEngine } from "./browserurl";
4
5
  /** Open a URL in the default browser. */
5
6
  export declare const openExternal: (url: string) => Promise<void>;
7
+ /** A box in physical pixels, relative to the window: where a browser pane's webview goes. */
8
+ export interface PhysRect {
9
+ x: number;
10
+ y: number;
11
+ w: number;
12
+ h: number;
13
+ }
14
+ /** Open `url` in the browser pane's own webview (created the first time) at `r`. A private one
15
+ * keeps no cookies, history or cache. */
16
+ export declare const browserOpen: (pane: string, url: string, isPrivate: boolean, r: PhysRect) => Promise<void>;
17
+ /** Move the pane's webview, or hide it. */
18
+ export declare const browserBounds: (pane: string, r: PhysRect, visible: boolean) => Promise<void>;
19
+ export declare const browserNav: (pane: string, action: "back" | "forward" | "reload" | "go" | "focus", url?: string) => Promise<void>;
20
+ /** The chords Rust takes from a focused page: `deck` moves the keyboard back to Deck, `page` does not. */
21
+ export declare const browserSetKeys: (deck: string[], page: string[]) => Promise<void>;
22
+ export declare const browserClose: (pane: string) => Promise<void>;
23
+ /** A JPEG of what the pane's webview shows. */
24
+ /** The ad blocker on or off, and the sites it is off for. */
25
+ export declare const adblockConfig: (enabled: boolean, off: string[], youtube: boolean) => Promise<void>;
26
+ /** Whether the ad blocker is ready, how many rules it holds, and when its lists were downloaded. */
27
+ export declare const adblockInfo: () => Promise<{
28
+ ready: boolean;
29
+ rules: number;
30
+ updated: number;
31
+ }>;
32
+ /** Rebuild the ad blocker from its lists and the user's own rules, after those changed. */
33
+ export declare const adblockRebuild: () => Promise<void>;
34
+ /** Download the ad blocker's lists again now. */
35
+ export declare const adblockUpdate: () => Promise<void>;
36
+ /** The browser's privacy settings, for every browser pane. */
37
+ export declare const browserPrivacy: (tracking: string, autofill: boolean) => Promise<void>;
38
+ /** Clear the browser's stored data of these kinds (cookies, cache, passwords, autofill) since `since`
39
+ * (seconds since 1970; 0 for all of it). */
40
+ export declare const browserClear: (kinds: string[], since: number) => Promise<void>;
41
+ /** The user's answer to an agent asking to be signed in on a page: the login to fill, or none. */
42
+ export declare const browserAgentFillAnswer: (id: number, login: string | null) => Promise<void>;
43
+ /** A saved login, without its secrets. */
44
+ export interface VaultMeta {
45
+ id: string;
46
+ site: string;
47
+ username: string;
48
+ note: string;
49
+ totp: boolean;
50
+ created: number;
51
+ updated: number;
52
+ used: number;
53
+ }
54
+ /** A login to save: a password or 2FA key left out keeps the saved one; an empty 2FA key removes it. */
55
+ export interface VaultEntryIn {
56
+ id?: string;
57
+ site: string;
58
+ username: string;
59
+ password?: string;
60
+ note?: string;
61
+ totp?: string;
62
+ }
63
+ export declare const vaultStatus: () => Promise<{
64
+ exists: boolean;
65
+ unlocked: boolean;
66
+ }>;
67
+ /** The minutes before the vault locks itself, and whether to offer saving a sign-in. */
68
+ export declare const vaultConfig: (autolockMinutes: number, offer: boolean) => Promise<void>;
69
+ export declare const vaultCreate: (password: string) => Promise<void>;
70
+ export declare const vaultUnlock: (password: string) => Promise<void>;
71
+ export declare const vaultLock: () => Promise<void>;
72
+ export declare const vaultChangePassword: (old: string, next: string) => Promise<void>;
73
+ export declare const vaultList: () => Promise<VaultMeta[]>;
74
+ /** Add or update a login; its id. */
75
+ export declare const vaultSave: (entry: VaultEntryIn) => Promise<string>;
76
+ export declare const vaultDelete: (id: string) => Promise<void>;
77
+ /** One login's password, to show or copy. */
78
+ export declare const vaultSecret: (id: string) => Promise<string>;
79
+ /** One login's 2FA code now, and the seconds it has left. */
80
+ export declare const vaultTotp: (id: string) => Promise<{
81
+ code: string;
82
+ remaining: number;
83
+ }>;
84
+ export declare const vaultGenerate: (length: number, symbols: boolean) => Promise<string>;
85
+ /** The sites never offered saving for. */
86
+ export declare const vaultNeverList: () => Promise<string[]>;
87
+ export declare const vaultNeverRemove: (site: string) => Promise<void>;
88
+ /** The logins saved for the page a pane shows. */
89
+ export declare const vaultMatches: (pane: string) => Promise<VaultMeta[]>;
90
+ /** Fill a login into the pane's page ("ok", or "user" when the page asks for the username first). */
91
+ export declare const vaultFill: (pane: string, id: string) => Promise<string>;
92
+ /** Fill a new generated password into a sign-up page's password fields. */
93
+ export declare const vaultFillNew: (pane: string, length: number, symbols: boolean) => Promise<void>;
94
+ export declare const vaultOfferAnswer: (pane: string, answer: "save" | "never" | "dismiss") => Promise<void>;
95
+ /** Logins from a password export (Chrome, Edge, Brave, Firefox, Bitwarden). */
96
+ export declare const vaultImport: (path: string) => Promise<{
97
+ added: number;
98
+ updated: number;
99
+ skipped: number;
100
+ }>;
101
+ /** Every login to a plain-text CSV file, after the master password again; how many. */
102
+ export declare const vaultExport: (path: string, password: string) => Promise<number>;
103
+ /** A page in the history: its title, how often and when it was last visited (ms). */
104
+ export interface HistoryPage {
105
+ url: string;
106
+ title: string;
107
+ count: number;
108
+ last: number;
109
+ }
110
+ /** One visit to a page. */
111
+ export interface HistoryVisit {
112
+ url: string;
113
+ title: string;
114
+ at: number;
115
+ }
116
+ /** A visit to a web page; `counted` false is only its title arriving. Whether anything changed. */
117
+ export declare const browserHistoryVisit: (url: string, title: string, counted: boolean) => Promise<boolean>;
118
+ export declare const browserHistoryRecent: (limit: number) => Promise<HistoryPage[]>;
119
+ /** Visits newest first, before `before` (ms), whose page matches every word of `q`. */
120
+ export declare const browserHistoryList: (q: string, before: number | null, limit: number) => Promise<HistoryVisit[]>;
121
+ /** The pages the address bar offers for `q`, best first. */
122
+ export declare const browserHistorySuggest: (q: string, limit: number) => Promise<HistoryPage[]>;
123
+ /** How many pages the history holds. */
124
+ export declare const browserHistoryCount: () => Promise<number>;
125
+ export declare const browserHistoryForgetUrl: (url: string) => Promise<void>;
126
+ /** Forget the visits from `from` to `to` (ms); all of them when neither is given. */
127
+ export declare const browserHistoryForgetRange: (from?: number, to?: number) => Promise<void>;
128
+ /** An installed extension. `id` is WebView2's, which chrome-extension:// addresses use. */
129
+ export interface BrowserExtension {
130
+ id: string;
131
+ name: string;
132
+ version: string;
133
+ enabled: boolean;
134
+ storeId?: string;
135
+ popup?: string;
136
+ options?: string;
137
+ icon?: string;
138
+ path: string;
139
+ inPlace: boolean;
140
+ }
141
+ export declare const extensionsList: () => Promise<BrowserExtension[]>;
142
+ /** Install from the Chrome Web Store, by its link or the extension's id; its name. */
143
+ export declare const extensionInstallStore: (link: string) => Promise<string>;
144
+ /** Install an unpacked extension from a folder: copied in, or loaded where it is (`inPlace`, developer mode); its name. */
145
+ export declare const extensionInstallFolder: (path: string, inPlace?: boolean) => Promise<string>;
146
+ /** Load an extension again from its files (an unpacked one's edits); its name. */
147
+ export declare const extensionReload: (id: string) => Promise<string>;
148
+ export declare const extensionSetEnabled: (id: string, enabled: boolean) => Promise<void>;
149
+ export declare const extensionRemove: (id: string) => Promise<void>;
150
+ /** Show an extension's popup page for `pane`, its right edge at `right` and top at `top` (physical pixels). */
151
+ export declare const extensionPopup: (pane: string, id: string, page: string, right: number, top: number) => Promise<void>;
152
+ export declare const extensionPopupClose: (pane: string) => Promise<void>;
153
+ /** The sites agents may use in the browser without asking. */
154
+ export declare const browserAgentConfig: (sites: string[]) => Promise<void>;
155
+ /** The user's answer to an agent's question about a site. */
156
+ export declare const browserAgentAnswer: (id: number, site: string, allow: boolean, forGood: boolean) => Promise<void>;
157
+ /** A DevTools protocol call on a browser pane's page, and its answer. */
158
+ export declare const browserCdp: (pane: string, method: string, params?: unknown) => Promise<unknown>;
159
+ /** Open a browser pane's developer tools. */
160
+ export declare const browserDevtools: (pane: string) => Promise<void>;
161
+ /** What the site in a browser pane keeps and has been allowed: its cookie count and permissions. */
162
+ export declare const browserSite: (pane: string) => Promise<{
163
+ origin: string;
164
+ cookies: number;
165
+ permissions: {
166
+ origin: string;
167
+ kind: number;
168
+ state: number;
169
+ }[];
170
+ }>;
171
+ /** Delete the site's cookies, storage and cache. */
172
+ export declare const browserSiteClear: (pane: string) => Promise<void>;
173
+ /** Every site given or refused a permission. */
174
+ export declare const browserPermissions: () => Promise<{
175
+ origin: string;
176
+ kind: number;
177
+ state: number;
178
+ }[]>;
179
+ /** Set a site's permission: 0 ask again, 1 allow, 2 block. */
180
+ export declare const browserPermissionSet: (origin: string, kind: number, state: number) => Promise<void>;
181
+ /** Mute or unmute a browser pane's page. */
182
+ export declare const browserMute: (pane: string, muted: boolean) => Promise<void>;
183
+ /** Set a browser pane's page zoom (1 = 100%). */
184
+ export declare const browserZoom: (pane: string, factor: number) => Promise<void>;
185
+ /** Pause, resume or cancel one of the browser's downloads. */
186
+ export declare const browserDownload: (id: number, action: "pause" | "resume" | "cancel") => Promise<void>;
187
+ /** Find in the pane's page: start a search, step through its matches, or stop (clearing them). */
188
+ export declare const browserFind: (pane: string, action: "start" | "next" | "prev" | "stop", term?: string, matchCase?: boolean) => Promise<void>;
189
+ export declare const browserCapture: (pane: string) => Promise<ArrayBuffer>;
6
190
  export interface AppProc {
7
191
  name: string;
8
192
  title: string;
@@ -56,6 +240,19 @@ export interface Settings {
56
240
  serversList: boolean;
57
241
  /** The mouse wheel over a tab bar switches tabs rather than scrolling the bar. */
58
242
  tabWheelSwitch: boolean;
243
+ /** When the tabs do not fit, every one but the open tab shrinks to its icon. */
244
+ tabSqueeze?: boolean;
245
+ /** Each project's own colour on the sidebar's collapsed rail. Off, they are all one grey. */
246
+ projectColours?: boolean;
247
+ /** Pane controls float over the pane's top-right corner on hover, instead of a header row. */
248
+ floatingPaneControls: boolean;
249
+ /** Per notification kind, whether it shows as a card, in the bell, with a sound, and as a Windows
250
+ * notification while Deck is not focused. A missing entry takes the default (notifications.ts). */
251
+ notifPrefs?: Partial<Record<"input" | "done" | "attention" | "activity" | "update" | "error" | "plugin", Partial<Record<"card" | "bell" | "sound" | "os", boolean>>>>;
252
+ /** No cards and no sound; everything still lands in the bell. */
253
+ doNotDisturb?: boolean;
254
+ /** Which corner on the right the notification cards stack in. */
255
+ notifPosition?: "bottom" | "top";
59
256
  /** Install plugin and language updates at startup instead of only announcing them. */
60
257
  pluginAutoUpdate: boolean;
61
258
  soundOnFire: boolean;
@@ -116,7 +313,53 @@ export interface Settings {
116
313
  * else the Windows account's (see `userName` in settingsstore.ts).
117
314
  */
118
315
  userName: string;
119
- }
316
+ /** What a new browser pane opens: Deck's start page, the search engine's own page, or a URL
317
+ * (a site, or a local .html file the user wrote). */
318
+ browserHome: "deck" | "search" | "url";
319
+ browserHomeUrl: string;
320
+ /** Where a search typed into the address bar or the start page goes. */
321
+ browserSearch: SearchEngine;
322
+ /** Which parts of Deck's start page show. */
323
+ browserHomeSections: {
324
+ clock: boolean;
325
+ search: boolean;
326
+ servers: boolean;
327
+ pins: boolean;
328
+ recent: boolean;
329
+ };
330
+ /** Behind the start page: a photo that changes each time it opens, one from a folder of the
331
+ * user's own, or none (Deck's background). */
332
+ browserBackground: "photos" | "folder" | "none";
333
+ browserBackgroundFolder: string;
334
+ /** Where the bookmarks bar shows under a browser's toolbar: on every page, on the start page
335
+ * only, or not at all (and only once something is on it). true and false are what it was saved
336
+ * as before it had three; read it through bookmarksBarMode. */
337
+ browserBookmarksBar: "always" | "home" | "never" | boolean;
338
+ /** WebView2's tracking prevention for the browser: how many trackers it blocks. */
339
+ browserTracking: "none" | "basic" | "balanced" | "strict";
340
+ /** Whether the vault offers to save a sign-in, and the minutes it stays open unused. */
341
+ browserVaultOffer: boolean;
342
+ browserVaultLock: number;
343
+ /** Extensions pinned to the browser's toolbar, by WebView2's id, in order. */
344
+ browserPinnedExtensions: string[];
345
+ /** The Extensions page's developer mode: load unpacked folders in place, reload them, ids and folders shown. */
346
+ browserExtensionsDev: boolean;
347
+ /** Whether the browser fills in forms (addresses, names). */
348
+ browserAutofill: boolean;
349
+ /** The ad blocker (EasyList and EasyPrivacy), and the sites it is switched off for, by host. */
350
+ browserAdblock: boolean;
351
+ browserAdblockOff: string[];
352
+ /** Skip YouTube's video ads: click Skip when it shows, run an unskippable one to its end. */
353
+ browserYoutubeSkip: boolean;
354
+ /** Where Ctrl+click on a web address in a terminal opens it: a browser tab of Deck's, or the system's. */
355
+ browserTerminalLinks: "deck" | "system";
356
+ /** The start page offers to make Deck the default browser while it is not. Off: "Don't ask again". */
357
+ browserDefaultAsk?: boolean;
358
+ /** Sites (by host) an agent may use in the browser without asking; localhost and files always. */
359
+ browserAgentSites: string[];
360
+ }
361
+ /** The bookmarks bar setting, older true/false values included. */
362
+ export declare const bookmarksBarMode: (s: Settings) => "always" | "home" | "never";
120
363
  export declare const DEFAULT_SETTINGS: Settings;
121
364
  export declare const setAutostart: (on: boolean) => Promise<void>;
122
365
  export declare const getAutostart: () => Promise<boolean>;
@@ -239,6 +482,18 @@ export declare const logLatest: () => Promise<string>;
239
482
  export declare const openFile: (path: string) => Promise<void>;
240
483
  /** Files Deck was launched with — a double-click through Explorer's "Open with". */
241
484
  export declare const launchFiles: () => Promise<string[]>;
485
+ /** Web addresses Deck was launched with: a link opened in another app, Deck being the default browser. */
486
+ export declare const launchUrls: () => Promise<string[]>;
487
+ export interface DefaultBrowserStatus {
488
+ registered: boolean;
489
+ isDefault: boolean;
490
+ name: string;
491
+ }
492
+ /** Whether Deck is offered as a browser in Windows, and whether links open with it. */
493
+ export declare const browserDefaultStatus: () => Promise<DefaultBrowserStatus>;
494
+ /** Register Deck as a browser for this user and open Windows' Default apps page at it: Windows
495
+ * keeps the choice itself to the user. */
496
+ export declare const browserDefaultRegister: () => Promise<DefaultBrowserStatus>;
242
497
  export declare const mediaSetNowPlaying: (title: string, artist: string, artPath: string) => Promise<void>;
243
498
  export declare const mediaSetPlayback: (playing: boolean) => Promise<void>;
244
499
  export interface TrackMeta {
@@ -411,6 +666,8 @@ export interface StartupMarks {
411
666
  setupEnd: number;
412
667
  }
413
668
  export declare const startupMarks: () => Promise<StartupMarks | null>;
669
+ /** The page has drawn: Rust shows the window, hidden until then so it never shows see-through. */
670
+ export declare const deckReady: () => Promise<void>;
414
671
  /** What a backup file holds: the Deck that wrote it, when, and how many of each thing. */
415
672
  export interface BackupSummary {
416
673
  deck: string;
@@ -664,6 +921,8 @@ export interface DbTable {
664
921
  name: string;
665
922
  kind: "table" | "view";
666
923
  columns: DbColumn[];
924
+ /** The statement that created it, where the engine keeps one (SQLite). */
925
+ sql?: string;
667
926
  }
668
927
  export interface DbForeignKey {
669
928
  table: string;
@@ -675,11 +934,15 @@ export interface DbSchema {
675
934
  tables: DbTable[];
676
935
  foreignKeys: DbForeignKey[];
677
936
  }
678
- /** Open a postgres:// or mysql:// connection. The handle outlives the calling component. */
937
+ /** Open a connection; the url's scheme picks the engine. The handle outlives the calling component. */
679
938
  export declare const dbConnect: (url: string) => Promise<number>;
680
939
  export declare const dbDisconnect: (handle: number) => Promise<void>;
681
- /** Run ONE statement. `readOnly` wraps it in a read-only transaction the server enforces. */
682
- export declare const dbQuery: (handle: number, sql: string, readOnly: boolean) => Promise<DbQueryResult>;
940
+ /**
941
+ * Run a statement and return up to 1000 rows, after skipping the first `skip` (how a grid pages).
942
+ * `readOnly` refuses writes, by the database itself (a read-only session on Postgres and MySQL,
943
+ * query_only on SQLite).
944
+ */
945
+ export declare const dbQuery: (handle: number, sql: string, readOnly: boolean, skip?: number) => Promise<DbQueryResult>;
683
946
  export declare const dbSchema: (handle: number) => Promise<DbSchema>;
684
947
  /** Open a tunnel. `remote` is host:port as seen FROM `host`. Returns [id, local port]. */
685
948
  export declare const sshTunnelOpen: (host: string, remote: string) => Promise<[number, number]>;
@@ -0,0 +1,189 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ import { type RecentPage } from "./browserurl";
3
+ import { type Bookmarks } from "./bookmarks";
4
+ /**
5
+ * `home`: the pane shows Deck's start page, and its webview (if it has one) is hidden. `back` and
6
+ * `forward`: whether the page has history that way. `private`: nothing it visits is kept.
7
+ * `page`: which of Deck's own pages the pane shows instead of a site, with `home` set too so the
8
+ * webview stays hidden ("" with `home` is the start page).
9
+ */
10
+ export type DeckPage = "" | "history" | "bookmarks" | "settings" | "downloads" | "passwords" | "extensions";
11
+ export interface BrowserState {
12
+ url: string;
13
+ title: string;
14
+ loading: boolean;
15
+ home: boolean;
16
+ page: DeckPage;
17
+ back: boolean;
18
+ forward: boolean;
19
+ private: boolean;
20
+ /** The find bar: shown, and the matches the search has (index is the current one, from 1). */
21
+ findOpen: boolean;
22
+ findCount: number;
23
+ findIndex: number;
24
+ /** The site's icon, whether the page plays sound and is muted, and its zoom (1 = 100%). */
25
+ favicon: string;
26
+ playing: boolean;
27
+ muted: boolean;
28
+ zoom: number;
29
+ /** The tab's own volume, 0 to 1, over what the page sets (VOLUME_JS in browser.rs). */
30
+ volume: number;
31
+ /** Ads and trackers the ad blocker refused on the current page. */
32
+ blocked: number;
33
+ /** The device the page is laid out as (DeviceBar), "" for the page's own size. */
34
+ device: string;
35
+ /** The device turned on its side (width and height swapped). */
36
+ rotated: boolean;
37
+ /** Devices shown side by side (DeviceBar), the first in the pane's own webview; [] for one. */
38
+ devices: string[];
39
+ }
40
+ export declare const subscribeBrowser: (f: () => void) => () => void;
41
+ export declare const browserState: (pane: string) => BrowserState | undefined;
42
+ /**
43
+ * The pane is gone (closed, or its tab or workspace was): close its webview and forget its page.
44
+ * Called from terminals.ts's destroy(), which every way of removing a pane goes through.
45
+ */
46
+ export declare function closeBrowserPane(pane: string): void;
47
+ /** The find bar registers how to focus its box, for Ctrl+F while it is already open. */
48
+ export declare function registerFindBox(pane: string, focus: () => void): () => void;
49
+ /** Open the find bar (Ctrl+F), or put the keyboard back in it when it is open. */
50
+ export declare function openFind(pane: string): void;
51
+ /** Close it and clear the page's highlights. */
52
+ export declare function closeFind(pane: string): void;
53
+ /** Show the start page in the pane, or leave it for `url`. */
54
+ export declare const showHome: (pane: string) => void;
55
+ export declare const leaveHome: (pane: string, url: string) => void;
56
+ /** Show the history page in the pane. */
57
+ export declare const showHistory: (pane: string) => void;
58
+ /** Show the bookmarks page in the pane. */
59
+ export declare const showBookmarks: (pane: string) => void;
60
+ /** Show the downloads in the pane. */
61
+ export declare const showDownloads: (pane: string) => void;
62
+ /** Show the extensions in the pane. */
63
+ export declare const showExtensions: (pane: string) => void;
64
+ /** Show the password vault in the pane. */
65
+ export declare const showPasswords: (pane: string) => void;
66
+ /** Show the browser's settings in the pane. */
67
+ export declare const showBrowserSettings: (pane: string) => void;
68
+ /** A new pane's kind, before anything else is known about it. */
69
+ export declare const startPane: (pane: string, isPrivate: boolean) => void;
70
+ /** Every ad and tracker blocked so far. */
71
+ export declare const totalBlocked: () => number;
72
+ /** The user's own ad blocker rules, as text. */
73
+ export declare const myFilters: () => Promise<string>;
74
+ /** Save them, and put them to work. */
75
+ export declare function saveMyFilters(text: string): Promise<void>;
76
+ /** Lay the pane's page out as a device (DeviceBar's ids), or as itself (""). */
77
+ export declare const setDevice: (pane: string, device: string) => void;
78
+ export declare const setRotated: (pane: string, rotated: boolean) => void;
79
+ /** Show these devices side by side (the first in the pane's own webview), or one ([]). */
80
+ export declare const setDevices: (pane: string, devices: string[]) => void;
81
+ /** A side-by-side device's webview rather than a pane's own. */
82
+ export declare function isMirror(pane: string): boolean;
83
+ /** The pane a mirror belongs to (a pane is its own). */
84
+ export declare function paneOf(id: string): string;
85
+ export declare function addMirror(id: string): void;
86
+ export declare function removeMirror(id: string): void;
87
+ /** Close a pane's mirrors from the `from`th on: side by side switched off, a device taken away, the
88
+ * pane closed. Not when the pane is only out of sight: a mirror stays, hidden, as the pane's own
89
+ * webview does, so coming back neither reloads it nor races a close against a reopen. */
90
+ export declare function closeMirrors(pane: string, from?: number): void;
91
+ /** Mute or unmute a pane's page. */
92
+ export declare const setMuted: (pane: string, muted: boolean) => undefined;
93
+ /** The tab's volume, 0 to 1. Kept for the tab, and sent again to each page it loads. */
94
+ export declare function setVolume(pane: string, v: number): void;
95
+ /** A browser pane says how to tell whether it has the keyboard and is showing a page. */
96
+ export declare function registerZoomTarget(pane: string, holds: () => boolean): () => void;
97
+ /** The browser pane whose page Deck's zoom keys should zoom, if the keyboard is in one. */
98
+ export declare const activeBrowserPage: () => string | undefined;
99
+ /** Zoom the pane's page a step in or out, or back to 100% (0). */
100
+ export declare function stepZoom(pane: string, dir: -1 | 0 | 1): void;
101
+ /** The URL a just-opened browser pane should show, if a page asked for it. */
102
+ export declare const takeWaitingUrl: () => {
103
+ url: string;
104
+ private: boolean;
105
+ } | undefined;
106
+ /** A new browser tab, on `url` or on the start page. */
107
+ export declare const newBrowserTab: (url?: string, isPrivate?: boolean) => boolean | void;
108
+ /** Read once, before the first browser pane asks. */
109
+ export declare const loadPanes: () => Promise<void>;
110
+ /** The page a pane was on when Deck last closed. */
111
+ export declare const savedPage: (pane: string) => string | undefined;
112
+ /** How Ctrl+Shift+B shows or hides the bookmarks bar: set by the browser pane, which holds the settings. */
113
+ export declare const setBarToggle: (f: () => void) => void;
114
+ /** Bookmark the pane's page, as its star does: Ctrl+D, and the browser menu. */
115
+ export declare const pressStar: (pane: string) => void | undefined;
116
+ /** The pane's star registers how to bookmark the page, for Ctrl+D. */
117
+ export declare function registerStar(pane: string, run: () => void): () => void;
118
+ /** The pane's key in the address bar registers what Ctrl+Shift+L does: fill the login, or offer the choice. */
119
+ export declare function registerVaultKey(pane: string, run: () => void): () => void;
120
+ /** The pane's address bar registers how to focus it, for Ctrl+L. */
121
+ export declare function registerAddressBar(pane: string, focus: () => void): () => void;
122
+ /** Tell Rust which chords to take from a page. Called when a browser pane mounts and whenever a
123
+ * binding changes. */
124
+ export declare function syncBrowserKeys(): void;
125
+ export interface Pin {
126
+ title: string;
127
+ url: string;
128
+ }
129
+ export declare const subscribeLists: (f: () => void) => () => void;
130
+ export declare const listsSnapshot: () => number;
131
+ export declare const browserPins: () => Pin[];
132
+ export declare const recentPages: () => RecentPage[];
133
+ export declare const ensureLists: () => undefined;
134
+ /** `id` is Rust's, for pausing and cancelling, and starts again each run; `key` is unique for good.
135
+ * `session`: started since Deck opened, so the toolbar shows it. */
136
+ export interface Download {
137
+ key: string;
138
+ id: number;
139
+ pane: string;
140
+ url: string;
141
+ path: string;
142
+ received: number;
143
+ total: number;
144
+ state: "running" | "paused" | "done" | "failed";
145
+ started: number;
146
+ session: boolean;
147
+ /** An extension being installed from the store (extensions.rs), not a file: its name once known. */
148
+ extension?: string;
149
+ }
150
+ export declare const subscribeDownloads: (f: () => void) => () => void;
151
+ export declare const downloadsSnapshot: () => number;
152
+ /** Newest first. */
153
+ export declare const browserDownloads: () => Download[];
154
+ /** Take one finished download off the list (the file stays). */
155
+ export declare function forgetDownload(key: string): void;
156
+ /** Take every finished download off the list. */
157
+ export declare function clearDownloads(): void;
158
+ export declare const browserBookmarks: () => Bookmarks;
159
+ export declare function setBookmarks(next: Bookmarks): void;
160
+ /** A Chromium browser's bookmarks on this machine, one per profile that has any. */
161
+ export interface BookmarkSource {
162
+ browser: string;
163
+ profile: string;
164
+ path: string;
165
+ }
166
+ /** Every profile of Chrome, Edge and Brave with a Bookmarks file. A browser not installed is no error. */
167
+ export declare function findBookmarkSources(): Promise<BookmarkSource[]>;
168
+ /** Import one source's bookmarks as a "From Chrome" folder in each root. Returns how many pages. */
169
+ export declare function importBookmarks(src: BookmarkSource): Promise<number>;
170
+ /** Every bookmark to a bookmarks HTML file, which any browser imports, and Deck too. How many pages. */
171
+ export declare function exportBookmarks(path: string): Promise<number>;
172
+ /** A bookmarks HTML file (Deck's own export, or any browser's) merged in, into folders of the same
173
+ * name and without pages already bookmarked. How many pages it added. */
174
+ export declare function importBookmarksFile(path: string): Promise<number>;
175
+ export declare function setPins(next: Pin[]): void;
176
+ /** Forget one page, or every visit between `from` and `to` (all of them when neither is given). */
177
+ export declare function forgetHistory(url: string): void;
178
+ export declare function forgetHistory(range: {
179
+ from?: number;
180
+ to?: number;
181
+ }): void;
182
+ export declare const forgetRecent: (url: string) => void;
183
+ export declare const serversSnapshot: () => number;
184
+ export declare const devServers: () => string[];
185
+ export declare function noteTermOutput(pane: string, chunk: string): void;
186
+ export declare function forgetTermPane(pane: string): void;
187
+ /** Where a pane's page is on screen, in Deck's CSS pixels, while it shows one. */
188
+ export declare const pageBox: (pane: string) => DOMRect | null;
189
+ export declare function trackBrowser(pane: string, el: HTMLElement, url: string): () => void;
@@ -0,0 +1,64 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ export type SearchEngine = "google" | "brave" | "duckduckgo" | "bing";
3
+ export declare const SEARCH_ENGINES: Record<SearchEngine, {
4
+ label: string;
5
+ home: string;
6
+ query: string;
7
+ }>;
8
+ export declare const searchUrl: (engine: SearchEngine, q: string) => string;
9
+ /**
10
+ * What was typed into the address bar or the start page's search box, as a URL to open.
11
+ *
12
+ * A scheme is kept; a local host gets plain http (dev servers rarely have TLS); a Windows or Unix
13
+ * path to a file becomes file:///; text with a space, or a single word with no dot, is a search;
14
+ * anything else is a host and gets https.
15
+ */
16
+ export declare function toUrl(typed: string, engine: SearchEngine): string;
17
+ /**
18
+ * Local URLs in a chunk of terminal output: what a dev server prints when it starts ("Local:
19
+ * http://localhost:5173/"). 0.0.0.0 is where a server listens, not somewhere to go, so it becomes
20
+ * localhost. A trailing dot or comma is the sentence's, not the URL's.
21
+ */
22
+ export declare function devUrls(chunk: string): string[];
23
+ /** The web addresses in a line of terminal output, where each starts and its text: what Ctrl+click
24
+ * opens. A trailing dot, comma or closing bracket is the sentence's, not the address's. */
25
+ export declare function findUrls(line: string): {
26
+ start: number;
27
+ text: string;
28
+ }[];
29
+ export interface RecentPage {
30
+ url: string;
31
+ title: string;
32
+ }
33
+ /** Whether `url` is a search engine's results page: on the way somewhere, not a place to go back to. */
34
+ export declare const isSearchPage: (url: string) => boolean;
35
+ /** One page in the history: how often it was opened, and when last (browser_history.rs keeps them). */
36
+ export interface Visit {
37
+ url: string;
38
+ title: string;
39
+ count: number;
40
+ last: number;
41
+ }
42
+ export interface Suggestion {
43
+ url: string;
44
+ title: string;
45
+ kind: "pin" | "bookmark" | "history";
46
+ }
47
+ /**
48
+ * What the address bar offers for `typed`: pinned sites, bookmarks and history whose address or
49
+ * title holds every word typed. An address that starts with what was typed comes first, then by
50
+ * how often and how lately it was visited, a pin or a bookmark counting as often.
51
+ */
52
+ export declare function suggest(typed: string, sources: {
53
+ pins?: readonly {
54
+ url: string;
55
+ title: string;
56
+ }[];
57
+ bookmarks?: readonly {
58
+ url: string;
59
+ title: string;
60
+ }[];
61
+ history?: readonly Visit[];
62
+ }, now: number, limit?: number): Suggestion[];
63
+ /** A day's heading in the history: Today, Yesterday, or the date. */
64
+ export declare function dayLabel(t: number, now: number): string;
@@ -1,50 +1,55 @@
1
- // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
- export interface SessionTab {
3
- /** Older sessions can also hold "graph" and "pr" tabs, from before git moved to the Git
4
- * plugin. The Editor skips them on restore. */
5
- kind: "file" | "media" | "graph" | "pr";
6
- path: string;
7
- rel: string | null;
8
- dirty?: string;
9
- }
10
- export interface WorkspaceSession {
11
- tabs: SessionTab[];
12
- activeId: string | null;
13
- expanded: string[];
14
- /** A typed-but-uncommitted message. Per root, because a message belongs to the repo it
15
- * describes. Only the active module is mounted, so without this a half-written message is
16
- * destroyed by switching to a terminal to check something — which is exactly when you switch. */
17
- commitMsg?: string;
18
- /** Collapsed Source Control rows: the two section headers, and folders in tree view. Per root
19
- * because the keys are paths in this repo. A Set on the way in and out; an array here because
20
- * that is what survives JSON. */
21
- scmCollapsed?: string[];
22
- }
23
- /** A file to open, and optionally where in it to land. */
24
- export interface PendingFile {
25
- path: string;
26
- line?: number;
27
- }
28
- export declare function queueOpenFiles(files: (string | PendingFile)[], instance?: EditorInstance): void;
29
- /** Take everything queued for one editor, leaving its queue empty. */
30
- export declare function drainOpenFiles(instance?: EditorInstance): PendingFile[];
31
- /**
32
- * Which editor is asking.
33
- *
34
- * There are two: the Editor tab, which opens whatever folder you point it at, and the one inside
35
- * Terminals, which follows that workspace's cwd. They are separate windows onto different work,
36
- * so their open folder and their UI prefs are stored per instance. Open TABS already separate on
37
- * their own — loadSession is keyed by root, and the two rarely share one.
38
- */
39
- export type EditorInstance = "tab" | "terminals";
40
- export declare function loadEditorRoot(instance: EditorInstance): string;
41
- export declare function saveEditorRoot(instance: EditorInstance, root: string): void;
42
- export interface GlobalUi {
43
- mdMode: "edit" | "live" | "split" | "preview";
44
- panel: "explorer" | "search" | "debug" | "scm";
45
- sidebarW: number;
46
- }
47
- export declare function loadSession(root: string): WorkspaceSession | null;
48
- export declare function saveSession(root: string, s: WorkspaceSession): void;
49
- export declare function loadUi(instance: EditorInstance): Partial<GlobalUi>;
50
- export declare function saveUi(instance: EditorInstance, ui: GlobalUi): void;
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ export interface SessionTab {
3
+ /** Older sessions can also hold "graph" and "pr" tabs, from before git moved to the Git
4
+ * plugin. The Editor skips them on restore. */
5
+ /** "untitled" is a buffer never saved (Ctrl+N), path `untitled:Untitled-N`: restored from
6
+ * `content` alone, with no disk read. An older Deck skips the kind, as it skips "graph". */
7
+ kind: "file" | "media" | "graph" | "pr" | "untitled";
8
+ path: string;
9
+ rel: string | null;
10
+ dirty?: string;
11
+ /** untitled: its whole text, and the language picked by hand for it (none: detected). */
12
+ content?: string;
13
+ lang?: string;
14
+ }
15
+ export interface WorkspaceSession {
16
+ tabs: SessionTab[];
17
+ activeId: string | null;
18
+ expanded: string[];
19
+ /** A typed-but-uncommitted message. Per root, because a message belongs to the repo it
20
+ * describes. Only the active module is mounted, so without this a half-written message is
21
+ * destroyed by switching to a terminal to check something — which is exactly when you switch. */
22
+ commitMsg?: string;
23
+ /** Collapsed Source Control rows: the two section headers, and folders in tree view. Per root
24
+ * because the keys are paths in this repo. A Set on the way in and out; an array here because
25
+ * that is what survives JSON. */
26
+ scmCollapsed?: string[];
27
+ }
28
+ /** A file to open, and optionally where in it to land. */
29
+ export interface PendingFile {
30
+ path: string;
31
+ line?: number;
32
+ }
33
+ export declare function queueOpenFiles(files: (string | PendingFile)[], instance?: EditorInstance): void;
34
+ /** Take everything queued for one editor, leaving its queue empty. */
35
+ export declare function drainOpenFiles(instance?: EditorInstance): PendingFile[];
36
+ /**
37
+ * Which editor is asking.
38
+ *
39
+ * There are two: the Editor tab, which opens whatever folder you point it at, and the one inside
40
+ * Terminals, which follows that workspace's cwd. They are separate windows onto different work,
41
+ * so their open folder and their UI prefs are stored per instance. Open TABS already separate on
42
+ * their own — loadSession is keyed by root, and the two rarely share one.
43
+ */
44
+ export type EditorInstance = "tab" | "terminals";
45
+ export declare function loadEditorRoot(instance: EditorInstance, pane?: string): string;
46
+ export declare function saveEditorRoot(instance: EditorInstance, root: string, pane?: string): void;
47
+ export interface GlobalUi {
48
+ mdMode: "edit" | "live" | "split" | "preview";
49
+ panel: "explorer" | "search" | "debug" | "scm";
50
+ sidebarW: number;
51
+ }
52
+ export declare function loadSession(root: string): WorkspaceSession | null;
53
+ export declare function saveSession(root: string, s: WorkspaceSession): void;
54
+ export declare function loadUi(instance: EditorInstance): Partial<GlobalUi>;
55
+ export declare function saveUi(instance: EditorInstance, ui: GlobalUi): void;
@@ -80,6 +80,15 @@ export interface EditorSettings {
80
80
  agentNotifyFinished: boolean;
81
81
  agentNotifyNeedsInput: boolean;
82
82
  agentNotifyOsToast: boolean;
83
+ /** Layout: the file panel docked beside the code or a drawer over it (Ctrl+B either way), the
84
+ * status as a bar along the bottom or a pill floating over the code, and the file's path on its
85
+ * own row under the tabs or in the tab line. */
86
+ layoutFiles: "docked" | "drawer";
87
+ layoutStatus: "bar" | "pill";
88
+ layoutPath: "row" | "tabs";
89
+ /** With the files in a drawer: Search, Source Control and Debug as icons in the tab line, or
90
+ * along the top of the drawer. */
91
+ layoutViews: "tabs" | "drawer";
83
92
  theme: "deck-dark" | "vs-dark" | "hc-black";
84
93
  iconTheme: string;
85
94
  diffSideBySide: boolean;
@@ -0,0 +1,84 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ /**
3
+ * attention: needs you now (a meeting starting, someone asking to join a board, a timer about to
4
+ * fire). activity: something finished in the background (a download, a timer that ran).
5
+ */
6
+ export type NotifKind = "input" | "done" | "attention" | "activity" | "update" | "error" | "news" | "plugin";
7
+ /**
8
+ * A button on a card and on its bell row. `nav` (a deck-navigate target) and `act` (a handler
9
+ * registered with onNotifAction) survive a restart; `run`, a plugin's own function, does not, so
10
+ * after a restart that button is gone from the bell.
11
+ */
12
+ export interface NotifAction {
13
+ label: string;
14
+ primary?: boolean;
15
+ nav?: string;
16
+ act?: string;
17
+ run?: () => void;
18
+ }
19
+ export interface Notif {
20
+ id: string;
21
+ kind: NotifKind;
22
+ title: string;
23
+ body: string;
24
+ ts: number;
25
+ /** Replaces an earlier notification with the same key. */
26
+ key?: string;
27
+ /** The workspace an agent notification is about: a click goes there. */
28
+ wsId?: string;
29
+ /** Where a click on the card itself goes, when it is not about a workspace. */
30
+ nav?: string;
31
+ /** Who posted it, shown beside the time: a plugin's name. */
32
+ source?: string;
33
+ actions?: NotifAction[];
34
+ /** Seen: the bell has been opened since it came. Read: the bell was closed after that. */
35
+ seen?: boolean;
36
+ read?: boolean;
37
+ }
38
+ export type Card = Notif & {
39
+ sticky: boolean;
40
+ };
41
+ /** The kinds Settings lists. What's new counts as an update. */
42
+ export type PrefKind = "input" | "done" | "attention" | "activity" | "update" | "error" | "plugin";
43
+ export type Channel = "card" | "bell" | "sound" | "os";
44
+ export declare const PREF_KINDS: {
45
+ kind: PrefKind;
46
+ label: string;
47
+ desc: string;
48
+ }[];
49
+ /**
50
+ * Whether a kind shows on a channel. Until it is set in Settings › Notifications, the agent kinds
51
+ * follow the four switches that Settings › AI agents used to have (on at all, finished, needs input,
52
+ * Windows), so nobody's choice flips.
53
+ */
54
+ export declare function prefFor(kind: PrefKind, ch: Channel): boolean;
55
+ export declare const useNotifCards: () => Card[];
56
+ export declare function useNotifHistory(): Notif[];
57
+ /** Whether Deck is the window in front, for a caller that only speaks up when you are away. */
58
+ export declare const deckInFront: () => boolean;
59
+ /**
60
+ * Post a notification. Returns its id, or "" when the user has every channel for its kind off.
61
+ * `transient`: a card only, never kept in the bell, for something in progress that a result will
62
+ * replace or resolveKey will take down (a hot reload while it runs).
63
+ */
64
+ export declare function notify(n: Omit<Notif, "id" | "ts" | "seen" | "read"> & {
65
+ sticky?: boolean;
66
+ transient?: boolean;
67
+ }): string;
68
+ /** The card's ✕: it goes, and its key stays quiet (see notify) until resolved or acted on. */
69
+ export declare function closeCard(id: string): void;
70
+ /** The card goes; the bell keeps it. */
71
+ export declare function dismissCard(id: string): void;
72
+ /** Gone from the bell, and its card with it. */
73
+ export declare function removeNotif(id: string): void;
74
+ /** What a key was about is dealt with (an agent was answered): its card goes, its row is read. */
75
+ export declare function resolveKey(key: string): void;
76
+ export declare function clearNotifs(): void;
77
+ /** The bell was opened: the badge clears, the rows stay lifted until it closes. */
78
+ export declare function markSeen(): void;
79
+ export declare function markRead(): void;
80
+ /** What a persisted action's `act` runs. Registered by the module that posts it, at import. */
81
+ export declare function onNotifAction(name: string, run: () => unknown): void;
82
+ /** A click on the card or the row itself: where it is about, then the card goes. */
83
+ export declare function openNotif(n: Notif): void;
84
+ export declare function runAction(n: Notif, a: NotifAction): void;
@@ -0,0 +1,39 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ export interface PluginNotification {
3
+ title: string;
4
+ /**
5
+ * Which of Settings › Notifications' rows it follows. "plugin" (the default) for a plugin's own
6
+ * news; "attention" for something that needs the user now (a meeting starting, a request to
7
+ * join), which also reaches Windows while Deck is behind; "activity" for something that finished
8
+ * in the background; "error" for a failure.
9
+ */
10
+ kind?: "plugin" | "attention" | "activity" | "error";
11
+ body?: string;
12
+ /** The plugin's name, shown beside the time. */
13
+ source: string;
14
+ /** Replaces this plugin's earlier notification with the same key, rather than adding another. */
15
+ key?: string;
16
+ /** Stays until dismissed instead of going after a few seconds. The bell keeps it either way. */
17
+ sticky?: boolean;
18
+ /**
19
+ * Something in progress: a card only, with no sound, never kept in the bell. Take it down with
20
+ * dismissNotification when it is done, or replace it (same key) with the result.
21
+ */
22
+ transient?: boolean;
23
+ /**
24
+ * Buttons on the card and on its bell row. `run` is the plugin's own function, so it lasts only
25
+ * as long as this session: after a restart the row is still in the bell, without its buttons.
26
+ */
27
+ actions?: {
28
+ label: string;
29
+ primary?: boolean;
30
+ run: () => void;
31
+ }[];
32
+ }
33
+ /**
34
+ * Post a notification: a card in the corner and a row in the bell, as Settings › Notifications
35
+ * says for plugins. For a passing word ("Copied") use toast() instead, which the bell does not keep.
36
+ */
37
+ export declare function notify(n: PluginNotification): void;
38
+ /** Take down this plugin's notification with that key: its card goes, its bell row is marked read. */
39
+ export declare function dismissNotification(source: string, key: string): void;
@@ -50,6 +50,8 @@ export interface LayoutWorkspace {
50
50
  cwd: string;
51
51
  tabs: LayoutTab[];
52
52
  activeTab: string;
53
+ /** Its colour on the sidebar's collapsed rail, by index (Terminals' TONES); none picks one from the name. */
54
+ color?: number;
53
55
  }
54
56
  export interface Layout {
55
57
  workspaces: LayoutWorkspace[];
@@ -0,0 +1,3 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ /** A Monaco language id (only ones Monaco ships), "plaintext" when nothing stands out. */
3
+ export declare function detectLanguage(text: string): string;
@@ -10,6 +10,8 @@ export interface EditorStatus {
10
10
  author: string;
11
11
  summary: string;
12
12
  } | null;
13
+ /** The shown model's Monaco language id: an untitled buffer's changes as it is detected. */
14
+ lang?: string;
13
15
  }
14
16
  export declare let editorStatus: EditorStatus;
15
17
  export declare function setEditorStatus(patch: Partial<EditorStatus>): void;
@@ -1,7 +1,18 @@
1
1
  // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
2
  import { monaco } from "../../core/monaco";
3
3
  export declare const viewStates: Map<string, monaco.editor.ICodeEditorViewState | null>;
4
+ /**
5
+ * An untitled buffer (Ctrl+N): `untitled:Untitled-N`. It has no file behind it, so its model gets
6
+ * an untitled: URI rather than a file:// one, it is never shown to a language server (which would
7
+ * answer for a file that does not exist), and its language comes from its text.
8
+ */
9
+ export declare const isUntitled: (path: string) => boolean;
4
10
  export declare function fileUri(path: string): monaco.Uri;
11
+ /** Pick an untitled buffer's language by hand, or null to go back to detecting it. Fine to call
12
+ * before its model exists (a restored tab): the model is then created with it. */
13
+ export declare function setUntitledLanguage(path: string, id: string | null): void;
14
+ /** Take `path` for `owner`; false when another editor's buffer has it. */
15
+ export declare function claimUntitled(path: string, owner: string): boolean;
5
16
  export declare function getFileModel(path: string, initial: string): monaco.editor.ITextModel;
6
17
  export declare function setModelValue(path: string, value: string): void;
7
18
  export declare function disposeModel(path: string | undefined): void;