Release RuneStone 0.1.4 with installable plugins and settings
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import type { Contributions } from "./contracts.ts";
|
||||
/** Package API v1. Compiled plugins export activate(api). */
|
||||
export type Dispose = () => void | Promise<void>;
|
||||
export interface PluginCommand { id: string; title: string; run: () => void | Promise<void> }
|
||||
export interface PluginView { id: string; title: string; mount: (container: HTMLElement) => void | Dispose | Promise<void | Dispose> }
|
||||
export interface PluginApi {
|
||||
readonly id: string;
|
||||
readonly signal: AbortSignal;
|
||||
contribute<K extends keyof Contributions>(key: K, value: Contributions[K]): void;
|
||||
registerCommand(command: PluginCommand): void;
|
||||
registerView(view: PluginView): void;
|
||||
openView(id: string): void;
|
||||
onDispose(cleanup: Dispose): void;
|
||||
workspace: {
|
||||
list(path?: string): Promise<{ name: string; rel_path: string; kind: string }[]>;
|
||||
read(path: string): Promise<string>;
|
||||
write(path: string, contents: string, expected: string): Promise<void>;
|
||||
};
|
||||
settings: { read(): Promise<unknown>; write(value: unknown): Promise<void> };
|
||||
assets: { read(path: string): Promise<Uint8Array> };
|
||||
}
|
||||
export interface PluginModule { activate(api: PluginApi): void | Dispose | Promise<void | Dispose> }
|
||||
export interface ExternalManifest {
|
||||
schemaVersion: 1; id: string; name: string; author: string; description: string;
|
||||
version: string; apiVersion: 1; entry: string; access: "full-app";
|
||||
}
|
||||
export interface InstalledPlugin { manifest: ExternalManifest; hash: string; enabled: boolean; path: string; error: string | null; removal: boolean }
|
||||
export interface PluginSnapshot { root: string; plugins: InstalledPlugin[] }
|
||||
export interface Candidate { token: string; source: string; manifest: ExternalManifest | null; error: string | null }
|
||||
export interface RemovalPlan { token: string; plugin: InstalledPlugin }
|
||||
Reference in New Issue
Block a user