blockly > Workspace > isCapacityAvailable

Workspace.isCapacityAvailable() method

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.


isCapacityAvailable(typeCountsMap: {
        [key: string]: number;
    }): boolean;


Parameter Type Description
typeCountsMap { [key: string]: number; } A map of types to counts (usually representing blocks to be created).



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