Class: VarTypeChange
Defined in: packages/blockly/core/events/events_var_type_change.ts:26
Notifies listeners that a variable's type has changed.
Extends
Properties index
| Property | Description |
|---|---|
| workspaceId | The workspace identifier for this event. |
| group | An ID for the group of events this block is associated with. |
| recordUndo | Whether this event is undoable or not. |
| isUiEvent | Whether or not the event is a UI event. |
| isBlank | Whether or not the event was constructed without necessary parameters (to be populated by fromJson). |
| varId | The ID of the variable this event references. |
| type | Type of this event. |
| oldType | The old type of the variable. Undefined for a blank event. |
| newType | The new type of the variable. Undefined for a blank event. |
Methods index
| Method | Description |
|---|---|
| isNull | Does this event record any change of state? |
| getEventWorkspace_ | Get workspace the event belongs to. |
| toJson | Encode the event as JSON. |
| run | Run a variable type change event. |
Constructors
Constructor
new VarTypeChange(
variable?,
oldType?,
newType?
): VarTypeChange;
Defined in: packages/blockly/core/events/events_var_type_change.ts:34
Parameters
| Parameter | Type | Description |
|---|---|---|
variable? | IVariableModel<IVariableState> | The variable whose type changed. Undefined for a blank event. |
oldType? | string | The old type of the variable. Undefined for a blank event. |
newType? | string | The new type of the variable. Undefined for a blank event. |
Returns
VarTypeChange
Overrides
Properties
workspaceId?
optional workspaceId?: string = undefined;
Defined in: packages/blockly/core/events/events_abstract.ts:30
The workspace identifier for this event.
Inherited from
group
group: string;
Defined in: packages/blockly/core/events/events_abstract.ts:38
An ID for the group of events this block is associated with.
Groups define events that should be treated as an single action from the user's perspective, and should be undone together.
Inherited from
recordUndo
recordUndo: boolean;
Defined in: packages/blockly/core/events/events_abstract.ts:41
Whether this event is undoable or not.
Inherited from
isUiEvent
isUiEvent: boolean = false;
Defined in: packages/blockly/core/events/events_abstract.ts:44
Whether or not the event is a UI event.
Inherited from
isBlank
isBlank: boolean = true;
Defined in: packages/blockly/core/events/events_var_base.ts:28
Whether or not the event was constructed without necessary parameters (to be populated by fromJson).
Inherited from
varId?
optional varId?: string;
Defined in: packages/blockly/core/events/events_var_base.ts:30
The ID of the variable this event references.
Inherited from
type
type: EventType = EventType.VAR_TYPE_CHANGE;
Defined in: packages/blockly/core/events/events_var_type_change.ts:27
Type of this event.
Overrides
oldType?
optional oldType?: string;
Defined in: packages/blockly/core/events/events_var_type_change.ts:36
The old type of the variable. Undefined for a blank event.
newType?
optional newType?: string;
Defined in: packages/blockly/core/events/events_var_type_change.ts:37
The new type of the variable. Undefined for a blank event.
Methods
isNull()
isNull(): boolean;
Defined in: packages/blockly/core/events/events_abstract.ts:91
Does this event record any change of state?
Returns
boolean
True if null, false if something changed.
Inherited from
getEventWorkspace_()
getEventWorkspace_(): Workspace;
Defined in: packages/blockly/core/events/events_abstract.ts:111
Get workspace the event belongs to.
Returns
The workspace the event belongs to.
Throws
if workspace is null.
Inherited from
toJson()
toJson(): VarTypeChangeJson;
Defined in: packages/blockly/core/events/events_var_type_change.ts:47
Encode the event as JSON.
Returns
JSON representation.
Overrides
run()
run(forward): void;
Defined in: packages/blockly/core/events/events_var_type_change.ts:89
Run a variable type change event.
Parameters
| Parameter | Type | Description |
|---|---|---|
forward | boolean | True if run forward, false if run backward (undo). |
Returns
void