Preparing search index...
The search index is not available
@turbowarp/types-tw
@turbowarp/types-tw
scratch-blocks
ScratchBlocks
Workspace
Class Workspace
Hierarchy (
View Summary
)
Workspace
WorkspaceSvg
Index
Constructors
constructor
Properties
blockDB_
horizontal
Layout
id
is
Clearing
listeners_
MAX_
UNDO
options
potential
Variable
Map_
redo
Stack_
rendered
RTL
tap
Listeners_
toolbox
Position
top
Blocks_
undo
Stack_
variable
Map_
Methods
add
Change
Listener
add
Top
Block
add
Top
Comment
all
Inputs
Filled
clear
clear
Undo
create
Potential
Variable
Map
create
Variable
delete
Variable
By
Id
delete
Variable
Internal_
dispose
fire
Change
Listener
get
All
Blocks
get
All
Variables
get
Block
By
Id
get
Comment
By
Id
get
Flyout
get
Potential
Variable
Map
get
Top
Blocks
get
Top
Comments
get
Variable
get
Variable
By
Id
get
Variable
Map
get
Variables
Of
Type
get
Variable
Types
get
Variable
Uses
By
Id
get
Width
has
Redo
Stack
has
Undo
Stack
new
Block
refresh
Toolbox
Selection_
remove
Change
Listener
remove
Top
Block
remove
Top
Comment
rename
Variable
By
Id
undo
variable
Index
Of
Constructors
constructor
new
Workspace
()
:
Workspace
Returns
Workspace
Properties
blockDB_
blockDB_
:
Record
<
string
,
ScratchBlocks
.
Block
>
horizontal
Layout
horizontalLayout
:
boolean
id
id
:
string
is
Clearing
isClearing
:
boolean
listeners_
listeners_
:
Function
[]
MAX_
UNDO
MAX_UNDO
:
1024
options
options
:
WorkspaceOptions
potential
Variable
Map_
potentialVariableMap_
:
null
|
VariableMap
redo
Stack_
redoStack_
:
EventsAbstract
[]
rendered
rendered
:
boolean
RTL
RTL
:
boolean
tap
Listeners_
tapListeners_
:
Function
[]
toolbox
Position
toolboxPosition
:
number
top
Blocks_
topBlocks_
:
ScratchBlocks
.
Block
[]
undo
Stack_
undoStack_
:
EventsAbstract
[]
variable
Map_
variableMap_
:
VariableMap
Methods
add
Change
Listener
addChangeListener
(
listener
:
Function
)
:
void
Parameters
listener
:
Function
Returns
void
add
Top
Block
addTopBlock
(
block
:
ScratchBlocks
.
Block
)
:
void
Parameters
block
:
ScratchBlocks
.
Block
Returns
void
add
Top
Comment
addTopComment
(
comment
:
WorkspaceComment
)
:
void
Parameters
comment
:
WorkspaceComment
Returns
void
all
Inputs
Filled
allInputsFilled
(
shadowBlocksAreFilled
?:
boolean
)
:
boolean
Parameters
Optional
shadowBlocksAreFilled
:
boolean
Returns
boolean
clear
clear
()
:
void
Returns
void
clear
Undo
clearUndo
()
:
void
Returns
void
create
Potential
Variable
Map
createPotentialVariableMap
()
:
void
Returns
void
create
Variable
createVariable
(
name
:
string
,
type
?:
ScratchBlocks
.
VariableType
,
id
?:
string
,
isLocal
?:
boolean
,
isCloud
?:
boolean
,
)
:
VariableModel
Parameters
name
:
string
Optional
type
:
ScratchBlocks
.
VariableType
Optional
id
:
string
Optional
isLocal
:
boolean
Optional
isCloud
:
boolean
Returns
VariableModel
See
delete
Variable
By
Id
deleteVariableById
(
id
:
string
)
:
void
Parameters
id
:
string
Returns
void
See
delete
Variable
Internal_
deleteVariableInternal_
(
variable
:
VariableModel
,
uses
:
ScratchBlocks
.
Block
[]
,
)
:
void
Parameters
variable
:
VariableModel
uses
:
ScratchBlocks
.
Block
[]
Returns
void
See
dispose
dispose
()
:
void
Returns
void
fire
Change
Listener
fireChangeListener
(
event
:
EventsAbstract
)
:
void
Parameters
event
:
EventsAbstract
Returns
void
get
All
Blocks
getAllBlocks
()
:
ScratchBlocks
.
Block
[]
Returns
ScratchBlocks
.
Block
[]
get
All
Variables
getAllVariables
()
:
VariableModel
[]
Returns
VariableModel
[]
See
get
Block
By
Id
getBlockById
(
id
:
string
)
:
null
|
ScratchBlocks
.
Block
Parameters
id
:
string
Returns
null
|
ScratchBlocks
.
Block
get
Comment
By
Id
getCommentById
(
id
:
string
)
:
null
|
WorkspaceComment
Parameters
id
:
string
Returns
null
|
WorkspaceComment
get
Flyout
getFlyout
()
:
null
|
Flyout
Returns
null
|
Flyout
get
Potential
Variable
Map
getPotentialVariableMap
()
:
VariableMap
Returns
VariableMap
get
Top
Blocks
getTopBlocks
()
:
ScratchBlocks
.
Block
[]
Returns
ScratchBlocks
.
Block
[]
get
Top
Comments
getTopComments
()
:
WorkspaceComment
[]
Returns
WorkspaceComment
[]
get
Variable
getVariable
(
name
:
string
,
type
?:
ScratchBlocks
.
VariableType
)
:
void
Parameters
name
:
string
Optional
type
:
ScratchBlocks
.
VariableType
Returns
void
See
get
Variable
By
Id
getVariableById
(
id
:
string
)
:
VariableModel
Parameters
id
:
string
Returns
VariableModel
See
get
Variable
Map
getVariableMap
()
:
VariableMap
Returns
VariableMap
get
Variables
Of
Type
getVariablesOfType
(
type
:
ScratchBlocks
.
VariableType
)
:
VariableModel
[]
Parameters
type
:
ScratchBlocks
.
VariableType
Returns
VariableModel
[]
See
get
Variable
Types
getVariableTypes
()
:
ScratchBlocks
.
VariableType
[]
Returns
ScratchBlocks
.
VariableType
[]
See
get
Variable
Uses
By
Id
getVariableUsesById
(
id
:
string
)
:
ScratchBlocks
.
Block
[]
Parameters
id
:
string
Returns
ScratchBlocks
.
Block
[]
See
get
Width
getWidth
()
:
number
Returns
number
has
Redo
Stack
hasRedoStack
()
:
boolean
Returns
boolean
has
Undo
Stack
hasUndoStack
()
:
boolean
Returns
boolean
new
Block
newBlock
(
opcode
:
string
,
id
?:
string
)
:
ScratchBlocks
.
Block
Parameters
opcode
:
string
Optional
id
:
string
Returns
ScratchBlocks
.
Block
refresh
Toolbox
Selection_
refreshToolboxSelection_
()
:
void
Returns
void
remove
Change
Listener
removeChangeListener
(
listener
:
Function
)
:
void
Parameters
listener
:
Function
Returns
void
remove
Top
Block
removeTopBlock
(
block
:
ScratchBlocks
.
Block
)
:
void
Parameters
block
:
ScratchBlocks
.
Block
Returns
void
remove
Top
Comment
removeTopComment
(
comment
:
WorkspaceComment
)
:
void
Parameters
comment
:
WorkspaceComment
Returns
void
rename
Variable
By
Id
renameVariableById
(
id
:
string
,
newName
:
string
)
:
void
Parameters
id
:
string
newName
:
string
Returns
void
undo
undo
(
redo
:
boolean
)
:
void
Parameters
redo
:
boolean
true for redo, false for undo
Returns
void
variable
Index
Of
variableIndexOf
(
name
:
string
)
:
-1
Parameters
name
:
string
Returns
-1
Deprecated
always returns -1
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
blockDB_
horizontal
Layout
id
is
Clearing
listeners_
MAX_
UNDO
options
potential
Variable
Map_
redo
Stack_
rendered
RTL
tap
Listeners_
toolbox
Position
top
Blocks_
undo
Stack_
variable
Map_
Methods
add
Change
Listener
add
Top
Block
add
Top
Comment
all
Inputs
Filled
clear
clear
Undo
create
Potential
Variable
Map
create
Variable
delete
Variable
By
Id
delete
Variable
Internal_
dispose
fire
Change
Listener
get
All
Blocks
get
All
Variables
get
Block
By
Id
get
Comment
By
Id
get
Flyout
get
Potential
Variable
Map
get
Top
Blocks
get
Top
Comments
get
Variable
get
Variable
By
Id
get
Variable
Map
get
Variables
Of
Type
get
Variable
Types
get
Variable
Uses
By
Id
get
Width
has
Redo
Stack
has
Undo
Stack
new
Block
refresh
Toolbox
Selection_
remove
Change
Listener
remove
Top
Block
remove
Top
Comment
rename
Variable
By
Id
undo
variable
Index
Of
@turbowarp/types-tw
Loading...
See