blockly > common > getBlockTypeCounts

common.getBlockTypeCounts() function

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

Signature:

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

Parameters

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).

Returns:

{ [key: string]: number; }

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