deck-plugin-sdk 1.12.0 → 1.12.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deck-plugin-sdk",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "Build a plugin for Deck, outside the Deck repository.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -5,6 +5,6 @@
5
5
  "icon": "Sparkles",
6
6
  "color": "#a78bfa",
7
7
  "version": "0.1.0",
8
- "minDeck": "1.12.0",
8
+ "minDeck": "1.12.1",
9
9
  "permissions": []
10
10
  }
@@ -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;
@@ -0,0 +1,2 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ export {};
@@ -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
- /** A click on the card or the row itself: where it is about, then the card goes. */
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