feat(tui): add plugin route api
This commit is contained in:
parent
de86d73d19
commit
ec07ee56f4
1 changed files with 18 additions and 1 deletions
|
|
@ -19,6 +19,7 @@ import type {
|
||||||
ShellInfo,
|
ShellInfo,
|
||||||
SkillInfo,
|
SkillInfo,
|
||||||
} from "@opencode-ai/client"
|
} from "@opencode-ai/client"
|
||||||
|
import type { JSX } from "@opentui/solid"
|
||||||
|
|
||||||
interface LocationCollection<Value> {
|
interface LocationCollection<Value> {
|
||||||
list(location?: LocationRef): Value[] | undefined
|
list(location?: LocationRef): Value[] | undefined
|
||||||
|
|
@ -85,7 +86,23 @@ export interface Data {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UI {}
|
export interface RouteDefinition {
|
||||||
|
readonly name: string
|
||||||
|
readonly render: (input: { readonly params: any }) => JSX.Element
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Route {
|
||||||
|
register(definition: RouteDefinition): () => void
|
||||||
|
navigate(input: { readonly name: string; readonly params?: any }): void
|
||||||
|
current(): {
|
||||||
|
readonly name: string
|
||||||
|
readonly params: any
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UI {
|
||||||
|
readonly route: Route
|
||||||
|
}
|
||||||
|
|
||||||
export interface Context {
|
export interface Context {
|
||||||
readonly options: Record<string, any>
|
readonly options: Record<string, any>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue