feat(plugin): add v2 tui entrypoint
This commit is contained in:
@@ -105,7 +105,7 @@ export interface UI {
|
||||
}
|
||||
|
||||
export interface Context {
|
||||
readonly options: Record<string, any>
|
||||
readonly options: Readonly<Record<string, unknown>>
|
||||
readonly client: OpenCodeClient
|
||||
readonly data: Data
|
||||
readonly ui: UI
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export * as Plugin from "./plugin.js"
|
||||
@@ -0,0 +1,14 @@
|
||||
import type { Context } from "./context.js"
|
||||
|
||||
export type { Context }
|
||||
|
||||
export type Cleanup = () => Promise<void> | void
|
||||
|
||||
export interface Definition {
|
||||
readonly id: string
|
||||
readonly setup: (context: Context) => Promise<Cleanup | void> | Cleanup | void
|
||||
}
|
||||
|
||||
export function define(plugin: Definition) {
|
||||
return plugin
|
||||
}
|
||||
Reference in New Issue
Block a user