deck-plugin-sdk 1.15.1 → 1.15.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deck-plugin-sdk",
3
- "version": "1.15.1",
3
+ "version": "1.15.2",
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.15.1",
8
+ "minDeck": "1.15.2",
9
9
  "permissions": []
10
10
  }
@@ -11,7 +11,7 @@ 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, grouped, }: {
14
+ export declare function ActivityBar<Id extends string>({ views, active, onSelect, trailing, grouped, flat, }: {
15
15
  views: readonly ActivityView<Id>[];
16
16
  active: Id;
17
17
  onSelect: (id: Id) => void;
@@ -19,4 +19,6 @@ export declare function ActivityBar<Id extends string>({ views, active, onSelect
19
19
  trailing?: React.ReactNode;
20
20
  /** The icons together in one rounded group, smaller, rather than loose pills. */
21
21
  grouped?: boolean;
22
+ /** Plain icons, the selected one brighter and underlined, as in VS Code. */
23
+ flat?: boolean;
22
24
  }): import("react").JSX.Element;
@@ -9,6 +9,8 @@ export interface LanguageOverride {
9
9
  export interface EditorSettings {
10
10
  fontSize: number;
11
11
  fontFamily: string;
12
+ /** "normal", "500", "600" or "bold", as VS Code's editor.fontWeight. */
13
+ fontWeight: string;
12
14
  lineHeight: number;
13
15
  letterSpacing: number;
14
16
  fontLigatures: boolean;
@@ -68,6 +70,10 @@ export interface EditorSettings {
68
70
  treeFollowActive: boolean;
69
71
  /** The folders above what is in view stay pinned at the top of the tree while it scrolls. */
70
72
  treeStickyScroll: boolean;
73
+ /** A file tree row's height in px: 22 is VS Code's, 28 Deck's roomier default. */
74
+ treeRowHeight: number;
75
+ /** The sidebar's view icons (Explorer, Search, …) in a rounded group; off, plain icons as in VS Code. */
76
+ sidebarPills: boolean;
71
77
  /** Per-language overrides, keyed by Monaco language id ("python", "typescript"). */
72
78
  languageOverrides: Record<string, LanguageOverride>;
73
79
  formatLineLength: number;
@@ -95,6 +101,10 @@ export interface EditorSettings {
95
101
  /** The git graph's commit list, in px. Its own setting rather than `fontSize`: that is a
96
102
  * monospace code font, and the size someone wants for code is not the one for a commit list. */
97
103
  graphFontSize: number;
104
+ /** The user's syntax colours: for "all" languages or one language's id, by kind (syntaxcolors.ts SYNTAX_KINDS), "#rrggbb". */
105
+ syntaxColors: Record<string, Record<string, string>>;
106
+ /** A language's control keywords, in place of its definition's list (keywordtokens.ts). */
107
+ controlKeywords: Record<string, string[]>;
98
108
  }
99
109
  /** The sizes the git graph offers — the Settings list and the Ctrl+wheel steps are the same. */
100
110
  export declare const GRAPH_FONT_SIZES: number[];
@@ -0,0 +1,28 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ type Groups = Record<string, string[]>;
3
+ type Monarch = {
4
+ tokenizer: Record<string, unknown[]>;
5
+ tokenPostfix?: string;
6
+ } & Record<string, unknown>;
7
+ /**
8
+ * The tokenizer with a case per group ahead of every keyword case ("@keywords", or a named list
9
+ * such as PHP's "@phpKeywords"), so a listed word takes its group's token and every other keyword
10
+ * stays as it was. Exported for the check.
11
+ */
12
+ export declare function retag(lang: Monarch, groups: Groups): Monarch;
13
+ /** Called when a language's tokenizer or its keyword split changes (the theme's rules follow them). */
14
+ export declare function onGrammarChange(f: () => void): void;
15
+ /** What a language's tokens end in (".ts", ".dart"; PHP's name them ".php" themselves). */
16
+ export declare function grammarSuffix(languageId: string): string | undefined;
17
+ /** A language's control keywords: the user's, else its definition's, else none. */
18
+ export declare function controlWords(languageId: string): {
19
+ words: string[];
20
+ own: boolean;
21
+ };
22
+ /** Whether a language's keywords are split, so its other keywords are "Declaration keywords". */
23
+ export declare const isSplit: (languageId: string) => boolean;
24
+ /** The languages with a tokenizer of Monaco's, which can have their keywords split. */
25
+ export declare const grammarLanguages: () => string[];
26
+ /** Note a language as its definition is registered, with its keywordTokens when it lists any. */
27
+ export declare function applyKeywordTokens(languageId: string, groups: unknown): Promise<void>;
28
+ export {};
@@ -1,5 +1,6 @@
1
1
  // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
2
  import { monaco } from "./monaco";
3
+ import "./syntaxcolors";
3
4
  /** How to launch the server — passed straight to Rust, which implements the strategies. */
4
5
  interface ServerSpec {
5
6
  /** "path" | "node-module" | "exe-search" — see resolve_server() in lsp.rs. */
@@ -0,0 +1,15 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ /**
3
+ * The root found for `path` by findRoot, for the calls after a document is open (a change, a
4
+ * close). Before findRoot has run for its folder, the workspace, as before.
5
+ */
6
+ export declare function rootForFile(path: string, workspace: string, marker: string): string;
7
+ /**
8
+ * Walk up from the file's folder to the nearest one holding `marker`, stopping at the workspace.
9
+ * A file outside the workspace (one opened from another folder) is walked up as far as it goes:
10
+ * the workspace says nothing about where its project is, and starting the server there gave a PHP
11
+ * file in another project a server that had never seen its classes.
12
+ */
13
+ export declare function findRoot(path: string, workspace: string, marker: string): Promise<string>;
14
+ /** Whether a server's root is the workspace or a project inside it. */
15
+ export declare const rootInside: (root: string, workspace: string) => boolean;
@@ -5,6 +5,12 @@ type TokenColor = {
5
5
  foreground?: string;
6
6
  fontStyle?: string;
7
7
  };
8
+ /** Set what the user's colours are (or, with none, just rebuild the theme with them). */
9
+ export declare function setUserTokenRules(fn?: () => TokenColor[]): void;
10
+ /** The token names the languages added colours for. */
11
+ export declare const extraTokenNames: () => string[];
12
+ /** The colour the theme or a language gives `token`, before the user's: "rrggbb", or undefined. */
13
+ export declare function tokenForeground(token: string): string | undefined;
8
14
  /**
9
15
  * Repaint the editor for a new background preset. Called by applyTheme().
10
16
  *
@@ -0,0 +1,17 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ import { monaco } from "./monaco";
3
+ export interface Legend {
4
+ tokenTypes: string[];
5
+ tokenModifiers: string[];
6
+ }
7
+ /** The indexes of the modifiers to keep: readonly and any a rule names after its first segment. */
8
+ export declare function keptModifiers(legend: Legend, ruleTokens: string[]): number[];
9
+ /** The legend Monaco is given: the server's types, the kept modifiers, then the language's id. */
10
+ export declare function scopedLegend(legend: Legend, languageId: string, keep: number[]): Legend;
11
+ /** The server's tokens with their modifiers renumbered to the kept ones and the language's bit set. */
12
+ export declare function scopedData(data: Uint32Array, keep: number[]): Uint32Array;
13
+ /** Register a language's semantic tokens with Monaco, tagged with the language. */
14
+ export declare function registerScopedSemanticTokens(languageId: string, legend: Legend, fetch: (model: monaco.editor.ITextModel) => Promise<{
15
+ data?: number[];
16
+ resultId?: string;
17
+ } | null>): void;
@@ -0,0 +1,18 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ /** All languages, in the settings' map: the defaults a language's own colours override. */
3
+ export declare const ALL = "all";
4
+ export interface SyntaxKind {
5
+ key: string;
6
+ label: string;
7
+ /** Grammar tokens (they take the language's suffix) and semantic ones (they take its id). */
8
+ grammar: string[];
9
+ semantic: string[];
10
+ }
11
+ export declare const SYNTAX_KINDS: SyntaxKind[];
12
+ /** The theme tokens a kind colours, for all languages or one. */
13
+ export declare function kindTokens(kind: SyntaxKind, lang: string): string[];
14
+ /** Where a kind's colour comes from, for a language or for all: "lang", "all" or "theme". */
15
+ export declare function colorOf(kind: SyntaxKind, lang: string): {
16
+ hex: string;
17
+ from: "lang" | "all" | "theme";
18
+ };