Skip to main content

API Reference

Resources

Button

A button can be used to perform an action.

Initializers

bring ui;

new ui.Button(label: str, handler: IButtonHandler);
NameTypeDescription
labelstrNo description.
handlerIButtonHandlerNo description.

labelRequired
  • Type: str

handlerRequired

Static Functions

NameDescription
isVisualComponentReturns 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.

cRequired
  • Type: constructs.IConstruct

Properties

NameTypeDescription
nodeconstructs.NodeThe tree node.

nodeRequired
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);
NameTypeDescription
labelstrNo description.
handlerIFieldHandlerNo description.
propsFieldPropsNo description.

labelRequired
  • Type: str

handlerRequired

propsOptional

Static Functions

NameDescription
isVisualComponentReturns 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.

cRequired
  • Type: constructs.IConstruct

Properties

NameTypeDescription
nodeconstructs.NodeThe tree node.

nodeRequired
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);
NameTypeDescription
propsSectionPropsNo description.

propsOptional

Methods

NameDescription
addAdds a visual component to the section.
addButtonAdds a button to the section.
addFieldAdds 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.

componentsRequired

addButton
addButton(label: str, handler: IButtonHandler): void

Adds a button to the section.

Shorthand for add(new ui.Button(...)).

labelRequired
  • Type: str

handlerRequired

addField
addField(label: str, handler: IFieldHandler, props?: FieldProps): void

Adds a field to the section.

Shorthand for add(new ui.Field(...)).

labelRequired
  • Type: str

handlerRequired

propsOptional

Static Functions

NameDescription
isVisualComponentReturns 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.

cRequired
  • Type: constructs.IConstruct

Properties

NameTypeDescription
nodeconstructs.NodeThe tree node.

nodeRequired
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();
NameTypeDescription

Static Functions

NameDescription
isVisualComponentReturns 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.

cRequired
  • Type: constructs.IConstruct

Properties

NameTypeDescription
nodeconstructs.NodeThe tree node.

nodeRequired
node: Node;
  • Type: constructs.Node

The tree node.


Structs

FieldProps

Props for Field.

Initializer

bring ui;

let FieldProps = ui.FieldProps{ ... };

Properties

NameTypeDescription
refreshRatedurationHow often the field should be refreshed.

refreshRateOptional
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

NameTypeDescription
labelstrThe label of the section.

labelOptional
label: str;
  • Type: str
  • Default: no label

The label of the section.


Protocols

IButtonHandler

Inflight client: @winglang/sdk.ui.IButtonHandlerClient

A resource with an inflight "handle" method that can be passed to Button.

Properties

NameTypeDescription
nodeconstructs.NodeThe tree node.

nodeRequired
node: Node;
  • Type: constructs.Node

The tree node.


IButtonHandlerClient

Inflight client for IButtonHandler.

Methods

NameDescription
handleFunction that peforms an action.

handle
inflight handle(): void

Function that peforms an action.

IFieldHandler

Inflight client: @winglang/sdk.ui.IFieldHandlerClient

A resource with an inflight "handle" method that can be passed to addField.

Properties

NameTypeDescription
nodeconstructs.NodeThe tree node.

nodeRequired
node: Node;
  • Type: constructs.Node

The tree node.


IFieldHandlerClient

Inflight client for IFieldHandler.

Methods

NameDescription
handleFunction that returns a string to display.

handle
inflight handle(): str

Function that returns a string to display.