abstractAOverlay <S, T>
Hierarchy
- AModel<S, T>
- AOverlay
Implements
- IOverlay<S, T>
Index
Properties
readonlyinheritedanchors
The anchors attached to this model, whether declared on it or borrowed from another model.
readonlyoverlayId
The ID of the overlay, unique across the infrastructure.
readonlyproperties
The properties of the overlay.
staticreadonlyinheritedNODE_NAME
The name of the node. All nodes with same name are of the same category.
staticreadonlyinheritedNODE_PACKAGE
The package of the node.
staticreadonlyinheritedNODE_SCHEMA
The schema of the node.
staticreadonlyinheritedNODE_TYPE
The type of the node.
Methods
getAnchor
To get one of the anchors this overlay joins. Unlike AModel.getAnchor,
parentis required - an overlay's anchors are always declared by another model.Parameters
anchorId: string
parent: UnknownModel
Returns UnknownAnchor | undefined
getAnchorIndex
The position of one of the joined anchors. See AOverlay.getAnchor.
Parameters
anchorId: string
parent: UnknownModel
Returns number
inheritedgetAnchors
To get all attached anchors, narrowed by anchor class and/or by the value of their properties.
Parameters
filters: { key: string; value: unknown }[] = []
Each filter is a property
keythe anchor must carry with the givenvalue.types: Constructable<MatchingAnchor<BaseAnchorSchema> | UnknownAnchor>[] = []
The anchor classes to keep. An empty list keeps every class.
Returns UnknownAnchor[]
inheritedgetAnchorsMatchingSchema
To find anchors by their schema rather than by their class.
This is how a module consumes what another module produced without importing its classes - you match on the shape you need, and any anchor satisfying that shape is returned. Anchors that do not satisfy the schema are skipped, not reported as errors.
Type parameters
Parameters
from: Constructable<S>
The anchor schema to match against.
propertyFilters: ObjectKeyValue<S[properties]>[] = []
Each filter is a property
keythe anchor must carry with the givenvalue.options: { searchBoundaryMembers?: boolean } = {}
searchBoundaryMemberssearches the whole boundary this model belongs to. Set it tofalseto search only this model.optionalsearchBoundaryMembers: boolean = true
Returns Promise<MatchingAnchor<S>[]>
inheritedgetModelsMatchingSchema
To find models by their schema. See AModel.getAnchorsMatchingSchema.
Type parameters
- S: object
Parameters
schema: Constructable<S>
The model schema to match against.
filters: ObjectKeyValue<S>[] = []
Each filter is a schema
keythe model must carry with the givenvalue.options: { searchBoundaryMembers?: boolean } = {}
searchBoundaryMemberssearches the whole boundary this model belongs to. Set it tofalseto search only this model.optionalsearchBoundaryMembers: boolean = true
Returns Promise<MatchingModel<S>[]>
inheritedgetOverlaysMatchingSchema
To find overlays by their schema. See AModel.getAnchorsMatchingSchema.
Type parameters
Parameters
schema: Constructable<S>
The overlay schema to match against.
propertyFilters: ObjectKeyValue<S[properties]>[] = []
Each filter is a property
keythe overlay must carry with the givenvalue.options: { searchBoundaryMembers?: boolean } = {}
searchBoundaryMemberssearches the whole boundary this model belongs to. Set it tofalseto search only this model.optionalsearchBoundaryMembers: boolean = true
Returns Promise<MatchingModel<S>[]>
inheritedgetResourcesMatchingSchema
To find resources by their schema. See AModel.getAnchorsMatchingSchema.
Only resources produced by the modules that own the searched models are considered, so this returns another module's resources rather than every resource in the run.
Type parameters
Parameters
schema: Constructable<S>
The resource schema to match against.
propertyFilters: ObjectKeyValue<S[properties]>[] = []
Each filter is a property
keythe resource must carry with the givenvalue.responseFilters: ObjectKeyValue<S[response]>[] = []
Each filter is a response
keythe resource must carry with the givenvalue.options: { searchBoundaryMembers?: boolean } = {}
searchBoundaryMemberssearches the whole boundary this model belongs to. Set it tofalseto search only this model.optionalsearchBoundaryMembers: boolean = true
Returns Promise<MatchingResource<S>[]>
inheritedremoveAllAnchors
To detach every anchor from this model.
Returns void
removeAnchor
To stop joining an anchor, which also drops this overlay's dependency on the anchor's parent.
- The dependency survives while another joined anchor still shares that parent.
Parameters
anchor: MatchingAnchor<BaseAnchorSchema> | UnknownAnchor
Returns void
The base class of every overlay - a model that spans other models.
Some infrastructure belongs to no single model. Mounting a filesystem into a subnet, for instance, is a fact about both, and forcing it into either one distorts that model. An overlay holds that fact instead, keeping the models it joins clean.
An overlay takes AAnchors rather than models, so it depends on the shape of what it joins and not on another library's classes. Otherwise it behaves like any other model: it has actions, it is diffed, and it is serialized.
Overlays
Definition of Overlays.