deck-plugin-sdk 1.12.0 → 1.12.2
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/template/plugin.json +1 -1
- package/types/core/bridge.d.ts +3 -3
- package/types/core/browser/browser.d.ts +2 -0
- package/types/core/browser/sitenotify.d.ts +11 -0
- package/types/core/browser/webnotify.d.ts +2 -0
- package/types/core/notifications/notifications.d.ts +24 -1
- package/types/core/notifications/notifyapi.d.ts +10 -0
package/package.json
CHANGED
package/template/plugin.json
CHANGED
package/types/core/bridge.d.ts
CHANGED
|
@@ -260,7 +260,6 @@ export interface Settings {
|
|
|
260
260
|
startMinimized: boolean;
|
|
261
261
|
reduceMotion: boolean;
|
|
262
262
|
/** The Servers list (hosts from ~/.ssh/config) under the workspace list. */
|
|
263
|
-
serversList: boolean;
|
|
264
263
|
/** The mouse wheel over a tab bar switches tabs rather than scrolling the bar. */
|
|
265
264
|
tabWheelSwitch: boolean;
|
|
266
265
|
/** When the tabs do not fit, every one but the open tab shrinks to its icon. */
|
|
@@ -588,8 +587,9 @@ export interface ExecOut {
|
|
|
588
587
|
* Run a command to completion and read its output. `runScriptNow` is fire-and-forget; this is
|
|
589
588
|
* for when the output IS the point — asking a tool what it knows rather than telling it to do
|
|
590
589
|
* something. A bare name goes through cmd.exe, so PATH and .bat shims (`flutter`, `npm`) work.
|
|
590
|
+
* `env` adds variables for this run only (a CLI's token), never seen by anything else.
|
|
591
591
|
*/
|
|
592
|
-
export declare const exec: (command: string, args?: string[], cwd?: string) => Promise<ExecOut>;
|
|
592
|
+
export declare const exec: (command: string, args?: string[], cwd?: string, env?: Record<string, string>) => Promise<ExecOut>;
|
|
593
593
|
/** One header, one value. A list rather than a map: order matters, and repeats are legal. */
|
|
594
594
|
export type HttpHeader = [string, string];
|
|
595
595
|
export interface HttpSendRequest {
|
|
@@ -934,7 +934,7 @@ export interface ProcResult {
|
|
|
934
934
|
* command and read the output" into driving a long-lived tool that takes commands — a daemon
|
|
935
935
|
* speaking one JSON object per line, or a program reading single keypresses.
|
|
936
936
|
*/
|
|
937
|
-
export declare const procStream: (id: string, program: string, args: string[], cwd?: string, stdin?: boolean) => Promise<ProcResult>;
|
|
937
|
+
export declare const procStream: (id: string, program: string, args: string[], cwd?: string, stdin?: boolean, env?: Record<string, string>) => Promise<ProcResult>;
|
|
938
938
|
/** What receives a `procStreamBytes` run's stdout, one chunk at a time. */
|
|
939
939
|
export type ByteSink = (chunk: Uint8Array) => void;
|
|
940
940
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
2
|
import { type RecentPage } from "./browserurl";
|
|
3
3
|
import { type Bookmarks } from "./bookmarks";
|
|
4
|
+
import "./webnotify";
|
|
4
5
|
/**
|
|
5
6
|
* `home`: the pane shows Deck's start page, and its webview (if it has one) is hidden. `back` and
|
|
6
7
|
* `forward`: whether the page has history that way. `private`: nothing it visits is kept.
|
|
@@ -129,6 +130,7 @@ export declare function registerZoomTarget(pane: string, holds: () => boolean):
|
|
|
129
130
|
export declare const activeBrowserPage: () => string | undefined;
|
|
130
131
|
/** Zoom the pane's page a step in or out, or back to 100% (0). */
|
|
131
132
|
export declare function stepZoom(pane: string, dir: -1 | 0 | 1): void;
|
|
133
|
+
export declare const hostOf: (url: string) => string;
|
|
132
134
|
/** The URL a just-opened browser pane should show, if a page asked for it. */
|
|
133
135
|
export declare const takeWaitingUrl: () => {
|
|
134
136
|
url: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
+
export interface SiteNote {
|
|
3
|
+
title: string;
|
|
4
|
+
body: string;
|
|
5
|
+
/** Under the text: where it came from ("#hapster-tech · Slack"). */
|
|
6
|
+
source: string;
|
|
7
|
+
/** A person's message (the card shows them as one): a rule here found a sender. */
|
|
8
|
+
message: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** How a page's notification (its host, title and text) is shown in Deck. */
|
|
11
|
+
export declare function siteNote(host: string, title: string, body: string): SiteNote;
|
|
@@ -15,6 +15,8 @@ export interface NotifAction {
|
|
|
15
15
|
nav?: string;
|
|
16
16
|
act?: string;
|
|
17
17
|
run?: () => void;
|
|
18
|
+
/** What a click on the card does (open the tab, the file): no button of its own. */
|
|
19
|
+
open?: boolean;
|
|
18
20
|
}
|
|
19
21
|
export interface Notif {
|
|
20
22
|
id: string;
|
|
@@ -33,6 +35,14 @@ export interface Notif {
|
|
|
33
35
|
/** Who posted it, shown beside the time: a plugin's name. */
|
|
34
36
|
source?: string;
|
|
35
37
|
actions?: NotifAction[];
|
|
38
|
+
/**
|
|
39
|
+
* A person's message (a chat, a mail): the card shows the sender, `title`, with their picture
|
|
40
|
+
* (`image`, else their initials) and the app's icon on it (`badge`), and the whole of `body`.
|
|
41
|
+
*/
|
|
42
|
+
message?: {
|
|
43
|
+
image?: string;
|
|
44
|
+
badge?: string;
|
|
45
|
+
};
|
|
36
46
|
/** Seen: the bell has been opened since it came. Read: the bell was closed after that. */
|
|
37
47
|
seen?: boolean;
|
|
38
48
|
read?: boolean;
|
|
@@ -79,8 +89,21 @@ export declare function clearNotifs(): void;
|
|
|
79
89
|
/** The bell was opened: the badge clears, the rows stay lifted until it closes. */
|
|
80
90
|
export declare function markSeen(): void;
|
|
81
91
|
export declare function markRead(): void;
|
|
92
|
+
/**
|
|
93
|
+
* The tab of the plugin named `source`, where a click on its notification goes when the plugin
|
|
94
|
+
* gave it no open action. Set by the plugin loader (plugins.ts), so that this file and the plugin
|
|
95
|
+
* API in notifyapi.ts do not import the loader, which would put all of it in the SDK's types.
|
|
96
|
+
*/
|
|
97
|
+
declare let tabOfPlugin: (source: string) => string | undefined;
|
|
98
|
+
export declare const setPluginTabs: (f: typeof tabOfPlugin) => void;
|
|
99
|
+
export declare const pluginTabOf: (source: string) => string | undefined;
|
|
82
100
|
/** What a persisted action's `act` runs. Registered by the module that posts it, at import. */
|
|
83
101
|
export declare function onNotifAction(name: string, run: () => unknown): void;
|
|
84
|
-
/**
|
|
102
|
+
/** Whether a click on the card or its row goes anywhere: it is drawn as clickable only then. */
|
|
103
|
+
export declare const opens: (n: Notif) => boolean;
|
|
104
|
+
/** The actions shown as buttons: all but the one the card's click runs. */
|
|
105
|
+
export declare const buttons: (n: Notif) => NotifAction[];
|
|
106
|
+
/** A click on the card or the row itself: its open action, or where it is about; then the card goes. */
|
|
85
107
|
export declare function openNotif(n: Notif): void;
|
|
86
108
|
export declare function runAction(n: Notif, a: NotifAction): void;
|
|
109
|
+
export {};
|
|
@@ -23,12 +23,22 @@ export interface PluginNotification {
|
|
|
23
23
|
/**
|
|
24
24
|
* Buttons on the card and on its bell row. `run` is the plugin's own function, so it lasts only
|
|
25
25
|
* as long as this session: after a restart the row is still in the bell, without its buttons.
|
|
26
|
+
* `open`: what a click anywhere on the card does (open the mail, the build); it has no button.
|
|
27
|
+
* Without one, a click opens the plugin's own tab, when it has one.
|
|
26
28
|
*/
|
|
27
29
|
actions?: {
|
|
28
30
|
label: string;
|
|
29
31
|
primary?: boolean;
|
|
32
|
+
open?: boolean;
|
|
30
33
|
run: () => void;
|
|
31
34
|
}[];
|
|
35
|
+
/**
|
|
36
|
+
* A person's message (new mail, a chat): the card shows `title` as the sender, with their picture
|
|
37
|
+
* (`image`, an https: or data: address; else their initials), and the whole of `body`.
|
|
38
|
+
*/
|
|
39
|
+
message?: {
|
|
40
|
+
image?: string;
|
|
41
|
+
};
|
|
32
42
|
}
|
|
33
43
|
/**
|
|
34
44
|
* Post a notification: a card in the corner and a row in the bell, as Settings › Notifications
|