Skip to content
Shapemetry

Types - AnnotationStyle

API reference for ./evaluate/annotationStyle on @huukhanhnguyen/types.

See the Guide for the package's role.

API reference

Signatures are generated from the live package .d.ts - not hand-written.

AnnotationStyle

type

Produced by collectAnnotationStyleNodes() from an authored annotationStyle node's expression args; consumed BY NAME.

type AnnotationStyle
// = {
    name: string;
    /** Name of the `textStyles` record the measurement string is drawn with. */
    textStyle: string;
    /** Arrowhead length, model units (DXF DIMASZ). */
    arrowSize?: number;
    /** Gap between the measured point and where its extension line starts
     *  (DXF DIMEXO). */
    extensionOffset?: number;
    /** How far an extension line runs PAST the dimension line (DXF DIMEXE). */
    extensionOvershoot?: number;
    /** How far the dimension line runs past the extension lines (DXF DIMDLE). */
    lineOvershoot?: number;
    /** Distance between stacked baseline dimensions (DXF DIMDLI). */
    baselineSpacing?: number;
    /** Size of the cross drawn at a circle's centre. A centre mark MEASURES
     *  NOTHING, so it is this NUMBER and not a dimension type — exactly what
     *  DXF's DIMCEN is (it was a `DimensionKind` here until 2026-08-16, which
     *  is why `value`/`text` had to be optional on every dimension). */
    centerMarkSize?: number;
    /** Decimal places in the measurement string (DXF DIMDEC). */
    decimals?: number;
    /** Round the measurement to this increment before formatting (DIMRND). */
    rounding?: number;
    /** Appended to the measurement string — a unit, `"mm"` (DIMPOST). */
    textSuffix?: string;
    /** Size of the oblique tick drawn instead of an arrowhead when the
     *  architectural tick is used (DXF DIMTSZ; 0/absent = arrowheads). */
    tickSize?: number;
    /** Multiplier applied to every length above, so one style set draws at a
     *  second paper scale (DXF DIMSCALE). */
    scale?: number;
}

ResolvedAnnotationStyles

type

The two style records a drafting mark needs at once: how the MEASUREMENT is drawn and how its TEXT is drawn. They travel together because a mark's drawn form needs both in one pass, and resolving them separately at each call site is where a mark ends up drawn with one style's arrows and another's text.

type ResolvedAnnotationStyles
// = {
    annotation: AnnotationStyle;
    text: import("./textStyle.js").TextStyle;
}
Last updated: 📖 1 min readEdit on GitHub