@dotdirfm/extension-api 0.1.0 → 0.1.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/dist/index.d.ts +9 -11
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -39,27 +39,26 @@ export interface ColorThemeData {
|
|
|
39
39
|
export interface HostApi {
|
|
40
40
|
readFile(path: string): Promise<ArrayBuffer>;
|
|
41
41
|
readFileText(path: string): Promise<string>;
|
|
42
|
-
readFileRange
|
|
43
|
-
statFile
|
|
42
|
+
readFileRange(path: string, offset: number, length: number): Promise<ArrayBuffer>;
|
|
43
|
+
statFile(path: string): Promise<{
|
|
44
44
|
size: number;
|
|
45
45
|
mtimeMs: number;
|
|
46
46
|
}>;
|
|
47
|
-
onFileChange
|
|
47
|
+
onFileChange(callback: () => void): () => void;
|
|
48
48
|
writeFile(path: string, content: string): Promise<void>;
|
|
49
49
|
getTheme(): Promise<string>;
|
|
50
|
-
getColorTheme
|
|
51
|
-
onThemeChange
|
|
50
|
+
getColorTheme(): ColorThemeData | null;
|
|
51
|
+
onThemeChange(callback: (theme: ColorThemeData) => void): () => void;
|
|
52
52
|
onClose(): void;
|
|
53
|
-
executeCommand
|
|
54
|
-
registerCommand
|
|
55
|
-
registerKeybinding
|
|
53
|
+
executeCommand<T = unknown>(command: string, args?: unknown): Promise<T>;
|
|
54
|
+
registerCommand(commandId: string, handler: (...args: unknown[]) => void | Promise<void>): () => void;
|
|
55
|
+
registerKeybinding(binding: {
|
|
56
56
|
command: string;
|
|
57
57
|
key: string;
|
|
58
58
|
mac?: string;
|
|
59
59
|
when?: string;
|
|
60
60
|
}): () => void;
|
|
61
|
-
|
|
62
|
-
getExtensionResourceUrl?(relativePath: string): Promise<string>;
|
|
61
|
+
getExtensionResourceUrl(relativePath: string): Promise<string>;
|
|
63
62
|
}
|
|
64
63
|
export interface ViewerExtensionApi {
|
|
65
64
|
mount(root: HTMLElement, props: ViewerProps): Promise<void>;
|
|
@@ -116,4 +115,3 @@ declare global {
|
|
|
116
115
|
}
|
|
117
116
|
var dotdir: DotDirGlobalApi;
|
|
118
117
|
}
|
|
119
|
-
export {};
|