API Reference
Resources
Button
A button can be used to perform an action.
Initializers
bring ui;
new ui.Button(label: str, handler: IButtonHandler);
Name | Type | Description |
---|---|---|
label | str | No description. |
handler | IButtonHandler | No description. |
label
Required
- Type: str
handler
Required
- Type: IButtonHandler
Static Functions
Name | Description |
---|---|
isVisualComponent | Returns whether the given construct is a visual component. |
isVisualComponent
bring ui;
ui.Button.isVisualComponent(c: IConstruct);
Returns whether the given construct is a visual component.
c
Required
- Type: constructs.IConstruct
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
Field
A field can be used to display a value.
Initializers
bring ui;
new ui.Field(label: str, handler: IFieldHandler, props?: FieldProps);
Name | Type | Description |
---|---|---|
label | str | No description. |
handler | IFieldHandler | No description. |
props | FieldProps | No description. |
label
Required
- Type: str
handler
Required
- Type: IFieldHandler
props
Optional
- Type: FieldProps
Static Functions
Name | Description |
---|---|
isVisualComponent | Returns whether the given construct is a visual component. |
isVisualComponent
bring ui;
ui.Field.isVisualComponent(c: IConstruct);
Returns whether the given construct is a visual component.
c
Required
- Type: constructs.IConstruct
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
Section
A section can be used to group other visual components.
Initializers
bring ui;
new ui.Section(props?: SectionProps);
Name | Type | Description |
---|---|---|
props | SectionProps | No description. |
props
Optional
- Type: SectionProps
Methods
Name | Description |
---|---|
add | Adds a visual component to the section. |
addButton | Adds a button to the section. |
addField | Adds a field to the section. |
add
add(...components: Array<VisualComponent>): void
Adds a visual component to the section.
The components will be rendered in the order they were added.
components
Required
- Type: VisualComponent
addButton
addButton(label: str, handler: IButtonHandler): void
Adds a button to the section.
Shorthand for add(new ui.Button(...))
.
label
Required
- Type: str
handler
Required
- Type: IButtonHandler
addField
addField(label: str, handler: IFieldHandler, props?: FieldProps): void
Adds a field to the section.
Shorthand for add(new ui.Field(...))
.
label
Required
- Type: str
handler
Required
- Type: IFieldHandler
props
Optional
- Type: FieldProps
Static Functions
Name | Description |
---|---|
isVisualComponent | Returns whether the given construct is a visual component. |
isVisualComponent
bring ui;
ui.Section.isVisualComponent(c: IConstruct);
Returns whether the given construct is a visual component.
c
Required
- Type: constructs.IConstruct
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
VisualComponent
A visual component is used to customize the view of other classes in the Wing Console.
This is a base class for all other visual components.
Initializers
bring ui;
new ui.VisualComponent();
Name | Type | Description |
---|
Static Functions
Name | Description |
---|---|
isVisualComponent | Returns whether the given construct is a visual component. |
isVisualComponent
bring ui;
ui.VisualComponent.isVisualComponent(c: IConstruct);
Returns whether the given construct is a visual component.
c
Required
- Type: constructs.IConstruct
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
Structs
FieldProps
Props for Field
.
Initializer
bring ui;
let FieldProps = ui.FieldProps{ ... };
Properties
Name | Type | Description |
---|---|---|
refreshRate | duration | How often the field should be refreshed. |
refreshRate
Optional
refreshRate: duration;
- Type: duration
- Default: no automatic refresh
How often the field should be refreshed.
SectionProps
Props for Section
.
Initializer
bring ui;
let SectionProps = ui.SectionProps{ ... };
Properties
Name | Type | Description |
---|---|---|
label | str | The label of the section. |
label
Optional
label: str;
- Type: str
- Default: no label
The label of the section.
Protocols
IButtonHandler
Extends: IResource
Implemented By: IButtonHandler
Inflight client: @winglang/sdk.ui.IButtonHandlerClient
A resource with an inflight "handle" method that can be passed to Button
.
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
IButtonHandlerClient
- Implemented By: IButtonHandlerClient
Inflight client for IButtonHandler
.
Methods
Name | Description |
---|---|
handle | Function that peforms an action. |
handle
inflight handle(): void
Function that peforms an action.
IFieldHandler
Extends: IResource
Implemented By: IFieldHandler
Inflight client: @winglang/sdk.ui.IFieldHandlerClient
A resource with an inflight "handle" method that can be passed to addField
.
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
IFieldHandlerClient
- Implemented By: IFieldHandlerClient
Inflight client for IFieldHandler
.
Methods
Name | Description |
---|---|
handle | Function that returns a string to display. |
handle
inflight handle(): str
Function that returns a string to display.