blockly > VariableModel

VariableModel 類別

變數模型的類別。保存變數的資訊,包括名稱、ID 和類型。

Signature:

export declare class VariableModel implements IVariableModel<IVariableState> 

實作: IVariableModel<IVariableState>

建構函式

建構函式 修飾符 說明
(constructor)(workspace, name, opt_type, opt_id) 建構 VariableModel 類別的新例項

方法

方法 修飾符 說明
getId()
getName()
getType()
getWorkspace() 傳回此 VariableModel 所屬的工作區。
load(state, workspace) static 將已儲存的狀態載入至指定工作區中的新變數。
save() 序列化此 VariableModel。
setName(newName) 更新這個變數的使用者可見名稱。
setType(newType) 更新此變數的類型。