deck-plugin-sdk 1.5.0 → 1.6.1
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 +1 -1
- package/shim/bridge.js +65 -0
- package/shim/ui.d.ts +1 -0
- package/shim/ui.js +7 -0
- package/template/plugin.json +1 -1
- package/types/components/ActivityBar.d.ts +3 -1
- package/types/components/ContextMenu.d.ts +3 -0
- package/types/components/TabStrip.d.ts +6 -1
- package/types/components/ui.d.ts +48 -1
- package/types/components/useResize.d.ts +8 -1
- package/types/core/bookmarks.d.ts +79 -0
- package/types/core/bridge.d.ts +271 -3
- package/types/core/browser.d.ts +189 -0
- package/types/core/browserurl.d.ts +64 -0
- package/types/core/editorsession.d.ts +55 -50
- package/types/core/editorsettings.d.ts +9 -0
- package/types/core/fileview.d.ts +22 -3
- package/types/core/notifications.d.ts +84 -0
- package/types/core/notifyapi.d.ts +39 -0
- package/types/core/terminals.d.ts +2 -0
- package/types/modules/editor/detectlang.d.ts +3 -0
- package/types/modules/editor/editorstatus.d.ts +2 -0
- package/types/modules/editor/models.d.ts +11 -0
package/types/core/bridge.d.ts
CHANGED
|
@@ -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,58 @@ export interface Settings {
|
|
|
116
313
|
* else the Windows account's (see `userName` in settingsstore.ts).
|
|
117
314
|
*/
|
|
118
315
|
userName: string;
|
|
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
|
+
* Where a file type opens, by extension (".pdf"): "editor", "browser" or "plugin:<id>". A type
|
|
362
|
+
* not listed is Automatic (see `openerFor` in fileview.ts).
|
|
363
|
+
*/
|
|
364
|
+
openWith?: Record<string, string>;
|
|
119
365
|
}
|
|
366
|
+
/** The bookmarks bar setting, older true/false values included. */
|
|
367
|
+
export declare const bookmarksBarMode: (s: Settings) => "always" | "home" | "never";
|
|
120
368
|
export declare const DEFAULT_SETTINGS: Settings;
|
|
121
369
|
export declare const setAutostart: (on: boolean) => Promise<void>;
|
|
122
370
|
export declare const getAutostart: () => Promise<boolean>;
|
|
@@ -239,6 +487,18 @@ export declare const logLatest: () => Promise<string>;
|
|
|
239
487
|
export declare const openFile: (path: string) => Promise<void>;
|
|
240
488
|
/** Files Deck was launched with — a double-click through Explorer's "Open with". */
|
|
241
489
|
export declare const launchFiles: () => Promise<string[]>;
|
|
490
|
+
/** Web addresses Deck was launched with: a link opened in another app, Deck being the default browser. */
|
|
491
|
+
export declare const launchUrls: () => Promise<string[]>;
|
|
492
|
+
export interface DefaultBrowserStatus {
|
|
493
|
+
registered: boolean;
|
|
494
|
+
isDefault: boolean;
|
|
495
|
+
name: string;
|
|
496
|
+
}
|
|
497
|
+
/** Whether Deck is offered as a browser in Windows, and whether links open with it. */
|
|
498
|
+
export declare const browserDefaultStatus: () => Promise<DefaultBrowserStatus>;
|
|
499
|
+
/** Register Deck as a browser for this user and open Windows' Default apps page at it: Windows
|
|
500
|
+
* keeps the choice itself to the user. */
|
|
501
|
+
export declare const browserDefaultRegister: () => Promise<DefaultBrowserStatus>;
|
|
242
502
|
export declare const mediaSetNowPlaying: (title: string, artist: string, artPath: string) => Promise<void>;
|
|
243
503
|
export declare const mediaSetPlayback: (playing: boolean) => Promise<void>;
|
|
244
504
|
export interface TrackMeta {
|
|
@@ -411,6 +671,8 @@ export interface StartupMarks {
|
|
|
411
671
|
setupEnd: number;
|
|
412
672
|
}
|
|
413
673
|
export declare const startupMarks: () => Promise<StartupMarks | null>;
|
|
674
|
+
/** The page has drawn: Rust shows the window, hidden until then so it never shows see-through. */
|
|
675
|
+
export declare const deckReady: () => Promise<void>;
|
|
414
676
|
/** What a backup file holds: the Deck that wrote it, when, and how many of each thing. */
|
|
415
677
|
export interface BackupSummary {
|
|
416
678
|
deck: string;
|
|
@@ -664,6 +926,8 @@ export interface DbTable {
|
|
|
664
926
|
name: string;
|
|
665
927
|
kind: "table" | "view";
|
|
666
928
|
columns: DbColumn[];
|
|
929
|
+
/** The statement that created it, where the engine keeps one (SQLite). */
|
|
930
|
+
sql?: string;
|
|
667
931
|
}
|
|
668
932
|
export interface DbForeignKey {
|
|
669
933
|
table: string;
|
|
@@ -675,11 +939,15 @@ export interface DbSchema {
|
|
|
675
939
|
tables: DbTable[];
|
|
676
940
|
foreignKeys: DbForeignKey[];
|
|
677
941
|
}
|
|
678
|
-
/** Open a
|
|
942
|
+
/** Open a connection; the url's scheme picks the engine. The handle outlives the calling component. */
|
|
679
943
|
export declare const dbConnect: (url: string) => Promise<number>;
|
|
680
944
|
export declare const dbDisconnect: (handle: number) => Promise<void>;
|
|
681
|
-
/**
|
|
682
|
-
|
|
945
|
+
/**
|
|
946
|
+
* Run a statement and return up to 1000 rows, after skipping the first `skip` (how a grid pages).
|
|
947
|
+
* `readOnly` refuses writes, by the database itself (a read-only session on Postgres and MySQL,
|
|
948
|
+
* query_only on SQLite).
|
|
949
|
+
*/
|
|
950
|
+
export declare const dbQuery: (handle: number, sql: string, readOnly: boolean, skip?: number) => Promise<DbQueryResult>;
|
|
683
951
|
export declare const dbSchema: (handle: number) => Promise<DbSchema>;
|
|
684
952
|
/** Open a tunnel. `remote` is host:port as seen FROM `host`. Returns [id, local port]. */
|
|
685
953
|
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;
|