BlockRegistry
Index
Constructors
Methods
Constructors
constructor
Returns BlockRegistry
Methods
add
Parameters
layer: ChaynsHistoryLayer
callback: () => Promise<boolean>
opts: ChaynsHistoryBlockOptions = {}
Returns () => void
Returns void
checkBlocks
Parameters
targetLayer: ChaynsHistoryLayer
Returns Promise<boolean>
collectApplicableBlocks
Collects all blocks applicable to a navigation targeting
targetLayer.Rules:
localblocks: only those registered ontargetLayer.globalblocks: those registered ontargetLayeror any of its active-chain descendants (not inactive subtrees).
Parameters
targetLayer: ChaynsHistoryLayer
Returns BlockEntry[]
remove
Parameters
layerId: string
entry: BlockEntry
Returns void
removeAllForLayer
Remove all blocks registered for a layer (called on destroy).
Parameters
layerId: string
Returns void
Runs all applicable block callbacks in parallel. Returns
trueif navigation is allowed (no block),falseotherwise. Callbacks that throw or time out count as blocked (with dev-warn).