mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-28 19:14:53 +00:00
12 lines
481 B
TypeScript
12 lines
481 B
TypeScript
import type { Renderable } from "@opentui/core"
|
|
import type { SimulationProtocol } from "@opencode/simulation/protocol"
|
|
|
|
type Definition = Omit<SimulationProtocol.Frontend.SemanticNode, "id" | "element" | "parent">
|
|
|
|
const key = Symbol.for("opencode.simulation.semantics")
|
|
|
|
const bind = (definition: () => Definition) => (renderable: Renderable) => {
|
|
Object.defineProperty(renderable, key, { value: definition, configurable: true })
|
|
}
|
|
|
|
export const SimulationSemantics = { bind }
|