(input: {
api: HostPluginApi
config: TuiConfig.Resolved & TuiConfig.HostMetadata
runtime?: PluginRuntime
dispose?: () => void
disposeTimeoutMs?: number
})
| 986 | let runtime: RuntimeState | undefined |
| 987 | |
| 988 | export async function init(input: { |
| 989 | api: HostPluginApi |
| 990 | config: TuiConfig.Resolved & TuiConfig.HostMetadata |
| 991 | runtime?: PluginRuntime |
| 992 | dispose?: () => void |
| 993 | disposeTimeoutMs?: number |
| 994 | }) { |
| 995 | const cwd = process.cwd() |
| 996 | if (loaded) { |
| 997 | if (dir !== cwd) { |
| 998 | throw new Error(`TuiPluginRuntime.init() called with a different working directory. expected=${dir} got=${cwd}`) |
| 999 | } |
| 1000 | return loaded |
| 1001 | } |
| 1002 | |
| 1003 | dir = cwd |
| 1004 | loaded = load({ ...input, runtime: input.runtime ?? createPluginRuntime() }) |
| 1005 | return loaded |
| 1006 | } |
| 1007 | |
| 1008 | export function list() { |
| 1009 | if (!runtime) return [] |
nothing calls this directly
no test coverage detected