Plugins

Covers Engine Plugin SDK 2.0.0 · Interface Plugin SDK 0.2.0

WorkspaceAssetClient

Shared authored UTF-8/JSON file operations. Stored paths are workspace-relative assets/... references.

Import

import type { WorkspaceAssetClient } from "@dartwic/interface-sdk/assets";

Declaration

export interface WorkspaceAssetClient {
    /** Read a portable reference; missing or unauthorized files reject. */
    readText(path: string): Promise<string>;
    /** Read and parse JSON without runtime schema validation. */
    readJson<T = unknown>(path: string): Promise<T>;
    /** Save namespace/file atomically and return its portable reference. */
    saveText(namespace: string, name: string, content: string): Promise<string>;
    /** Serialize JSON, save it and return its portable reference. */
    saveJson(namespace: string, name: string, value: unknown): Promise<string>;
    /** Evict a cached reference after an external change. */
    invalidate(path: string): void;
}

Members

NameTypeRequirementDescription
readTextPromise<string>RequiredRead a portable reference; missing or unauthorized files reject.
readJsonPromise<T>RequiredRead and parse JSON without runtime schema validation.
saveTextPromise<string>RequiredSave namespace/file atomically and return its portable reference.
saveJsonPromise<string>RequiredSerialize JSON, save it and return its portable reference.
invalidatevoidRequiredEvict a cached reference after an external change.