Lynx

genui / openui / OpenUIContextValue

OpenUIContextValue

Runtime context shared by OpenUI renderers, hooks, actions, and form fields.

属性

evaluationContext

evaluationContext: EvaluationContext;

AST evaluation context used by runtime expression evaluation.

定义于

@lynx-js/genui/openui/src/core/context.tsx:78


getFieldValue()

getFieldValue: (formName: undefined | string, name: string) => any;

Get a field value. Top-level for $bindings, nested under formName for form fields.

参数

范围类型
formNameundefined | string
namestring

返回

any

定义于

@lynx-js/genui/openui/src/core/context.tsx:53


isQueryLoading

isQueryLoading: boolean;

Whether any Query is currently fetching data.

定义于

@lynx-js/genui/openui/src/core/context.tsx:49


isStreaming

isStreaming: boolean;

Whether the LLM is currently streaming content.

定义于

@lynx-js/genui/openui/src/core/context.tsx:46


library

library: Library;

The active component library (schema + renderers).

定义于

@lynx-js/genui/openui/src/core/context.tsx:20


renderNode()

renderNode: (value: unknown) => ReactNode;

Render any value (element, array, primitive) into React nodes.

参数

范围类型
valueunknown

返回

ReactNode

定义于

@lynx-js/genui/openui/src/core/context.tsx:25


reportError()?

optional reportError: (error: OpenUIError) => void;

Report a structured error (used internally by error boundary).

参数

范围类型
errorOpenUIError

返回

void

定义于

@lynx-js/genui/openui/src/core/context.tsx:81


setFieldValue()

setFieldValue: (formName: undefined | string, componentType: undefined | string, name: string, value: unknown, shouldTriggerSaveCallback?: boolean) => void;

Set a form field value.

参数

范围类型描述
formNameundefined | stringThe form's name prop.
componentTypeundefined | stringThe component type (e.g. "Input", "Select").
namestringThe field's name prop.
valueunknownThe new value.
shouldTriggerSaveCallback?booleanWhen true, persists state via onStateUpdate. Text inputs should pass false on change and true on blur. Discrete inputs (Select, RadioGroup, etc.) should always pass true.

返回

void

定义于

@lynx-js/genui/openui/src/core/context.tsx:66


store

store: Store;

Reactive binding store for $variables and form data.

定义于

@lynx-js/genui/openui/src/core/context.tsx:75


triggerAction()

triggerAction: (userMessage: string, formName?: string, action?: any) => void | Promise<void>;

Trigger an action. Accepts either:

  • ActionPlan (v0.5): runs steps sequentially (Run, Set, ToAssistant, OpenUrl)
  • Legacy action config (v0.1): object with optional type and params.
  • Nothing: fires ContinueConversation with the label

参数

范围类型
userMessagestring
formName?string
action?any

返回

void | Promise<void>

定义于

@lynx-js/genui/openui/src/core/context.tsx:33

除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。