deck-plugin-sdk 1.10.0 → 1.10.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 +60 -60
- package/template/plugin.json +10 -10
- package/types/core/browser.d.ts +1 -0
- package/types/core/p2p.d.ts +117 -117
- package/types/core/settingsstore.d.ts +26 -26
package/package.json
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "deck-plugin-sdk",
|
|
3
|
-
"version": "1.10.
|
|
4
|
-
"description": "Build a plugin for Deck, outside the Deck repository.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"bin": {
|
|
8
|
-
"deck-plugin": "bin/deck-plugin.mjs"
|
|
9
|
-
},
|
|
10
|
-
"exports": {
|
|
11
|
-
"./build": "./build-plugin.mjs",
|
|
12
|
-
"./*": {
|
|
13
|
-
"types": "./shim/*.d.ts",
|
|
14
|
-
"default": "./shim/*.js"
|
|
15
|
-
},
|
|
16
|
-
"./package.json": "./package.json"
|
|
17
|
-
},
|
|
18
|
-
"files": [
|
|
19
|
-
"bin",
|
|
20
|
-
"shim",
|
|
21
|
-
"types",
|
|
22
|
-
"template",
|
|
23
|
-
"build-plugin.mjs",
|
|
24
|
-
"packages.mjs",
|
|
25
|
-
"README.md",
|
|
26
|
-
"permissions.json",
|
|
27
|
-
"publish.mjs",
|
|
28
|
-
"validate.mjs"
|
|
29
|
-
],
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"esbuild": "^0.28.0"
|
|
32
|
-
},
|
|
33
|
-
"peerDependencies": {
|
|
34
|
-
"@types/react": "^19.0.0",
|
|
35
|
-
"framer-motion": "^13.0.0",
|
|
36
|
-
"lucide-react": "^1.0.0",
|
|
37
|
-
"monaco-editor": "^0.56.0",
|
|
38
|
-
"react": "^19.0.0",
|
|
39
|
-
"typescript": "^5.0.0"
|
|
40
|
-
},
|
|
41
|
-
"peerDependenciesMeta": {
|
|
42
|
-
"framer-motion": {
|
|
43
|
-
"optional": true
|
|
44
|
-
},
|
|
45
|
-
"monaco-editor": {
|
|
46
|
-
"optional": true
|
|
47
|
-
},
|
|
48
|
-
"typescript": {
|
|
49
|
-
"optional": true
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
"engines": {
|
|
53
|
-
"node": ">=20"
|
|
54
|
-
},
|
|
55
|
-
"keywords": [
|
|
56
|
-
"deck",
|
|
57
|
-
"plugin",
|
|
58
|
-
"sdk"
|
|
59
|
-
]
|
|
60
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "deck-plugin-sdk",
|
|
3
|
+
"version": "1.10.1",
|
|
4
|
+
"description": "Build a plugin for Deck, outside the Deck repository.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"bin": {
|
|
8
|
+
"deck-plugin": "bin/deck-plugin.mjs"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
"./build": "./build-plugin.mjs",
|
|
12
|
+
"./*": {
|
|
13
|
+
"types": "./shim/*.d.ts",
|
|
14
|
+
"default": "./shim/*.js"
|
|
15
|
+
},
|
|
16
|
+
"./package.json": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"bin",
|
|
20
|
+
"shim",
|
|
21
|
+
"types",
|
|
22
|
+
"template",
|
|
23
|
+
"build-plugin.mjs",
|
|
24
|
+
"packages.mjs",
|
|
25
|
+
"README.md",
|
|
26
|
+
"permissions.json",
|
|
27
|
+
"publish.mjs",
|
|
28
|
+
"validate.mjs"
|
|
29
|
+
],
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"esbuild": "^0.28.0"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@types/react": "^19.0.0",
|
|
35
|
+
"framer-motion": "^13.0.0",
|
|
36
|
+
"lucide-react": "^1.0.0",
|
|
37
|
+
"monaco-editor": "^0.56.0",
|
|
38
|
+
"react": "^19.0.0",
|
|
39
|
+
"typescript": "^5.0.0"
|
|
40
|
+
},
|
|
41
|
+
"peerDependenciesMeta": {
|
|
42
|
+
"framer-motion": {
|
|
43
|
+
"optional": true
|
|
44
|
+
},
|
|
45
|
+
"monaco-editor": {
|
|
46
|
+
"optional": true
|
|
47
|
+
},
|
|
48
|
+
"typescript": {
|
|
49
|
+
"optional": true
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=20"
|
|
54
|
+
},
|
|
55
|
+
"keywords": [
|
|
56
|
+
"deck",
|
|
57
|
+
"plugin",
|
|
58
|
+
"sdk"
|
|
59
|
+
]
|
|
60
|
+
}
|
package/template/plugin.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "__ID__",
|
|
3
|
-
"name": "__NAME__",
|
|
4
|
-
"description": "One line on what this is for, shown under its name in Settings.",
|
|
5
|
-
"icon": "Sparkles",
|
|
6
|
-
"color": "#a78bfa",
|
|
7
|
-
"version": "0.1.0",
|
|
8
|
-
"minDeck": "1.10.
|
|
9
|
-
"permissions": []
|
|
10
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"id": "__ID__",
|
|
3
|
+
"name": "__NAME__",
|
|
4
|
+
"description": "One line on what this is for, shown under its name in Settings.",
|
|
5
|
+
"icon": "Sparkles",
|
|
6
|
+
"color": "#a78bfa",
|
|
7
|
+
"version": "0.1.0",
|
|
8
|
+
"minDeck": "1.10.1",
|
|
9
|
+
"permissions": []
|
|
10
|
+
}
|
package/types/core/browser.d.ts
CHANGED
|
@@ -233,4 +233,5 @@ export declare const pageBox: (pane: string) => DOMRect | null;
|
|
|
233
233
|
export declare const paneWindow: (pane: string) => Window;
|
|
234
234
|
/** Close the pane's webview to give back its memory, keeping the tab and its address. */
|
|
235
235
|
export declare function discardBrowserPane(pane: string): Promise<void>;
|
|
236
|
+
export declare function picturePages(on: boolean): void;
|
|
236
237
|
export declare function trackBrowser(pane: string, el: HTMLElement, url: string): () => void;
|
package/types/core/p2p.d.ts
CHANGED
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
-
/** What can travel: anything JSON can carry. */
|
|
3
|
-
export type Json = string | number | boolean | null | Json[] | {
|
|
4
|
-
[k: string]: Json;
|
|
5
|
-
};
|
|
6
|
-
/** Whether someone may change what is shared, or only watch. */
|
|
7
|
-
export type Mode = "edit" | "view";
|
|
8
|
-
/** Who may change things: a default for everyone, and a choice per person that wins over it. */
|
|
9
|
-
export interface Roles {
|
|
10
|
-
def: Mode;
|
|
11
|
-
per: Record<string, Mode>;
|
|
12
|
-
}
|
|
13
|
-
/** Why a share ended for a joiner: the host stopped, vanished, removed this Deck, turned it away,
|
|
14
|
-
* or speaks another version. */
|
|
15
|
-
export type Gone = "ended" | "lost" | "removed" | "denied" | "version";
|
|
16
|
-
export interface Person {
|
|
17
|
-
id: string;
|
|
18
|
-
name: string; /** Round trip in ms, once measured. */
|
|
19
|
-
ms?: number;
|
|
20
|
-
}
|
|
21
|
-
/** What a share's bar and dialogs show. Replaced, never mutated, so React sees a change. */
|
|
22
|
-
export interface ShareView {
|
|
23
|
-
/** Who is in and connected: on the host, everyone let in; on a joiner, the host and the others. */
|
|
24
|
-
peers: Person[];
|
|
25
|
-
/** On the host: who is asking to be let in. */
|
|
26
|
-
knocking: Person[];
|
|
27
|
-
/** On a joiner: the host is there but has not let this Deck in yet. */
|
|
28
|
-
waiting: boolean;
|
|
29
|
-
/** On a joiner: no host heard from for a while (wrong code, or a network that blocks it). */
|
|
30
|
-
stuck: boolean;
|
|
31
|
-
gone: Gone | null;
|
|
32
|
-
hostName: string;
|
|
33
|
-
/** A passing line: someone on another version, or whatever the plugin `say`s. */
|
|
34
|
-
note: string;
|
|
35
|
-
roles: Roles;
|
|
36
|
-
/** Whether this Deck may change things. */
|
|
37
|
-
canEdit: boolean;
|
|
38
|
-
}
|
|
39
|
-
export interface ShareOptions {
|
|
40
|
-
/** What the share is for, e.g. "canvas-share". Decks only meet others using the same one. */
|
|
41
|
-
app: string;
|
|
42
|
-
/** The share code, which names the room (see newCode). */
|
|
43
|
-
code: string;
|
|
44
|
-
/** Optional extra secret, needed with the code to connect at all. Sharing works without one. */
|
|
45
|
-
password?: string;
|
|
46
|
-
/** The plugin's message channel, at most 12 bytes (Trystero's cap). Defaults to "msg". */
|
|
47
|
-
channel?: string;
|
|
48
|
-
/** Whether this Deck is the one sharing. */
|
|
49
|
-
host: boolean;
|
|
50
|
-
/** Shown to the others: in the host's knock, on cursors, in the list of who is here. */
|
|
51
|
-
name: string;
|
|
52
|
-
/** The plugin's own protocol version. Decks on different versions do not share. */
|
|
53
|
-
version: number;
|
|
54
|
-
/** The host's default for who may change things. Joiners may until the host says otherwise. */
|
|
55
|
-
mode?: Mode;
|
|
56
|
-
}
|
|
57
|
-
export interface ShareHandlers<T> {
|
|
58
|
-
/** A plugin message, only ever from someone let in (and the host). Check `mayEdit(peer)` before
|
|
59
|
-
* applying a change: a view-only person's edits are to be dropped by every Deck. */
|
|
60
|
-
message: (msg: T, peer: string) => void;
|
|
61
|
-
/** On the host: someone was just let in. Send them what they need to start, e.g. the board. */
|
|
62
|
-
welcome?: (peer: string) => void;
|
|
63
|
-
/** Someone left or was removed: forget what was kept for them (a cursor). */
|
|
64
|
-
left?: (peer: string) => void;
|
|
65
|
-
}
|
|
66
|
-
export interface P2pShare<T> {
|
|
67
|
-
readonly host: boolean;
|
|
68
|
-
/** Send a plugin message to everyone let in, or to one of them. Sends nothing before this Deck is
|
|
69
|
-
* let in. Settles once handed to the connection, so awaiting it paces the sender. */
|
|
70
|
-
send(msg: T, to?: string): Promise<void>;
|
|
71
|
-
/** Whether a peer may change things: the host always, anyone else by the roles. */
|
|
72
|
-
mayEdit(peer: string): boolean;
|
|
73
|
-
/** The host: let someone in, or turn them away. */
|
|
74
|
-
allow(peer: string): void;
|
|
75
|
-
deny(peer: string): void;
|
|
76
|
-
/** The host: remove someone who was let in. They cannot come back with the same Deck. */
|
|
77
|
-
kick(peer: string): void;
|
|
78
|
-
/** The host: everyone's default, and one person's own choice (`null` follows the default). */
|
|
79
|
-
setDefault(mode: Mode): void;
|
|
80
|
-
setPerson(peer: string, mode: Mode | null): void;
|
|
81
|
-
/** Show a passing line in the view for a few seconds. */
|
|
82
|
-
say(note: string): void;
|
|
83
|
-
/** Leave. With `announce` (the host ending on purpose) everyone is told first, so they end at
|
|
84
|
-
* once rather than when the connection times out. Safe to call twice. */
|
|
85
|
-
close(announce?: boolean): Promise<void>;
|
|
86
|
-
/** For useSyncExternalStore. */
|
|
87
|
-
subscribe(fn: () => void): () => void;
|
|
88
|
-
getView(): ShareView;
|
|
89
|
-
}
|
|
90
|
-
/** The part of a Trystero room a share uses: a seam, so the check can run a share without a network. */
|
|
91
|
-
export interface RoomLike {
|
|
92
|
-
/** This Deck's id in the room; Trystero's own is `selfId()`. */
|
|
93
|
-
selfId?: string;
|
|
94
|
-
makeAction(name: string, config: {
|
|
95
|
-
onMessage: (data: any, ctx: {
|
|
96
|
-
peerId: string;
|
|
97
|
-
}) => void;
|
|
98
|
-
}): {
|
|
99
|
-
send(data: any, options?: {
|
|
100
|
-
target?: string | string[];
|
|
101
|
-
}): Promise<void>;
|
|
102
|
-
};
|
|
103
|
-
ping(peer: string): Promise<number>;
|
|
104
|
-
leave(): Promise<void>;
|
|
105
|
-
getPeers(): Record<string, unknown>;
|
|
106
|
-
onPeerJoin: ((peer: string) => void) | null;
|
|
107
|
-
onPeerLeave: ((peer: string) => void) | null;
|
|
108
|
-
}
|
|
109
|
-
/** This Deck's id in every share: the one the others know it by. The same for the whole session,
|
|
110
|
-
* so someone let in who rejoins after a dropped connection is let straight back in. */
|
|
111
|
-
export declare function selfId(): string;
|
|
112
|
-
/** Start sharing (`host`), or ask to join someone's share. */
|
|
113
|
-
export declare function share<T extends Json>(opts: ShareOptions, on: ShareHandlers<T>, room?: RoomLike): P2pShare<T>;
|
|
114
|
-
/** A share code: 16 random characters in four groups, easy to read out or paste. */
|
|
115
|
-
export declare function newCode(random?: (n: number) => Uint8Array): string;
|
|
116
|
-
/** A pasted code, tidied: spaces dropped, case folded. Empty when it is not a code. */
|
|
117
|
-
export declare function cleanCode(text: string): string;
|
|
1
|
+
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
+
/** What can travel: anything JSON can carry. */
|
|
3
|
+
export type Json = string | number | boolean | null | Json[] | {
|
|
4
|
+
[k: string]: Json;
|
|
5
|
+
};
|
|
6
|
+
/** Whether someone may change what is shared, or only watch. */
|
|
7
|
+
export type Mode = "edit" | "view";
|
|
8
|
+
/** Who may change things: a default for everyone, and a choice per person that wins over it. */
|
|
9
|
+
export interface Roles {
|
|
10
|
+
def: Mode;
|
|
11
|
+
per: Record<string, Mode>;
|
|
12
|
+
}
|
|
13
|
+
/** Why a share ended for a joiner: the host stopped, vanished, removed this Deck, turned it away,
|
|
14
|
+
* or speaks another version. */
|
|
15
|
+
export type Gone = "ended" | "lost" | "removed" | "denied" | "version";
|
|
16
|
+
export interface Person {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string; /** Round trip in ms, once measured. */
|
|
19
|
+
ms?: number;
|
|
20
|
+
}
|
|
21
|
+
/** What a share's bar and dialogs show. Replaced, never mutated, so React sees a change. */
|
|
22
|
+
export interface ShareView {
|
|
23
|
+
/** Who is in and connected: on the host, everyone let in; on a joiner, the host and the others. */
|
|
24
|
+
peers: Person[];
|
|
25
|
+
/** On the host: who is asking to be let in. */
|
|
26
|
+
knocking: Person[];
|
|
27
|
+
/** On a joiner: the host is there but has not let this Deck in yet. */
|
|
28
|
+
waiting: boolean;
|
|
29
|
+
/** On a joiner: no host heard from for a while (wrong code, or a network that blocks it). */
|
|
30
|
+
stuck: boolean;
|
|
31
|
+
gone: Gone | null;
|
|
32
|
+
hostName: string;
|
|
33
|
+
/** A passing line: someone on another version, or whatever the plugin `say`s. */
|
|
34
|
+
note: string;
|
|
35
|
+
roles: Roles;
|
|
36
|
+
/** Whether this Deck may change things. */
|
|
37
|
+
canEdit: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface ShareOptions {
|
|
40
|
+
/** What the share is for, e.g. "canvas-share". Decks only meet others using the same one. */
|
|
41
|
+
app: string;
|
|
42
|
+
/** The share code, which names the room (see newCode). */
|
|
43
|
+
code: string;
|
|
44
|
+
/** Optional extra secret, needed with the code to connect at all. Sharing works without one. */
|
|
45
|
+
password?: string;
|
|
46
|
+
/** The plugin's message channel, at most 12 bytes (Trystero's cap). Defaults to "msg". */
|
|
47
|
+
channel?: string;
|
|
48
|
+
/** Whether this Deck is the one sharing. */
|
|
49
|
+
host: boolean;
|
|
50
|
+
/** Shown to the others: in the host's knock, on cursors, in the list of who is here. */
|
|
51
|
+
name: string;
|
|
52
|
+
/** The plugin's own protocol version. Decks on different versions do not share. */
|
|
53
|
+
version: number;
|
|
54
|
+
/** The host's default for who may change things. Joiners may until the host says otherwise. */
|
|
55
|
+
mode?: Mode;
|
|
56
|
+
}
|
|
57
|
+
export interface ShareHandlers<T> {
|
|
58
|
+
/** A plugin message, only ever from someone let in (and the host). Check `mayEdit(peer)` before
|
|
59
|
+
* applying a change: a view-only person's edits are to be dropped by every Deck. */
|
|
60
|
+
message: (msg: T, peer: string) => void;
|
|
61
|
+
/** On the host: someone was just let in. Send them what they need to start, e.g. the board. */
|
|
62
|
+
welcome?: (peer: string) => void;
|
|
63
|
+
/** Someone left or was removed: forget what was kept for them (a cursor). */
|
|
64
|
+
left?: (peer: string) => void;
|
|
65
|
+
}
|
|
66
|
+
export interface P2pShare<T> {
|
|
67
|
+
readonly host: boolean;
|
|
68
|
+
/** Send a plugin message to everyone let in, or to one of them. Sends nothing before this Deck is
|
|
69
|
+
* let in. Settles once handed to the connection, so awaiting it paces the sender. */
|
|
70
|
+
send(msg: T, to?: string): Promise<void>;
|
|
71
|
+
/** Whether a peer may change things: the host always, anyone else by the roles. */
|
|
72
|
+
mayEdit(peer: string): boolean;
|
|
73
|
+
/** The host: let someone in, or turn them away. */
|
|
74
|
+
allow(peer: string): void;
|
|
75
|
+
deny(peer: string): void;
|
|
76
|
+
/** The host: remove someone who was let in. They cannot come back with the same Deck. */
|
|
77
|
+
kick(peer: string): void;
|
|
78
|
+
/** The host: everyone's default, and one person's own choice (`null` follows the default). */
|
|
79
|
+
setDefault(mode: Mode): void;
|
|
80
|
+
setPerson(peer: string, mode: Mode | null): void;
|
|
81
|
+
/** Show a passing line in the view for a few seconds. */
|
|
82
|
+
say(note: string): void;
|
|
83
|
+
/** Leave. With `announce` (the host ending on purpose) everyone is told first, so they end at
|
|
84
|
+
* once rather than when the connection times out. Safe to call twice. */
|
|
85
|
+
close(announce?: boolean): Promise<void>;
|
|
86
|
+
/** For useSyncExternalStore. */
|
|
87
|
+
subscribe(fn: () => void): () => void;
|
|
88
|
+
getView(): ShareView;
|
|
89
|
+
}
|
|
90
|
+
/** The part of a Trystero room a share uses: a seam, so the check can run a share without a network. */
|
|
91
|
+
export interface RoomLike {
|
|
92
|
+
/** This Deck's id in the room; Trystero's own is `selfId()`. */
|
|
93
|
+
selfId?: string;
|
|
94
|
+
makeAction(name: string, config: {
|
|
95
|
+
onMessage: (data: any, ctx: {
|
|
96
|
+
peerId: string;
|
|
97
|
+
}) => void;
|
|
98
|
+
}): {
|
|
99
|
+
send(data: any, options?: {
|
|
100
|
+
target?: string | string[];
|
|
101
|
+
}): Promise<void>;
|
|
102
|
+
};
|
|
103
|
+
ping(peer: string): Promise<number>;
|
|
104
|
+
leave(): Promise<void>;
|
|
105
|
+
getPeers(): Record<string, unknown>;
|
|
106
|
+
onPeerJoin: ((peer: string) => void) | null;
|
|
107
|
+
onPeerLeave: ((peer: string) => void) | null;
|
|
108
|
+
}
|
|
109
|
+
/** This Deck's id in every share: the one the others know it by. The same for the whole session,
|
|
110
|
+
* so someone let in who rejoins after a dropped connection is let straight back in. */
|
|
111
|
+
export declare function selfId(): string;
|
|
112
|
+
/** Start sharing (`host`), or ask to join someone's share. */
|
|
113
|
+
export declare function share<T extends Json>(opts: ShareOptions, on: ShareHandlers<T>, room?: RoomLike): P2pShare<T>;
|
|
114
|
+
/** A share code: 16 random characters in four groups, easy to read out or paste. */
|
|
115
|
+
export declare function newCode(random?: (n: number) => Uint8Array): string;
|
|
116
|
+
/** A pasted code, tidied: spaces dropped, case folded. Empty when it is not a code. */
|
|
117
|
+
export declare function cleanCode(text: string): string;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
-
import { type Settings } from "./bridge";
|
|
3
|
-
/** Called by Settings after every write, so readers update without a reload. */
|
|
4
|
-
export declare function publishSettings(s: Settings): void;
|
|
5
|
-
/**
|
|
6
|
-
* Write settings and apply everything that has to happen alongside the write.
|
|
7
|
-
*
|
|
8
|
-
* Settings' own persist() used to be the only path, so anything outside that module (the
|
|
9
|
-
* command palette toggling relay, say) would have had to repeat five steps and would break
|
|
10
|
-
* quietly when one of them changed. Settings still owns its local form state and calls this
|
|
11
|
-
* for the shared half.
|
|
12
|
-
*/
|
|
13
|
-
export declare function saveSettings(next: Settings): void;
|
|
14
|
-
/** The zoom steps Ctrl+= and Ctrl+- move through, in percent, as a browser's do. */
|
|
15
|
-
export declare const ZOOM_STEPS: number[];
|
|
16
|
-
/**
|
|
17
|
-
* Zoom the whole window: the webview's own zoom, the same as a browser's Ctrl+=, rather than CSS
|
|
18
|
-
* `zoom`, which leaves xterm and Monaco measuring the mouse in unzoomed pixels.
|
|
19
|
-
*/
|
|
20
|
-
export declare function applyZoom(pct: number | undefined): void;
|
|
21
|
-
/** One step in or out from the current zoom, or back to 100% with dir 0. Saved like any setting. */
|
|
22
|
-
export declare function stepZoom(dir: -1 | 0 | 1): void;
|
|
23
|
-
/** Current settings for non-React callers (the palette's providers). */
|
|
24
|
-
export declare const getSettings: () => Settings;
|
|
25
|
-
export declare function userName(): Promise<string>;
|
|
26
|
-
export declare function useSettings(): Settings;
|
|
1
|
+
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
+
import { type Settings } from "./bridge";
|
|
3
|
+
/** Called by Settings after every write, so readers update without a reload. */
|
|
4
|
+
export declare function publishSettings(s: Settings): void;
|
|
5
|
+
/**
|
|
6
|
+
* Write settings and apply everything that has to happen alongside the write.
|
|
7
|
+
*
|
|
8
|
+
* Settings' own persist() used to be the only path, so anything outside that module (the
|
|
9
|
+
* command palette toggling relay, say) would have had to repeat five steps and would break
|
|
10
|
+
* quietly when one of them changed. Settings still owns its local form state and calls this
|
|
11
|
+
* for the shared half.
|
|
12
|
+
*/
|
|
13
|
+
export declare function saveSettings(next: Settings): void;
|
|
14
|
+
/** The zoom steps Ctrl+= and Ctrl+- move through, in percent, as a browser's do. */
|
|
15
|
+
export declare const ZOOM_STEPS: number[];
|
|
16
|
+
/**
|
|
17
|
+
* Zoom the whole window: the webview's own zoom, the same as a browser's Ctrl+=, rather than CSS
|
|
18
|
+
* `zoom`, which leaves xterm and Monaco measuring the mouse in unzoomed pixels.
|
|
19
|
+
*/
|
|
20
|
+
export declare function applyZoom(pct: number | undefined): void;
|
|
21
|
+
/** One step in or out from the current zoom, or back to 100% with dir 0. Saved like any setting. */
|
|
22
|
+
export declare function stepZoom(dir: -1 | 0 | 1): void;
|
|
23
|
+
/** Current settings for non-React callers (the palette's providers). */
|
|
24
|
+
export declare const getSettings: () => Settings;
|
|
25
|
+
export declare function userName(): Promise<string>;
|
|
26
|
+
export declare function useSettings(): Settings;
|