File size: 362 Bytes
0dbc9de
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import type { PluginContext } from "./context.js"

export interface Plugin {
  readonly id: string
  readonly setup: (context: PluginContext) => Promise<void> | void
}

export function define(plugin: Plugin) {
  return plugin
}

export interface PluginDomain {
  readonly add: (plugin: Plugin) => Promise<void>
  readonly remove: (id: string) => Promise<void>
}