deck-plugin-sdk 1.6.0 → 1.6.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 +1 -1
- package/template/plugin.json +1 -1
- package/types/core/bridge.d.ts +5 -0
- package/types/core/fileview.d.ts +22 -3
package/package.json
CHANGED
package/template/plugin.json
CHANGED
package/types/core/bridge.d.ts
CHANGED
|
@@ -357,6 +357,11 @@ export interface Settings {
|
|
|
357
357
|
browserDefaultAsk?: boolean;
|
|
358
358
|
/** Sites (by host) an agent may use in the browser without asking; localhost and files always. */
|
|
359
359
|
browserAgentSites: string[];
|
|
360
|
+
/**
|
|
361
|
+
* Where a file type opens, by extension (".pdf"): "editor", "browser" or "plugin:<id>". A type
|
|
362
|
+
* not listed is Automatic (see `openerFor` in fileview.ts).
|
|
363
|
+
*/
|
|
364
|
+
openWith?: Record<string, string>;
|
|
360
365
|
}
|
|
361
366
|
/** The bookmarks bar setting, older true/false values included. */
|
|
362
367
|
export declare const bookmarksBarMode: (s: Settings) => "always" | "home" | "never";
|
package/types/core/fileview.d.ts
CHANGED
|
@@ -29,7 +29,26 @@ export declare const fileOpeners: {
|
|
|
29
29
|
/** The id of the plugin that opens `path` (by its extension), or undefined: the Editor's. */
|
|
30
30
|
export declare function pluginForFile(path: string): string | undefined;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
* so
|
|
32
|
+
* The files Deck's browser opens: the types defaultbrowser.rs registers with Windows (FILE_TYPES
|
|
33
|
+
* there), so a choice offered here is one Windows can hand over too.
|
|
34
34
|
*/
|
|
35
|
-
export declare
|
|
35
|
+
export declare const BROWSER_TYPES: string[];
|
|
36
|
+
/** Where a file opens: the Editor, a browser tab, or a plugin's pane (`plugin:<id>`). */
|
|
37
|
+
export type Opener = "editor" | "browser" | `plugin:${string}`;
|
|
38
|
+
/** The user's choice per extension (Settings, `openWith`); a type with none is Automatic. */
|
|
39
|
+
export declare const openPrefs: {
|
|
40
|
+
current: Record<string, string>;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Where `path` opens. The user's choice for its type wins, where it still can (the plugin is
|
|
44
|
+
* loaded, the file is local for a browser tab); otherwise Automatic: `hint`, how it was opened
|
|
45
|
+
* (a page Windows handed Deck as the browser), then the plugin that claims the type, then the Editor.
|
|
46
|
+
*/
|
|
47
|
+
export declare function openerFor(path: string, hint?: Opener, prefs?: Record<string, string>): Opener;
|
|
48
|
+
/** `C:\a b\x.html` as file:///C:/a%20b/x.html, for a browser tab. */
|
|
49
|
+
export declare const fileUrl: (path: string) => string;
|
|
50
|
+
/**
|
|
51
|
+
* Open `path` where its type opens (`openerFor`), as a tab of its own. False when that is the
|
|
52
|
+
* Editor, which the caller opens it in. Every way Deck opens a file asks this first.
|
|
53
|
+
*/
|
|
54
|
+
export declare function openByType(path: string, hint?: Opener): boolean;
|