Hiyve Components - v1.0.0
    Preparing search index...

    A single annotation stroke serialised for storage / sync transmission.

    Coordinates and dimensions are stored in intrinsic PDF points (the page's getViewport({ scale: 1 }) dimensions) rather than canvas pixels — so the same stroke renders at the same position regardless of each viewer's zoom level. Each viewer multiplies by its current displayWidth / intrinsicWidth ratio when drawing.

    Shape is intentionally narrow (a path with left/top/strokeWidth and a list of points) rather than full Fabric JSON, so:

    • The relay payload stays small (fewer bytes per stroke).
    • We don't lock the storage format to Fabric's internal schema.
    • Anyone could reimplement the layer with a different drawing engine later without a wire-format change.
    interface PdfAnnotationStroke {
        authorId: string;
        id: string;
        left: number;
        path: (string | number)[][];
        stroke: string;
        strokeWidth: number;
        top: number;
    }
    Index

    Properties

    authorId: string

    Author user id (whoever drew it). Used for per-author colour fallback when we wire that up; also enables "clear my strokes".

    id: string

    Unique stroke id — survives across all viewers' Fabric instances.

    left: number

    Top-left position of the stroke's bounding box, intrinsic units.

    path: (string | number)[][]

    SVG-style path data, coordinates in intrinsic PDF points. Format: [ ['M', x, y], ['Q', cx, cy, x, y], ... ] which is exactly what Fabric Path serialises into.

    stroke: string

    Stroke colour as a CSS-compatible string (hex / rgb / rgba).

    strokeWidth: number

    Stroke width, intrinsic units.

    top: number