deck-plugin-sdk 0.22.0 → 1.1.0

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.
@@ -0,0 +1,16 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ export interface EditorStatus {
3
+ line: number;
4
+ col: number;
5
+ errors: number;
6
+ warnings: number;
7
+ /** Blame for the cursor's line, for the status bar. null when unknown or uncommitted. */
8
+ blame?: {
9
+ hash: string;
10
+ author: string;
11
+ summary: string;
12
+ } | null;
13
+ }
14
+ export declare let editorStatus: EditorStatus;
15
+ export declare function setEditorStatus(patch: Partial<EditorStatus>): void;
16
+ export declare function useEditorStatus(): EditorStatus;
@@ -0,0 +1,8 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ import { monaco } from "../../core/monaco";
3
+ export declare const viewStates: Map<string, monaco.editor.ICodeEditorViewState | null>;
4
+ export declare function fileUri(path: string): monaco.Uri;
5
+ export declare function getFileModel(path: string, initial: string): monaco.editor.ITextModel;
6
+ export declare function setModelValue(path: string, value: string): void;
7
+ export declare function disposeModel(path: string | undefined): void;
8
+ export declare function remapModel(oldPath: string, newPath: string): void;
@@ -0,0 +1,59 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ import type { GitStatusRow } from "../../core/bridge";
3
+ /** Last path segment, trailing separators ignored. */
4
+ export declare const baseName: (p: string) => string;
5
+ /** Windows paths use both separators; normalize to "/" for comparison and display. */
6
+ export declare const normPath: (p: string) => string;
7
+ /** The folder a path is in. */
8
+ export declare const dirName: (p: string) => string;
9
+ /** A repo as a picker names it: its path under `root`, or its own name when it is not under it. */
10
+ export declare function repoLabel(root: string, repo: string): string;
11
+ export interface ChangeDir<T> {
12
+ kind: "dir";
13
+ name: string;
14
+ children: TreeNodeOf<T>[];
15
+ }
16
+ export interface ChangeFile<T> {
17
+ kind: "file";
18
+ row: T;
19
+ name: string;
20
+ }
21
+ export type TreeNodeOf<T> = ChangeDir<T> | ChangeFile<T>;
22
+ export type ChangeTreeNode = TreeNodeOf<GitStatusRow>;
23
+ /**
24
+ * Whether two git-status lists are the same, field by field.
25
+ *
26
+ * The poll returns a fresh array every few seconds, and a new reference re-renders the whole
27
+ * Changes list even when nothing changed. Order is part of the comparison: git reports a stable
28
+ * order, so a positional walk is enough and sorting first would cost more than the render.
29
+ */
30
+ export declare function sameRows(a: readonly {
31
+ path: string;
32
+ rel: string;
33
+ letter: string;
34
+ staged: boolean;
35
+ }[], b: readonly {
36
+ path: string;
37
+ rel: string;
38
+ letter: string;
39
+ staged: boolean;
40
+ }[]): boolean;
41
+ /**
42
+ * Group rows into a folder tree by their `rel` path.
43
+ *
44
+ * Generic in the leaf payload so the Commit panel builds the same tree from a commit's files
45
+ * (CommitFile) that Source Control builds from working-tree changes (GitStatusRow) — the shape
46
+ * and the single-child compression are identical, only the row type differs.
47
+ */
48
+ export declare function buildChangeTree<T extends {
49
+ rel: string;
50
+ }>(rows: T[]): TreeNodeOf<T>[];
51
+ export interface DirtyRange {
52
+ start: number;
53
+ end: number;
54
+ type: "added" | "modified" | "deleted";
55
+ }
56
+ export declare function statusColor(letter: string): string;
57
+ /** Flatten a tree node to the file rows underneath it (a file node is just itself). */
58
+ export declare function collectFiles(node: ChangeTreeNode): GitStatusRow[];
59
+ export declare function parseDirty(diff: string): DirtyRange[];
@@ -0,0 +1,41 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ export declare function mediaKind(path: string): "image" | "video" | "audio" | "font" | null;
3
+ export declare function MediaViewer({ path, src: srcOverride }: {
4
+ path: string;
5
+ src?: string;
6
+ }): import("react").JSX.Element;
7
+ /**
8
+ * A media file's two versions, side by side: the committed one and the one on disk.
9
+ *
10
+ * Each side is a full MediaViewer, so an image still zooms and pans and a font still shows its
11
+ * specimen. A side with no bytes — the file was added, or deleted — says so rather than rendering
12
+ * a broken image, which is the difference between "no old version" and "it failed to load".
13
+ */
14
+ export declare function MediaDiff({ path, oldBytes, newBytes, gone, oldLabel, newLabel }: {
15
+ path: string;
16
+ /** The committed bytes, or null when the file is not in that revision. */
17
+ oldBytes: Uint8Array | null;
18
+ /** The new side's bytes, when it is a revision too (a commit's diff) rather than the file on
19
+ * disk. Empty: the file is not in that revision. Omitted: read the file at `path`. */
20
+ newBytes?: Uint8Array;
21
+ /** The working file was deleted — there is nothing on disk to show on the new side. */
22
+ gone: boolean;
23
+ oldLabel: string;
24
+ newLabel: string;
25
+ }): import("react").JSX.Element;
26
+ export declare function FontViewer({ src, name }: {
27
+ src: string;
28
+ name: string;
29
+ }): import("react").JSX.Element;
30
+ export declare function ImageViewer({ src, alt, bg }: {
31
+ src: string;
32
+ alt: string;
33
+ bg: string;
34
+ }): import("react").JSX.Element;
35
+ export declare const MarkdownPreview: import("react").NamedExoticComponent<{
36
+ text: string;
37
+ }>;
38
+ export declare function MonacoViewer({ content, language }: {
39
+ content: string;
40
+ language: string;
41
+ }): import("react").JSX.Element;