Stay organized with collections Save and categorize content based on your preferences.

blockly > utils > getBlockTypeCounts

utils.getBlockTypeCounts() function

Use **Blockly.common.getBlockTypeCounts** instead.

Get a map of all the block's descendants mapping their type to the number of children with that type.


export declare function getBlockTypeCounts(block: Block, opt_stripFollowing?: boolean): {
    [key: string]: number;


Parameter Type Description
block Block The block to map.
opt_stripFollowing boolean (Optional) Optionally ignore all following statements (blocks that are not inside a value or statement input of the block).


{ [key: string]: number; }

Map of types to type counts for descendants of the bock.