@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.
Files changed (2) hide show
  1. package/dist/index.d.ts +9 -11
  2. 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?(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
49
  getTheme(): Promise<string>;
50
- getColorTheme?(): ColorThemeData | null;
51
- onThemeChange?(callback: (theme: ColorThemeData) => void): () => void;
50
+ getColorTheme(): ColorThemeData | null;
51
+ onThemeChange(callback: (theme: ColorThemeData) => void): () => void;
52
52
  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: {
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
- getOnigurumaWasm?(): Promise<ArrayBuffer>;
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 {};
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.1",
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",