@dotdirfm/extension-api 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +10 -11
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -39,27 +39,27 @@ export interface ColorThemeData {
39
39
  export interface HostApi {
40
40
  readFile(path: string): Promise<ArrayBuffer>;
41
41
  readFileText(path: string): Promise<string>;
42
- readFileRange?(path: string, offset: number, length: number): Promise<ArrayBuffer>;
43
- statFile?(path: string): Promise<{
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?(callback: () => void): () => void;
47
+ onFileChange(callback: () => void): () => void;
48
48
  writeFile(path: string, content: string): Promise<void>;
49
+ setDirty?(dirty: boolean): void;
49
50
  getTheme(): Promise<string>;
50
- getColorTheme?(): ColorThemeData | null;
51
- onThemeChange?(callback: (theme: ColorThemeData) => void): () => void;
51
+ getColorTheme(): ColorThemeData | null;
52
+ onThemeChange(callback: (theme: ColorThemeData) => void): () => void;
52
53
  onClose(): void;
53
- executeCommand?<T = unknown>(command: string, args?: unknown): Promise<T>;
54
- registerCommand?(commandId: string, handler: (...args: unknown[]) => void | Promise<void>): () => void;
55
- registerKeybinding?(binding: {
54
+ executeCommand<T = unknown>(command: string, args?: unknown): Promise<T>;
55
+ registerCommand(commandId: string, handler: (...args: unknown[]) => void | Promise<void>): () => void;
56
+ registerKeybinding(binding: {
56
57
  command: string;
57
58
  key: string;
58
59
  mac?: string;
59
60
  when?: string;
60
61
  }): () => void;
61
- getOnigurumaWasm?(): Promise<ArrayBuffer>;
62
- getExtensionResourceUrl?(relativePath: string): Promise<string>;
62
+ getExtensionResourceUrl(relativePath: string): Promise<string>;
63
63
  }
64
64
  export interface ViewerExtensionApi {
65
65
  mount(root: HTMLElement, props: ViewerProps): Promise<void>;
@@ -116,4 +116,3 @@ declare global {
116
116
  }
117
117
  var dotdir: DotDirGlobalApi;
118
118
  }
119
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotdirfm/extension-api",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Shared host and extension API types for DotDir viewer/editor/fs provider extensions.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",