Adds a block into the directory.
This function handles the decomposition of blocks into properties and subblocks. The parent block and each of its subblocks are added to the block directory, with an appropriate prefix prepended to the block identifiers.
For example, by passing in prefix as "foobar" and block as a block
with subblocks foo and bar, three blocks will be added to the directory
with identifiers foobar, foobar/foo and foobar/bar.
Note that each block in the directory will have its subblocks stripped
away. If it is necessary to access a subblock, the find function should
be used with prefix set to the identifier of the parent block and id
set to the (partial) identifier of the subblock.
A prefix string representing the full identifier of the block.
The block to be added to the directory.
Finds a block in the directory.
This function attempts to find a block with the exact same full identifier
as id. If no such block exists, it will search for a block with id
directly under prefix.
For example, if prefix is set to "abc" and id to "ghi", the
function will check if either of the blocks ghi or abc/ghi exist.
A prefix string representing the full identifier of the parent block, if any.
The identifier of the desired block. This may either be a full identifier or a partial identifier under the parent block.
A pair with the first element as the full identifier of the desired block and the second element as the desired block itself.
Retrieves all selectable block identifiers in the directory.
A list of full identifiers of all selectable blocks in the directory.
Generated using TypeDoc
Class representing a block directory, providing functionality for adding blocks and block identifier resolution.