Interface RelativizeForTargetOptions

Relativization options.

interface RelativizeForTargetOptions {
    getExcludedTags?: (namespace?: HNamespace) => string[];
    includeIntermediateRecords?: boolean;
    includeOtherRefs?: boolean;
    includeTargetMacro?: boolean;
    namespace?: HNamespace;
    prefixPath?: string[];
    resolve?: RelativizeResolveFunc;
    resolveCache?: Map<string, Promise<undefined | HDict>>;
    targetRefNames?: string | string[];
    useDisplayName?: boolean;
    useKind?: boolean;
    useMarkers?: boolean;
    useRelativizeOn?: boolean;
}

Hierarchy (View Summary)

Properties

getExcludedTags?: (namespace?: HNamespace) => string[]

Optional function to determine the list of tags that should be excluded from the relative filter.

includeIntermediateRecords?: boolean

True (or undefined) if intermediate records should be included in the relative filters.

includeOtherRefs?: boolean

True (or undefined) if other references on the target record should be automatically discovered and used as anchors when relativizing.

The target's id is always tried first. If this is true, any other references on the target that aren't containment references (i.e. siteRef, equipRef etc) are then tried in turn. A record matches one of these anchors if it either...

  • Has the same reference value as the target (i.e. cooRef == $cooRef).
  • Is contained under the referenced record (i.e. equipRef == $cooRef).

If a namespace is specified, it's used to determine the containment references to exclude.

This is ignored if targetRefNames is specified.

includeTargetMacro?: boolean

True (or undefined) if the target record macro reference should be included in the relative filters.

namespace?: HNamespace

The namespace to use for determining excluded tags.

prefixPath?: string[]

Optional prefix path.

An optional function used to resolve a dict for a reference.

resolveCache?: Map<string, Promise<undefined | HDict>>

An optional cache used to cache requests for dicts.

If multiple resolution calls are being made, this cache can be used between calls to avoid duplicate requests for the same reference.

targetRefNames?: string | string[]

An optional explicit priority list of reference names on the target to use as anchors for relativization (i.e. ['id', 'cooRef']).

When specified, this replaces automatic discovery and the names are used exactly as given. If id should be used, it must be included in the list. An empty list falls back to automatic discovery.

useDisplayName?: boolean

True (or undefined) if the display name should be used in the relative filter.

useKind?: boolean

True (or undefined) if a point's kind should be used in the relative filter.

useMarkers?: boolean

True (or undefined) if the relative filter should use markers.

useRelativizeOn?: boolean

True (or undefined) if the relativization should be looked up on the record.

A record can define a relativizeOn tag that is a list of tags that should be used for relativization. This is used to provide a hint on how relativation for a certain record is defined.

The {dis} id can be used to add the first known display name tag on the record.

The {kind} id can be used to add the kind tag when the record is a point.

The {markers} id can be used to expand all marker tags on the record.