Reference·JavaScript · @bimworks/viewercommonJavaScript

TemplateContext

Interface in @bimworks/viewercommon.

API catalogue · @bimworks/viewercommon · Interface

TypeScript#
interface TemplateContext

The second argument of a template's render

Members#

Member Kind Description
format Property
hovered Property The annotation, or its object in a viewer, is under the pointer. The compact state is drawn again when this changes; a template with hover "template" shows i…
icons Property
key Property
mergedCount Property More than 1 when this annotation fronts a cluster
now Property Time of this render
qid Property
state Property "compact" at rest; "expanded" in the card that opens on hover or click (expandable templates)
type Property IFC class of the row ("IfcDoor"), null without one

format#

TypeScript#
format: { date: (value: string | number | Date) => string; initials: (name: string) => string; number: (value: number, digits?: number) => string; quantity: (value: unknown) => string; relative: (value: string | number | Date, now?: number) => string; type: (type: string | null) => string }

hovered#

TypeScript#
hovered: boolean

The annotation, or its object in a viewer, is under the pointer. The compact state is drawn again when this changes; a template with hover "template" shows it (keep the size: change colour, shadow or a transform)

icons#

TypeScript#
icons: { glyph: (name: string) => TemplateResult; ifc: (type: string | null) => TemplateResult }

key#

TypeScript#
key: string

mergedCount#

TypeScript#
mergedCount: number

More than 1 when this annotation fronts a cluster

now#

TypeScript#
now: number

Time of this render

qid#

TypeScript#
qid: Qid | null

state#

TypeScript#
state: "expanded" | "compact"

"compact" at rest; "expanded" in the card that opens on hover or click (expandable templates)

type#

TypeScript#
type: string | null

IFC class of the row ("IfcDoor"), null without one