Plugins

Covers Engine Plugin SDK 2.0.0 · Interface Plugin SDK 0.2.0

InterfacePluginHostApi

Host services and shared component inventory supplied to a loaded interface plugin.

Import

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

Declaration

export interface InterfacePluginHostApi {
    /** Read a UTF-8 file relative to an installed Interface plugin. Use assets/relative for bundled data, or createInterfacePluginAssetClient for validated asset-only reads. Missing/escaping files reject; updates replace bundled content. */
    readPluginFile(pluginId: string, relativePath: string): Promise<string>;
    /** Optional local notification/issue services. Older hosts may not expose this capability. */
    notifications?: {createClient(source: string): import("../notifications/index.ts").LocalNotificationClient};
    React: Record<string, unknown>;
    useDartwic: (...args: unknown[]) => unknown;
    components: Record<string, unknown>;
    helpers: Record<string, unknown>;
    hooks: Record<string, (...args: any[]) => any>;
    sdk: {
        styling: {
            cn: (...inputs: unknown[]) => string;
        };
        hooks: Record<string, (...args: any[]) => any>;
    };
}

Members

NameTypeRequirementDescription
readPluginFilePromise<string>RequiredRead a UTF-8 file relative to an installed Interface plugin. Use assets/relative for bundled data, or createInterfacePluginAssetClient for validated asset-only reads. Missing/escaping files reject; updates replace bundled content.
notifications{createClient(source: string): import("../notifications/index.ts").LocalNotificationClient}OptionalOptional local notification/issue services. Older hosts may not expose this capability.
ReactRecord<string, unknown>Required
useDartwic(...args: unknown[]) => unknownRequired
componentsRecord<string, unknown>Required
helpersRecord<string, unknown>Required
hooksRecord<string, (...args: any[]) => any>Required
sdk`{

styling: {

cn: (…inputs: unknown[]) => string;

};

hooks: Record<string, (…args: any[]) => any>;

}`
Required