sesaparcours
    Preparing search index...

    Fake class which should be extended to avoid inheriting static properties

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    connectionChecker: IConnectionChecker

    An object that encapsulates logic for safety, type, and dragging checks.

    connectionDBList: Blockly.ConnectionDB[]

    Set of databases for rapid lookup of connection locations.

    horizontalLayout: boolean
    id: string
    isClearing: boolean

    Returns true if the workspace is currently in the process of a bulk clear.

    MAX_UNDO: number

    Maximum number of undo events in stack. 0 turns off undo, Infinity sets it to unlimited.

    options: Blockly.Options
    rendered: boolean

    Returns true if the workspace is visible and false if it's headless.

    RTL: boolean
    toolboxPosition: Blockly.utils.toolbox.Position

    Methods

    • When something in this workspace changes, call a function. Note that there may be a few recent events already on the stack. Thus the new change listener might be called with events that occurred a few milliseconds before the change listener was added.

      Parameters

      Returns Function

      Obsolete return value, ignore.

    • Adds a block to the list of top blocks.

      Parameters

      Returns void

    • Add a block to the list of blocks keyed by type.

      Parameters

      Returns void

    • Checks whether all value and statement inputs in the workspace are filled with blocks.

      Parameters

      • Optionalopt_shadowBlocksAreFilled: boolean

        An optional argument controlling whether shadow blocks are counted as filled. Defaults to true.

      Returns boolean

      True if all inputs are filled, false otherwise.

    • Dispose of all blocks and comments in workspace.

      Returns void

    • Clear the undo/redo stacks.

      Returns void

    • Create and store the potential variable map for this workspace.

      Returns void

    • Create a variable with a given name, optional type, and optional ID.

      Parameters

      • name: string

        The name of the variable. This must be unique across variables and procedures.

      • Optionalopt_type: string

        The type of the variable like 'int' or 'string'. Does not need to be unique. Field_variable can filter variables based on their type. This will default to '' which is a specific type.

      • Optionalopt_id: string

        The unique ID of the variable. This will default to a UUID.

      Returns Blockly.VariableModel

      The newly created variable.

    • Delete a variables by the passed in ID and all of its uses from this workspace. May prompt the user for confirmation.

      Parameters

      • id: string

        ID of variable to delete.

      Returns void

    • Dispose of this workspace. Unlink from all DOM elements to prevent memory leaks.

      Returns void

    • Fire a change event.

      Parameters

      Returns void

    • Find all blocks in workspace. Blocks are optionally sorted by position; top to bottom (with slight LTR or RTL bias).

      Parameters

      • ordered: boolean

        Sort the list if true.

      Returns Blockly.Block[]

      Array of blocks.

    • Returns all variable names of all types.

      Returns string[]

      List of all variable names of all types.

    • Find the block on this workspace with the specified ID.

      Parameters

      • id: string

        ID of block to find.

      Returns Blockly.Block

      The sought after block, or null if not found.

    • Finds the blocks with the associated type and returns them. Blocks are optionally sorted by position; top to bottom (with slight LTR or RTL bias).

      Parameters

      • type: string

        The type of block to search for.

      • ordered: boolean

        Sort the list if true.

      Returns Blockly.Block[]

      The blocks of the given type.

    • Return the variable map that contains "potential" variables. These exist in the flyout but not in the workspace.

      Returns VariableMap

      The potential variable map.

    • Gets the redo stack for workplace.

      Returns Abstract[]

      redo stack

    • Finds the top-level blocks and returns them. Blocks are optionally sorted by position; top to bottom (with slight LTR or RTL bias).

      Parameters

      • ordered: boolean

        Sort the list if true.

      Returns Blockly.Block[]

      The top-level block objects.

    • Finds the top-level comments and returns them. Comments are optionally sorted by position; top to bottom (with slight LTR or RTL bias).

      Parameters

      • ordered: boolean

        Sort the list if true.

      Returns Blockly.WorkspaceComment[]

      The top-level comment objects.

    • Gets the undo stack for workplace.

      Returns Abstract[]

      undo stack

    • Find the variable by the given name and return it. Return null if not found.

      Parameters

      • name: string

        The name to check for.

      • Optionalopt_type: string

        The type of the variable. If not provided it defaults to the empty string, which is a specific type.

      Returns Blockly.VariableModel

      The variable with the given name.

    • Find the variable by the given ID and return it. Return null if not found.

      Parameters

      • id: string

        The ID to check for.

      Returns Blockly.VariableModel

      The variable with the given ID.

    • Find the variable with the specified type. If type is null, return list of variables with empty string type.

      Parameters

      • type: string

        Type of the variables to find.

      Returns Blockly.VariableModel[]

      The sought after variables of the passed in type. An empty array if none are found.

    • Return all variable types.

      Returns string[]

      List of variable types.

    • Find all the uses of the given variable, which is identified by ID.

      Parameters

      • id: string

        ID of the variable to find.

      Returns Blockly.Block[]

      Array of block usages.

    • Returns the horizontal offset of the workspace. Intended for LTR/RTL compatibility in XML. Not relevant for a headless workspace.

      Returns number

      Width.

    • Checks if the workspace has any limits on the maximum number of blocks, or the maximum number of blocks of specific types.

      Returns boolean

      True if it has block limits, false otherwise.

    • Check if there is remaining capacity for blocks of the given counts to be created. If the total number of blocks represented by the map is more than the total remaining capacity, it returns false. If a type count is more than the remaining capacity for that type, it returns false.

      Parameters

      • typeCountsMap: Object

        A map of types to counts (usually representing blocks to be created).

      Returns boolean

      True if there is capacity for the given map, false otherwise.

    • Obtain a newly created block.

      Parameters

      • prototypeName: string

        Name of the language object containing type-specific functions for this block.

      • Optionalopt_id: string

        Optional ID. Use this ID if provided, otherwise create a new ID.

      Returns Blockly.Block

      The created block.

    • The number of blocks that may be added to the workspace before reaching the maxBlocks.

      Returns number

      Number of blocks left.

    • The number of blocks of the given type that may be added to the workspace before reaching the maxInstances allowed for that type.

      Parameters

      • type: string

        Type of block to return capacity for.

      Returns number

      Number of blocks of type left.

    • Delete a block off this workspace with the specified ID.

      Parameters

      • id: string

        ID of block to delete.

      Returns void

    • Stop listening for this workspace's changes.

      Parameters

      • func: Function

        Function to stop calling.

      Returns void

    • Removes a block from the list of top blocks.

      Parameters

      Returns void

    • Remove a block from the list of blocks keyed by type.

      Parameters

      Returns void

    • Rename a variable by updating its name in the variable map. Identify the variable to rename with the given ID.

      Parameters

      • id: string

        ID of the variable to rename.

      • newName: string

        New variable name.

      Returns void

    • Set a block on this workspace with the specified ID.

      Parameters

      • id: string

        ID of block to set.

      • block: Blockly.Block

        The block to set.

      Returns void

    • Set the map of all variables on the workspace.

      Parameters

      Returns void

    • Undo or redo the previous action.

      Parameters

      • redo: boolean

        False if undo, true if redo.

      Returns void