import type { CapabilityEntry, FileEntry, FileMetadata, MovePathOptions, OpenResourceRequest, OpenResourceResult, PluginSettings, TrashResult, WriteTextOptions } from './types'; export type PluginCommandArgs = Record; export type PluginCommandHandler = (args: PluginCommandArgs, declaration: PluginCommandDeclaration) => unknown | Promise; export type Unsubscribe = () => void; export interface PluginCommandDeclaration { status: 'declared'; pluginId: string; commandId: string; handler?: string; args?: PluginCommandArgs; } export interface PluginCommandResult { status: 'handled'; pluginId: string; commandId: string; result: unknown; } export interface PluginEvent> { name: string; pluginId: string; payload: TPayload; timestamp: string; } export interface VerstakPluginAPI { readonly pluginId: string; settings: { read(): Promise; read(key: string): Promise; write(key: string, value: unknown): Promise; writeAll(settings: PluginSettings): Promise; }; capabilities: { has(capability: string): Promise; get(capability: string): Promise<{ available: boolean; name?: string; pluginId?: string; status?: string; }>; list(): Promise; }; commands: { register(commandId: string, handler: PluginCommandHandler): Promise; execute(commandId: string, args?: PluginCommandArgs): Promise; }; events: { publish(eventName: string, payload?: Record): Promise; subscribe>(eventName: string, handler: (event: PluginEvent) => void): Promise; }; files: { /** * Files API uses canonical vault-relative slash paths. Backslashes, * Windows/UNC absolute paths, traversal, null bytes, `.verstak` variants, * and symlink read/write/move/trash operations are rejected by the host. */ list(relativeDir?: string): Promise; metadata(relativePath: string): Promise; readText(relativePath: string): Promise; writeText(relativePath: string, content: string, options?: WriteTextOptions): Promise; createFolder(relativePath: string): Promise; move(fromRelativePath: string, toRelativePath: string, options?: MovePathOptions): Promise; trash(relativePath: string): Promise; }; workbench: { openResource(request: OpenResourceRequest): Promise; editResource(request: OpenResourceRequest): Promise; }; dispose?: () => void; } export declare function createPluginAPI(_pluginId: string): VerstakPluginAPI; //# sourceMappingURL=plugin-api.d.ts.map