1
0
silverbullet/plugbox/types.ts

24 lines
459 B
TypeScript
Raw Normal View History

2022-03-23 14:41:12 +00:00
import { System } from "./system";
export interface Manifest<HookT> {
2022-03-25 11:03:06 +00:00
requiredPermissions?: string[];
hooks: HookT;
functions: {
[key: string]: FunctionDef;
};
}
export interface FunctionDef {
path?: string;
code?: string;
2022-03-23 14:41:12 +00:00
env?: RuntimeEnvironment;
}
2022-03-23 14:41:12 +00:00
export type RuntimeEnvironment = "client" | "server";
export interface Feature<HookT> {
validateManifest(manifest: Manifest<HookT>): string[];
2022-03-21 14:21:34 +00:00
2022-03-23 14:41:12 +00:00
apply(system: System<HookT>): void;
}