jsketcher/web/app/cad/attributes/attributesPlugin.ts
2022-06-25 15:19:48 -07:00

32 lines
769 B
TypeScript

import {Plugin} from "plugable/pluginSystem";
import {AttributesService} from "cad/attributes/attributesService";
interface AttributesPluginInputContext {
}
export interface AttributesPluginContext {
attributesService: AttributesService;
}
type AttributesPluginWorkingContext = AttributesPluginInputContext&AttributesPluginContext;
declare module 'context' {
interface ApplicationContext extends AttributesPluginContext {}
}
export const AttributesPlugin: Plugin<AttributesPluginInputContext, AttributesPluginContext, AttributesPluginWorkingContext> = {
inputContextSpec: {
},
outputContextSpec: {
attributesService: 'required',
},
activate(ctx: AttributesPluginWorkingContext) {
ctx.attributesService = new AttributesService();
},
}