ducjs 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/flatbuffers/duc/alternate-units.d.ts +21 -0
- package/dist/flatbuffers/duc/alternate-units.js +66 -0
- package/dist/flatbuffers/duc/angular-unit-system.d.ts +17 -0
- package/dist/flatbuffers/duc/angular-unit-system.js +50 -0
- package/dist/flatbuffers/duc/angular-units-format.d.ts +7 -0
- package/dist/flatbuffers/duc/angular-units-format.js +10 -0
- package/dist/flatbuffers/duc/axis.d.ts +5 -0
- package/dist/flatbuffers/duc/axis.js +8 -0
- package/dist/flatbuffers/duc/bezier-mirroring.d.ts +5 -0
- package/dist/flatbuffers/duc/bezier-mirroring.js +8 -0
- package/dist/flatbuffers/duc/blending.d.ts +9 -0
- package/dist/flatbuffers/duc/blending.js +12 -0
- package/dist/flatbuffers/duc/block-attachment.d.ts +4 -0
- package/dist/flatbuffers/duc/block-attachment.js +7 -0
- package/dist/flatbuffers/duc/boolean-operation.d.ts +6 -0
- package/dist/flatbuffers/duc/boolean-operation.js +9 -0
- package/dist/flatbuffers/duc/bound-element.d.ts +17 -0
- package/dist/flatbuffers/duc/bound-element.js +48 -0
- package/dist/flatbuffers/duc/checkpoint.d.ts +22 -0
- package/dist/flatbuffers/duc/checkpoint.js +75 -0
- package/dist/flatbuffers/duc/column-layout.d.ts +22 -0
- package/dist/flatbuffers/duc/column-layout.js +72 -0
- package/dist/flatbuffers/duc/column-type.d.ts +5 -0
- package/dist/flatbuffers/duc/column-type.js +8 -0
- package/dist/flatbuffers/duc/custom-hatch-pattern.d.ts +23 -0
- package/dist/flatbuffers/duc/custom-hatch-pattern.js +71 -0
- package/dist/flatbuffers/duc/datum-bracket-style.d.ts +5 -0
- package/dist/flatbuffers/duc/datum-bracket-style.js +8 -0
- package/dist/flatbuffers/duc/datum-reference.d.ts +17 -0
- package/dist/flatbuffers/duc/datum-reference.js +49 -0
- package/dist/flatbuffers/duc/datum-target-type.d.ts +6 -0
- package/dist/flatbuffers/duc/datum-target-type.js +9 -0
- package/dist/flatbuffers/duc/decimal-separator.d.ts +4 -0
- package/dist/flatbuffers/duc/decimal-separator.js +7 -0
- package/dist/flatbuffers/duc/delta.d.ts +20 -0
- package/dist/flatbuffers/duc/delta.js +64 -0
- package/dist/flatbuffers/duc/dictionary-entry.d.ts +17 -0
- package/dist/flatbuffers/duc/dictionary-entry.js +49 -0
- package/dist/flatbuffers/duc/dimension-baseline-data.d.ts +14 -0
- package/dist/flatbuffers/duc/dimension-baseline-data.js +40 -0
- package/dist/flatbuffers/duc/dimension-bindings.d.ts +17 -0
- package/dist/flatbuffers/duc/dimension-bindings.js +50 -0
- package/dist/flatbuffers/duc/dimension-continue-data.d.ts +14 -0
- package/dist/flatbuffers/duc/dimension-continue-data.js +40 -0
- package/dist/flatbuffers/duc/dimension-definition-points.d.ts +21 -0
- package/dist/flatbuffers/duc/dimension-definition-points.js +64 -0
- package/dist/flatbuffers/duc/dimension-ext-line-style.d.ts +18 -0
- package/dist/flatbuffers/duc/dimension-ext-line-style.js +57 -0
- package/dist/flatbuffers/duc/dimension-fit-rule.d.ts +6 -0
- package/dist/flatbuffers/duc/dimension-fit-rule.js +9 -0
- package/dist/flatbuffers/duc/dimension-fit-style.d.ts +19 -0
- package/dist/flatbuffers/duc/dimension-fit-style.js +58 -0
- package/dist/flatbuffers/duc/dimension-line-style.d.ts +16 -0
- package/dist/flatbuffers/duc/dimension-line-style.js +49 -0
- package/dist/flatbuffers/duc/dimension-symbol-style.d.ts +22 -0
- package/dist/flatbuffers/duc/dimension-symbol-style.js +72 -0
- package/dist/flatbuffers/duc/dimension-text-placement.d.ts +5 -0
- package/dist/flatbuffers/duc/dimension-text-placement.js +8 -0
- package/dist/flatbuffers/duc/dimension-tolerance-style.d.ts +24 -0
- package/dist/flatbuffers/duc/dimension-tolerance-style.js +71 -0
- package/dist/flatbuffers/duc/dimension-type.d.ts +15 -0
- package/dist/flatbuffers/duc/dimension-type.js +18 -0
- package/dist/flatbuffers/duc/dimension-units-format.d.ts +7 -0
- package/dist/flatbuffers/duc/dimension-units-format.js +10 -0
- package/dist/flatbuffers/duc/dimension-validation-rules.d.ts +25 -0
- package/dist/flatbuffers/duc/dimension-validation-rules.js +74 -0
- package/dist/flatbuffers/duc/duc-arrow-element.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-arrow-element.js +49 -0
- package/dist/flatbuffers/duc/duc-block-attribute-definition-entry.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-block-attribute-definition-entry.js +44 -0
- package/dist/flatbuffers/duc/duc-block-attribute-definition.d.ts +22 -0
- package/dist/flatbuffers/duc/duc-block-attribute-definition.js +64 -0
- package/dist/flatbuffers/duc/duc-block-duplication-array.d.ts +19 -0
- package/dist/flatbuffers/duc/duc-block-duplication-array.js +64 -0
- package/dist/flatbuffers/duc/duc-block-instance-element.d.ts +30 -0
- package/dist/flatbuffers/duc/duc-block-instance-element.js +94 -0
- package/dist/flatbuffers/duc/duc-block.d.ts +34 -0
- package/dist/flatbuffers/duc/duc-block.js +111 -0
- package/dist/flatbuffers/duc/duc-common-style.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-common-style.js +44 -0
- package/dist/flatbuffers/duc/duc-dimension-element.d.ts +45 -0
- package/dist/flatbuffers/duc/duc-dimension-element.js +120 -0
- package/dist/flatbuffers/duc/duc-dimension-style.d.ts +28 -0
- package/dist/flatbuffers/duc/duc-dimension-style.js +76 -0
- package/dist/flatbuffers/duc/duc-doc-element.d.ts +33 -0
- package/dist/flatbuffers/duc/duc-doc-element.js +95 -0
- package/dist/flatbuffers/duc/duc-doc-style.d.ts +19 -0
- package/dist/flatbuffers/duc/duc-doc-style.js +52 -0
- package/dist/flatbuffers/duc/duc-element-base.d.ts +88 -0
- package/dist/flatbuffers/duc/duc-element-base.js +269 -0
- package/dist/flatbuffers/duc/duc-element-styles-base.d.ts +30 -0
- package/dist/flatbuffers/duc/duc-element-styles-base.js +103 -0
- package/dist/flatbuffers/duc/duc-ellipse-element.d.ts +22 -0
- package/dist/flatbuffers/duc/duc-ellipse-element.js +73 -0
- package/dist/flatbuffers/duc/duc-embeddable-element.d.ts +14 -0
- package/dist/flatbuffers/duc/duc-embeddable-element.js +41 -0
- package/dist/flatbuffers/duc/duc-external-file-data.d.ts +27 -0
- package/dist/flatbuffers/duc/duc-external-file-data.js +92 -0
- package/dist/flatbuffers/duc/duc-external-file-entry.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-external-file-entry.js +44 -0
- package/dist/flatbuffers/duc/duc-feature-control-frame-element.d.ts +31 -0
- package/dist/flatbuffers/duc/duc-feature-control-frame-element.js +89 -0
- package/dist/flatbuffers/duc/duc-feature-control-frame-style.d.ts +25 -0
- package/dist/flatbuffers/duc/duc-feature-control-frame-style.js +68 -0
- package/dist/flatbuffers/duc/duc-frame-element.d.ts +14 -0
- package/dist/flatbuffers/duc/duc-frame-element.js +41 -0
- package/dist/flatbuffers/duc/duc-free-draw-element.d.ts +52 -0
- package/dist/flatbuffers/duc/duc-free-draw-element.js +154 -0
- package/dist/flatbuffers/duc/duc-free-draw-ends.d.ts +18 -0
- package/dist/flatbuffers/duc/duc-free-draw-ends.js +56 -0
- package/dist/flatbuffers/duc/duc-global-state.d.ts +37 -0
- package/dist/flatbuffers/duc/duc-global-state.js +121 -0
- package/dist/flatbuffers/duc/duc-group.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-group.js +44 -0
- package/dist/flatbuffers/duc/duc-hatch-style.d.ts +28 -0
- package/dist/flatbuffers/duc/duc-hatch-style.js +79 -0
- package/dist/flatbuffers/duc/duc-head.d.ts +19 -0
- package/dist/flatbuffers/duc/duc-head.js +57 -0
- package/dist/flatbuffers/duc/duc-image-element.d.ts +35 -0
- package/dist/flatbuffers/duc/duc-image-element.js +91 -0
- package/dist/flatbuffers/duc/duc-image-filter.d.ts +15 -0
- package/dist/flatbuffers/duc/duc-image-filter.js +48 -0
- package/dist/flatbuffers/duc/duc-layer-overrides.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-layer-overrides.js +44 -0
- package/dist/flatbuffers/duc/duc-layer.d.ts +21 -0
- package/dist/flatbuffers/duc/duc-layer.js +59 -0
- package/dist/flatbuffers/duc/duc-leader-element.d.ts +22 -0
- package/dist/flatbuffers/duc/duc-leader-element.js +60 -0
- package/dist/flatbuffers/duc/duc-leader-style.d.ts +30 -0
- package/dist/flatbuffers/duc/duc-leader-style.js +87 -0
- package/dist/flatbuffers/duc/duc-line-reference.d.ts +15 -0
- package/dist/flatbuffers/duc/duc-line-reference.js +43 -0
- package/dist/flatbuffers/duc/duc-line.d.ts +15 -0
- package/dist/flatbuffers/duc/duc-line.js +43 -0
- package/dist/flatbuffers/duc/duc-linear-element-base.d.ts +38 -0
- package/dist/flatbuffers/duc/duc-linear-element-base.js +124 -0
- package/dist/flatbuffers/duc/duc-linear-element.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-linear-element.js +49 -0
- package/dist/flatbuffers/duc/duc-local-state.d.ts +68 -0
- package/dist/flatbuffers/duc/duc-local-state.js +206 -0
- package/dist/flatbuffers/duc/duc-mermaid-element.d.ts +23 -0
- package/dist/flatbuffers/duc/duc-mermaid-element.js +65 -0
- package/dist/flatbuffers/duc/duc-parametric-element.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-parametric-element.js +44 -0
- package/dist/flatbuffers/duc/duc-path.d.ts +26 -0
- package/dist/flatbuffers/duc/duc-path.js +69 -0
- package/dist/flatbuffers/duc/duc-pdf-element.d.ts +17 -0
- package/dist/flatbuffers/duc/duc-pdf-element.js +49 -0
- package/dist/flatbuffers/duc/duc-plot-element.d.ts +19 -0
- package/dist/flatbuffers/duc/duc-plot-element.js +52 -0
- package/dist/flatbuffers/duc/duc-plot-style.d.ts +14 -0
- package/dist/flatbuffers/duc/duc-plot-style.js +41 -0
- package/dist/flatbuffers/duc/duc-point-binding.d.ts +26 -0
- package/dist/flatbuffers/duc/duc-point-binding.js +73 -0
- package/dist/flatbuffers/duc/duc-point.d.ts +18 -0
- package/dist/flatbuffers/duc/duc-point.js +57 -0
- package/dist/flatbuffers/duc/duc-polygon-element.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-polygon-element.js +49 -0
- package/dist/flatbuffers/duc/duc-rectangle-element.d.ts +14 -0
- package/dist/flatbuffers/duc/duc-rectangle-element.js +41 -0
- package/dist/flatbuffers/duc/duc-region.d.ts +19 -0
- package/dist/flatbuffers/duc/duc-region.js +51 -0
- package/dist/flatbuffers/duc/duc-stack-base.d.ts +27 -0
- package/dist/flatbuffers/duc/duc-stack-base.js +78 -0
- package/dist/flatbuffers/duc/duc-stack-element-base.d.ts +23 -0
- package/dist/flatbuffers/duc/duc-stack-element-base.js +65 -0
- package/dist/flatbuffers/duc/duc-stack-like-styles.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-stack-like-styles.js +48 -0
- package/dist/flatbuffers/duc/duc-table-auto-size.d.ts +15 -0
- package/dist/flatbuffers/duc/duc-table-auto-size.js +48 -0
- package/dist/flatbuffers/duc/duc-table-cell-entry.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-table-cell-entry.js +44 -0
- package/dist/flatbuffers/duc/duc-table-cell-span.d.ts +15 -0
- package/dist/flatbuffers/duc/duc-table-cell-span.js +48 -0
- package/dist/flatbuffers/duc/duc-table-cell-style.d.ts +22 -0
- package/dist/flatbuffers/duc/duc-table-cell-style.js +59 -0
- package/dist/flatbuffers/duc/duc-table-cell.d.ts +27 -0
- package/dist/flatbuffers/duc/duc-table-cell.js +72 -0
- package/dist/flatbuffers/duc/duc-table-column-entry.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-table-column-entry.js +44 -0
- package/dist/flatbuffers/duc/duc-table-column.d.ts +18 -0
- package/dist/flatbuffers/duc/duc-table-column.js +51 -0
- package/dist/flatbuffers/duc/duc-table-element.d.ts +51 -0
- package/dist/flatbuffers/duc/duc-table-element.js +167 -0
- package/dist/flatbuffers/duc/duc-table-row-entry.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-table-row-entry.js +44 -0
- package/dist/flatbuffers/duc/duc-table-row.d.ts +18 -0
- package/dist/flatbuffers/duc/duc-table-row.js +51 -0
- package/dist/flatbuffers/duc/duc-table-style.d.ts +23 -0
- package/dist/flatbuffers/duc/duc-table-style.js +65 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-dictionary-source.d.ts +14 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-dictionary-source.js +40 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-element-source.d.ts +17 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-element-source.js +49 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-part.d.ts +22 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-part.js +58 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-source-data.d.ts +9 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-source-data.js +26 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-source.d.ts +19 -0
- package/dist/flatbuffers/duc/duc-text-dynamic-source.js +58 -0
- package/dist/flatbuffers/duc/duc-text-element.d.ts +33 -0
- package/dist/flatbuffers/duc/duc-text-element.js +94 -0
- package/dist/flatbuffers/duc/duc-text-style.d.ts +44 -0
- package/dist/flatbuffers/duc/duc-text-style.js +128 -0
- package/dist/flatbuffers/duc/duc-ucs.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-ucs.js +49 -0
- package/dist/flatbuffers/duc/duc-view.d.ts +24 -0
- package/dist/flatbuffers/duc/duc-view.js +71 -0
- package/dist/flatbuffers/duc/duc-viewport-element.d.ts +36 -0
- package/dist/flatbuffers/duc/duc-viewport-element.js +102 -0
- package/dist/flatbuffers/duc/duc-viewport-style.d.ts +16 -0
- package/dist/flatbuffers/duc/duc-viewport-style.js +49 -0
- package/dist/flatbuffers/duc/duc-xray-element.d.ts +23 -0
- package/dist/flatbuffers/duc/duc-xray-element.js +66 -0
- package/dist/flatbuffers/duc/duc-xray-style.d.ts +17 -0
- package/dist/flatbuffers/duc/duc-xray-style.js +49 -0
- package/dist/flatbuffers/duc/dynamic-snap-settings.d.ts +17 -0
- package/dist/flatbuffers/duc/dynamic-snap-settings.js +56 -0
- package/dist/flatbuffers/duc/element-background.d.ts +14 -0
- package/dist/flatbuffers/duc/element-background.js +41 -0
- package/dist/flatbuffers/duc/element-content-base.d.ts +29 -0
- package/dist/flatbuffers/duc/element-content-base.js +80 -0
- package/dist/flatbuffers/duc/element-content-preference.d.ts +8 -0
- package/dist/flatbuffers/duc/element-content-preference.js +11 -0
- package/dist/flatbuffers/duc/element-stroke.d.ts +24 -0
- package/dist/flatbuffers/duc/element-stroke.js +66 -0
- package/dist/flatbuffers/duc/element-wrapper.d.ts +16 -0
- package/dist/flatbuffers/duc/element-wrapper.js +49 -0
- package/dist/flatbuffers/duc/element.d.ts +49 -0
- package/dist/flatbuffers/duc/element.js +106 -0
- package/dist/flatbuffers/duc/exported-data-state.d.ts +87 -0
- package/dist/flatbuffers/duc/exported-data-state.js +290 -0
- package/dist/flatbuffers/duc/fcfbetween-modifier.d.ts +17 -0
- package/dist/flatbuffers/duc/fcfbetween-modifier.js +48 -0
- package/dist/flatbuffers/duc/fcfdatum-definition.d.ts +16 -0
- package/dist/flatbuffers/duc/fcfdatum-definition.js +43 -0
- package/dist/flatbuffers/duc/fcfdatum-style.d.ts +14 -0
- package/dist/flatbuffers/duc/fcfdatum-style.js +41 -0
- package/dist/flatbuffers/duc/fcfframe-modifiers.d.ts +22 -0
- package/dist/flatbuffers/duc/fcfframe-modifiers.js +65 -0
- package/dist/flatbuffers/duc/fcflayout-style.d.ts +17 -0
- package/dist/flatbuffers/duc/fcflayout-style.js +56 -0
- package/dist/flatbuffers/duc/fcfprojected-zone-modifier.d.ts +13 -0
- package/dist/flatbuffers/duc/fcfprojected-zone-modifier.js +40 -0
- package/dist/flatbuffers/duc/fcfsegment-row.d.ts +17 -0
- package/dist/flatbuffers/duc/fcfsegment-row.js +55 -0
- package/dist/flatbuffers/duc/fcfsymbol-style.d.ts +13 -0
- package/dist/flatbuffers/duc/fcfsymbol-style.js +40 -0
- package/dist/flatbuffers/duc/feature-control-frame-segment.d.ts +22 -0
- package/dist/flatbuffers/duc/feature-control-frame-segment.js +65 -0
- package/dist/flatbuffers/duc/feature-modifier.d.ts +18 -0
- package/dist/flatbuffers/duc/feature-modifier.js +21 -0
- package/dist/flatbuffers/duc/gdt-symbol.d.ts +22 -0
- package/dist/flatbuffers/duc/gdt-symbol.js +25 -0
- package/dist/flatbuffers/duc/geometric-point.d.ts +10 -0
- package/dist/flatbuffers/duc/geometric-point.js +27 -0
- package/dist/flatbuffers/duc/grid-display-type.d.ts +6 -0
- package/dist/flatbuffers/duc/grid-display-type.js +9 -0
- package/dist/flatbuffers/duc/grid-settings.d.ts +54 -0
- package/dist/flatbuffers/duc/grid-settings.js +165 -0
- package/dist/flatbuffers/duc/grid-style.d.ts +26 -0
- package/dist/flatbuffers/duc/grid-style.js +74 -0
- package/dist/flatbuffers/duc/grid-type.d.ts +7 -0
- package/dist/flatbuffers/duc/grid-type.js +10 -0
- package/dist/flatbuffers/duc/handle-type.d.ts +4 -0
- package/dist/flatbuffers/duc/handle-type.js +7 -0
- package/dist/flatbuffers/duc/hatch-pattern-line.d.ts +35 -0
- package/dist/flatbuffers/duc/hatch-pattern-line.js +93 -0
- package/dist/flatbuffers/duc/hatch-style.d.ts +5 -0
- package/dist/flatbuffers/duc/hatch-style.js +8 -0
- package/dist/flatbuffers/duc/identified-common-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-common-style.js +44 -0
- package/dist/flatbuffers/duc/identified-dimension-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-dimension-style.js +44 -0
- package/dist/flatbuffers/duc/identified-doc-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-doc-style.js +44 -0
- package/dist/flatbuffers/duc/identified-fcfstyle.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-fcfstyle.js +44 -0
- package/dist/flatbuffers/duc/identified-grid-settings.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-grid-settings.js +44 -0
- package/dist/flatbuffers/duc/identified-hatch-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-hatch-style.js +44 -0
- package/dist/flatbuffers/duc/identified-leader-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-leader-style.js +44 -0
- package/dist/flatbuffers/duc/identified-snap-settings.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-snap-settings.js +44 -0
- package/dist/flatbuffers/duc/identified-stack-like-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-stack-like-style.js +44 -0
- package/dist/flatbuffers/duc/identified-table-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-table-style.js +44 -0
- package/dist/flatbuffers/duc/identified-text-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-text-style.js +44 -0
- package/dist/flatbuffers/duc/identified-ucs.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-ucs.js +44 -0
- package/dist/flatbuffers/duc/identified-view.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-view.js +44 -0
- package/dist/flatbuffers/duc/identified-viewport-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-viewport-style.js +44 -0
- package/dist/flatbuffers/duc/identified-xray-style.d.ts +16 -0
- package/dist/flatbuffers/duc/identified-xray-style.js +44 -0
- package/dist/flatbuffers/duc/identifier.d.ts +20 -0
- package/dist/flatbuffers/duc/identifier.js +57 -0
- package/dist/flatbuffers/duc/image-crop.d.ts +23 -0
- package/dist/flatbuffers/duc/image-crop.js +80 -0
- package/dist/flatbuffers/duc/image-status.d.ts +5 -0
- package/dist/flatbuffers/duc/image-status.js +8 -0
- package/dist/flatbuffers/duc/isometric-grid-settings.d.ts +15 -0
- package/dist/flatbuffers/duc/isometric-grid-settings.js +48 -0
- package/dist/flatbuffers/duc/jsonpatch-operation.d.ts +23 -0
- package/dist/flatbuffers/duc/jsonpatch-operation.js +64 -0
- package/dist/flatbuffers/duc/layer-snap-filters.d.ts +23 -0
- package/dist/flatbuffers/duc/layer-snap-filters.js +76 -0
- package/dist/flatbuffers/duc/layer-validation-rules.d.ts +17 -0
- package/dist/flatbuffers/duc/layer-validation-rules.js +54 -0
- package/dist/flatbuffers/duc/leader-block-content.d.ts +25 -0
- package/dist/flatbuffers/duc/leader-block-content.js +85 -0
- package/dist/flatbuffers/duc/leader-content-data.d.ts +9 -0
- package/dist/flatbuffers/duc/leader-content-data.js +26 -0
- package/dist/flatbuffers/duc/leader-content-type.d.ts +4 -0
- package/dist/flatbuffers/duc/leader-content-type.js +7 -0
- package/dist/flatbuffers/duc/leader-content.d.ts +19 -0
- package/dist/flatbuffers/duc/leader-content.js +58 -0
- package/dist/flatbuffers/duc/leader-text-block-content.d.ts +14 -0
- package/dist/flatbuffers/duc/leader-text-block-content.js +40 -0
- package/dist/flatbuffers/duc/line-head.d.ts +17 -0
- package/dist/flatbuffers/duc/line-head.js +20 -0
- package/dist/flatbuffers/duc/line-spacing-type.d.ts +5 -0
- package/dist/flatbuffers/duc/line-spacing-type.js +8 -0
- package/dist/flatbuffers/duc/line-spacing.d.ts +16 -0
- package/dist/flatbuffers/duc/line-spacing.js +49 -0
- package/dist/flatbuffers/duc/linear-unit-system.d.ts +24 -0
- package/dist/flatbuffers/duc/linear-unit-system.js +75 -0
- package/dist/flatbuffers/duc/margins.d.ts +19 -0
- package/dist/flatbuffers/duc/margins.js +64 -0
- package/dist/flatbuffers/duc/mark-ellipse-center.d.ts +4 -0
- package/dist/flatbuffers/duc/mark-ellipse-center.js +7 -0
- package/dist/flatbuffers/duc/material-condition.d.ts +5 -0
- package/dist/flatbuffers/duc/material-condition.js +8 -0
- package/dist/flatbuffers/duc/object-snap-mode.d.ts +22 -0
- package/dist/flatbuffers/duc/object-snap-mode.js +25 -0
- package/dist/flatbuffers/duc/paragraph-formatting.d.ts +33 -0
- package/dist/flatbuffers/duc/paragraph-formatting.js +106 -0
- package/dist/flatbuffers/duc/parametric-source-type.d.ts +4 -0
- package/dist/flatbuffers/duc/parametric-source-type.js +7 -0
- package/dist/flatbuffers/duc/parametric-source.d.ts +20 -0
- package/dist/flatbuffers/duc/parametric-source.js +57 -0
- package/dist/flatbuffers/duc/plot-layout.d.ts +14 -0
- package/dist/flatbuffers/duc/plot-layout.js +41 -0
- package/dist/flatbuffers/duc/point-binding-point.d.ts +15 -0
- package/dist/flatbuffers/duc/point-binding-point.js +48 -0
- package/dist/flatbuffers/duc/polar-grid-settings.d.ts +17 -0
- package/dist/flatbuffers/duc/polar-grid-settings.js +56 -0
- package/dist/flatbuffers/duc/polar-tracking-settings.d.ts +29 -0
- package/dist/flatbuffers/duc/polar-tracking-settings.js +90 -0
- package/dist/flatbuffers/duc/primary-units.d.ts +16 -0
- package/dist/flatbuffers/duc/primary-units.js +44 -0
- package/dist/flatbuffers/duc/pruning-level.d.ts +5 -0
- package/dist/flatbuffers/duc/pruning-level.js +8 -0
- package/dist/flatbuffers/duc/snap-marker-settings.d.ts +23 -0
- package/dist/flatbuffers/duc/snap-marker-settings.js +79 -0
- package/dist/flatbuffers/duc/snap-marker-shape.d.ts +6 -0
- package/dist/flatbuffers/duc/snap-marker-shape.js +9 -0
- package/dist/flatbuffers/duc/snap-marker-style-entry.d.ts +16 -0
- package/dist/flatbuffers/duc/snap-marker-style-entry.js +43 -0
- package/dist/flatbuffers/duc/snap-marker-style.d.ts +17 -0
- package/dist/flatbuffers/duc/snap-marker-style.js +49 -0
- package/dist/flatbuffers/duc/snap-mode.d.ts +4 -0
- package/dist/flatbuffers/duc/snap-mode.js +7 -0
- package/dist/flatbuffers/duc/snap-override-behavior.d.ts +5 -0
- package/dist/flatbuffers/duc/snap-override-behavior.js +8 -0
- package/dist/flatbuffers/duc/snap-override.d.ts +17 -0
- package/dist/flatbuffers/duc/snap-override.js +49 -0
- package/dist/flatbuffers/duc/snap-settings.d.ts +75 -0
- package/dist/flatbuffers/duc/snap-settings.js +245 -0
- package/dist/flatbuffers/duc/stack-format-properties.d.ts +18 -0
- package/dist/flatbuffers/duc/stack-format-properties.js +57 -0
- package/dist/flatbuffers/duc/stack-format.d.ts +21 -0
- package/dist/flatbuffers/duc/stack-format.js +64 -0
- package/dist/flatbuffers/duc/stacked-text-align.d.ts +5 -0
- package/dist/flatbuffers/duc/stacked-text-align.js +8 -0
- package/dist/flatbuffers/duc/standard-overrides.d.ts +63 -0
- package/dist/flatbuffers/duc/standard-overrides.js +162 -0
- package/dist/flatbuffers/duc/standard-styles.d.ts +77 -0
- package/dist/flatbuffers/duc/standard-styles.js +285 -0
- package/dist/flatbuffers/duc/standard-units.d.ts +16 -0
- package/dist/flatbuffers/duc/standard-units.js +44 -0
- package/dist/flatbuffers/duc/standard-validation.d.ts +16 -0
- package/dist/flatbuffers/duc/standard-validation.js +44 -0
- package/dist/flatbuffers/duc/standard-view-settings.d.ts +35 -0
- package/dist/flatbuffers/duc/standard-view-settings.js +124 -0
- package/dist/flatbuffers/duc/standard.d.ts +33 -0
- package/dist/flatbuffers/duc/standard.js +90 -0
- package/dist/flatbuffers/duc/string-value-entry.d.ts +17 -0
- package/dist/flatbuffers/duc/string-value-entry.js +49 -0
- package/dist/flatbuffers/duc/stroke-cap.d.ts +5 -0
- package/dist/flatbuffers/duc/stroke-cap.js +8 -0
- package/dist/flatbuffers/duc/stroke-join.d.ts +5 -0
- package/dist/flatbuffers/duc/stroke-join.js +8 -0
- package/dist/flatbuffers/duc/stroke-placement.d.ts +5 -0
- package/dist/flatbuffers/duc/stroke-placement.js +8 -0
- package/dist/flatbuffers/duc/stroke-preference.d.ts +6 -0
- package/dist/flatbuffers/duc/stroke-preference.js +9 -0
- package/dist/flatbuffers/duc/stroke-side-preference.d.ts +8 -0
- package/dist/flatbuffers/duc/stroke-side-preference.js +11 -0
- package/dist/flatbuffers/duc/stroke-sides.d.ts +24 -0
- package/dist/flatbuffers/duc/stroke-sides.js +67 -0
- package/dist/flatbuffers/duc/stroke-style.d.ts +37 -0
- package/dist/flatbuffers/duc/stroke-style.js +111 -0
- package/dist/flatbuffers/duc/stroke-width.d.ts +5 -0
- package/dist/flatbuffers/duc/stroke-width.js +8 -0
- package/dist/flatbuffers/duc/table-cell-alignment.d.ts +11 -0
- package/dist/flatbuffers/duc/table-cell-alignment.js +14 -0
- package/dist/flatbuffers/duc/table-flow-direction.d.ts +4 -0
- package/dist/flatbuffers/duc/table-flow-direction.js +7 -0
- package/dist/flatbuffers/duc/text-align.d.ts +5 -0
- package/dist/flatbuffers/duc/text-align.js +8 -0
- package/dist/flatbuffers/duc/text-column.d.ts +15 -0
- package/dist/flatbuffers/duc/text-column.js +48 -0
- package/dist/flatbuffers/duc/text-field-source-property.d.ts +13 -0
- package/dist/flatbuffers/duc/text-field-source-property.js +16 -0
- package/dist/flatbuffers/duc/text-field-source-type.d.ts +4 -0
- package/dist/flatbuffers/duc/text-field-source-type.js +7 -0
- package/dist/flatbuffers/duc/text-flow-direction.d.ts +6 -0
- package/dist/flatbuffers/duc/text-flow-direction.js +9 -0
- package/dist/flatbuffers/duc/tiling-properties.d.ts +21 -0
- package/dist/flatbuffers/duc/tiling-properties.js +75 -0
- package/dist/flatbuffers/duc/tolerance-clause.d.ts +27 -0
- package/dist/flatbuffers/duc/tolerance-clause.js +84 -0
- package/dist/flatbuffers/duc/tolerance-display.d.ts +7 -0
- package/dist/flatbuffers/duc/tolerance-display.js +10 -0
- package/dist/flatbuffers/duc/tolerance-type.d.ts +5 -0
- package/dist/flatbuffers/duc/tolerance-type.js +8 -0
- package/dist/flatbuffers/duc/tolerance-zone-type.d.ts +7 -0
- package/dist/flatbuffers/duc/tolerance-zone-type.js +10 -0
- package/dist/flatbuffers/duc/tracking-line-style.d.ts +26 -0
- package/dist/flatbuffers/duc/tracking-line-style.js +74 -0
- package/dist/flatbuffers/duc/unit-precision.d.ts +19 -0
- package/dist/flatbuffers/duc/unit-precision.js +64 -0
- package/dist/flatbuffers/duc/unit-system-base.d.ts +20 -0
- package/dist/flatbuffers/duc/unit-system-base.js +65 -0
- package/dist/flatbuffers/duc/unit-system.d.ts +4 -0
- package/dist/flatbuffers/duc/unit-system.js +7 -0
- package/dist/flatbuffers/duc/version-base.d.ts +27 -0
- package/dist/flatbuffers/duc/version-base.js +80 -0
- package/dist/flatbuffers/duc/version-graph-metadata.d.ts +15 -0
- package/dist/flatbuffers/duc/version-graph-metadata.js +48 -0
- package/dist/flatbuffers/duc/version-graph.d.ts +31 -0
- package/dist/flatbuffers/duc/version-graph.js +94 -0
- package/dist/flatbuffers/duc/vertical-align.d.ts +5 -0
- package/dist/flatbuffers/duc/vertical-align.js +8 -0
- package/dist/flatbuffers/duc/viewport-shade-plot.d.ts +6 -0
- package/dist/flatbuffers/duc/viewport-shade-plot.js +9 -0
- package/dist/flatbuffers/duc/youtube-states.d.ts +8 -0
- package/dist/flatbuffers/duc/youtube-states.js +11 -0
- package/dist/flatbuffers/duc.d.ts +227 -0
- package/dist/flatbuffers/duc.js +229 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/legacy/index.d.ts +1 -0
- package/dist/legacy/index.js +1 -0
- package/dist/legacy/v1/duc/app-state.d.ts +124 -0
- package/dist/legacy/v1/duc/app-state.js +388 -0
- package/dist/legacy/v1/duc/binary-file-data.d.ts +27 -0
- package/dist/legacy/v1/duc/binary-file-data.js +90 -0
- package/dist/legacy/v1/duc/binary-files-entry.d.ts +16 -0
- package/dist/legacy/v1/duc/binary-files-entry.js +43 -0
- package/dist/legacy/v1/duc/binary-files.d.ts +17 -0
- package/dist/legacy/v1/duc/binary-files.js +55 -0
- package/dist/legacy/v1/duc/binding-point.d.ts +15 -0
- package/dist/legacy/v1/duc/binding-point.js +48 -0
- package/dist/legacy/v1/duc/bound-element.d.ts +17 -0
- package/dist/legacy/v1/duc/bound-element.js +48 -0
- package/dist/legacy/v1/duc/duc-block-attribute-details.d.ts +22 -0
- package/dist/legacy/v1/duc/duc-block-attribute-details.js +57 -0
- package/dist/legacy/v1/duc/duc-block-attribute.d.ts +16 -0
- package/dist/legacy/v1/duc/duc-block-attribute.js +43 -0
- package/dist/legacy/v1/duc/duc-block-instance-element-override.d.ts +17 -0
- package/dist/legacy/v1/duc/duc-block-instance-element-override.js +48 -0
- package/dist/legacy/v1/duc/duc-block.d.ts +34 -0
- package/dist/legacy/v1/duc/duc-block.js +110 -0
- package/dist/legacy/v1/duc/duc-element.d.ts +273 -0
- package/dist/legacy/v1/duc/duc-element.js +865 -0
- package/dist/legacy/v1/duc/duc-group.d.ts +40 -0
- package/dist/legacy/v1/duc/duc-group.js +114 -0
- package/dist/legacy/v1/duc/duc-line-reference.d.ts +15 -0
- package/dist/legacy/v1/duc/duc-line-reference.js +43 -0
- package/dist/legacy/v1/duc/duc-line.d.ts +15 -0
- package/dist/legacy/v1/duc/duc-line.js +43 -0
- package/dist/legacy/v1/duc/duc-path.d.ts +26 -0
- package/dist/legacy/v1/duc/duc-path.js +69 -0
- package/dist/legacy/v1/duc/duc-table-cell.d.ts +22 -0
- package/dist/legacy/v1/duc/duc-table-cell.js +57 -0
- package/dist/legacy/v1/duc/duc-table-column.d.ts +18 -0
- package/dist/legacy/v1/duc/duc-table-column.js +50 -0
- package/dist/legacy/v1/duc/duc-table-row.d.ts +18 -0
- package/dist/legacy/v1/duc/duc-table-row.js +50 -0
- package/dist/legacy/v1/duc/duc-table-style-props.d.ts +39 -0
- package/dist/legacy/v1/duc/duc-table-style-props.js +114 -0
- package/dist/legacy/v1/duc/duc-table-style.d.ts +14 -0
- package/dist/legacy/v1/duc/duc-table-style.js +41 -0
- package/dist/legacy/v1/duc/element-background.d.ts +14 -0
- package/dist/legacy/v1/duc/element-background.js +41 -0
- package/dist/legacy/v1/duc/element-content-base.d.ts +22 -0
- package/dist/legacy/v1/duc/element-content-base.js +64 -0
- package/dist/legacy/v1/duc/element-stroke.d.ts +23 -0
- package/dist/legacy/v1/duc/element-stroke.js +66 -0
- package/dist/legacy/v1/duc/exported-data-state.d.ts +51 -0
- package/dist/legacy/v1/duc/exported-data-state.js +155 -0
- package/dist/legacy/v1/duc/image-crop.d.ts +23 -0
- package/dist/legacy/v1/duc/image-crop.js +80 -0
- package/dist/legacy/v1/duc/linear-element-editor.d.ts +44 -0
- package/dist/legacy/v1/duc/linear-element-editor.js +119 -0
- package/dist/legacy/v1/duc/point-binding.d.ts +25 -0
- package/dist/legacy/v1/duc/point-binding.js +72 -0
- package/dist/legacy/v1/duc/point.d.ts +20 -0
- package/dist/legacy/v1/duc/point.js +63 -0
- package/dist/legacy/v1/duc/pointer-down-state.d.ts +32 -0
- package/dist/legacy/v1/duc/pointer-down-state.js +90 -0
- package/dist/legacy/v1/duc/renderer-state.d.ts +17 -0
- package/dist/legacy/v1/duc/renderer-state.js +54 -0
- package/dist/legacy/v1/duc/segment-midpoint-state.d.ts +18 -0
- package/dist/legacy/v1/duc/segment-midpoint-state.js +57 -0
- package/dist/legacy/v1/duc/simple-point.d.ts +15 -0
- package/dist/legacy/v1/duc/simple-point.js +48 -0
- package/dist/legacy/v1/duc/stroke-sides.d.ts +23 -0
- package/dist/legacy/v1/duc/stroke-sides.js +66 -0
- package/dist/legacy/v1/duc/stroke-style.d.ts +31 -0
- package/dist/legacy/v1/duc/stroke-style.js +102 -0
- package/dist/legacy/v1/duc/tiling-properties.d.ts +21 -0
- package/dist/legacy/v1/duc/tiling-properties.js +75 -0
- package/dist/legacy/v1/duc.d.ts +35 -0
- package/dist/legacy/v1/duc.js +37 -0
- package/dist/legacy/v1/index.d.ts +1 -0
- package/dist/legacy/v1/index.js +1 -0
- package/dist/legacy/v1/parse/index.d.ts +67 -0
- package/dist/legacy/v1/parse/index.js +101 -0
- package/dist/legacy/v1/parse/parseAppStateFromBinary.d.ts +3 -0
- package/dist/legacy/v1/parse/parseAppStateFromBinary.js +139 -0
- package/dist/legacy/v1/parse/parseBinaryFilesFromBinary.d.ts +4 -0
- package/dist/legacy/v1/parse/parseBinaryFilesFromBinary.js +32 -0
- package/dist/legacy/v1/parse/parseBlockFromBinary.d.ts +3 -0
- package/dist/legacy/v1/parse/parseBlockFromBinary.js +70 -0
- package/dist/legacy/v1/parse/parseElementFromBinary.d.ts +8 -0
- package/dist/legacy/v1/parse/parseElementFromBinary.js +387 -0
- package/dist/legacy/v1/parse/parseGroupFromBinary.d.ts +4 -0
- package/dist/legacy/v1/parse/parseGroupFromBinary.js +36 -0
- package/dist/legacy/v1/parse/parseRendererStateFromBinary.d.ts +4 -0
- package/dist/legacy/v1/parse/parseRendererStateFromBinary.js +15 -0
- package/dist/legacy/v1/serialize/index.d.ts +5 -0
- package/dist/legacy/v1/serialize/index.js +81 -0
- package/dist/legacy/v1/serialize/serializationUtils.d.ts +17 -0
- package/dist/legacy/v1/serialize/serializationUtils.js +27 -0
- package/dist/legacy/v1/serialize/serializeAppStateFromDuc.d.ts +4 -0
- package/dist/legacy/v1/serialize/serializeAppStateFromDuc.js +145 -0
- package/dist/legacy/v1/serialize/serializeBinaryFilesFromDuc.d.ts +4 -0
- package/dist/legacy/v1/serialize/serializeBinaryFilesFromDuc.js +46 -0
- package/dist/legacy/v1/serialize/serializeBlockFromDuc.d.ts +3 -0
- package/dist/legacy/v1/serialize/serializeBlockFromDuc.js +60 -0
- package/dist/legacy/v1/serialize/serializeElementFromDuc.d.ts +8 -0
- package/dist/legacy/v1/serialize/serializeElementFromDuc.js +435 -0
- package/dist/legacy/v1/serialize/serializeGroupFromDuc.d.ts +3 -0
- package/dist/legacy/v1/serialize/serializeGroupFromDuc.js +37 -0
- package/dist/legacy/v1/serialize/serializeRendererStateFromDuc.d.ts +4 -0
- package/dist/legacy/v1/serialize/serializeRendererStateFromDuc.js +7 -0
- package/dist/legacy/v1/types/elements/index.d.ts +480 -0
- package/dist/legacy/v1/types/elements/index.js +1 -0
- package/dist/legacy/v1/types/elements/typeChecks.d.ts +40 -0
- package/dist/legacy/v1/types/elements/typeChecks.js +179 -0
- package/dist/legacy/v1/types/geometryTypes.d.ts +78 -0
- package/dist/legacy/v1/types/geometryTypes.js +1 -0
- package/dist/legacy/v1/types/index.d.ts +496 -0
- package/dist/legacy/v1/types/index.js +1 -0
- package/dist/legacy/v1/types/utility-types.d.ts +31 -0
- package/dist/legacy/v1/types/utility-types.js +1 -0
- package/dist/legacy/v1/utils/bounds.d.ts +76 -0
- package/dist/legacy/v1/utils/bounds.js +415 -0
- package/dist/legacy/v1/utils/constants.d.ts +370 -0
- package/dist/legacy/v1/utils/constants.js +571 -0
- package/dist/legacy/v1/utils/elements/index.d.ts +26 -0
- package/dist/legacy/v1/utils/elements/index.js +108 -0
- package/dist/legacy/v1/utils/elements/linearElement.d.ts +133 -0
- package/dist/legacy/v1/utils/elements/linearElement.js +544 -0
- package/dist/legacy/v1/utils/elements/textElement.d.ts +89 -0
- package/dist/legacy/v1/utils/elements/textElement.js +563 -0
- package/dist/legacy/v1/utils/index.d.ts +26 -0
- package/dist/legacy/v1/utils/index.js +40 -0
- package/dist/legacy/v1/utils/math/algebra/ga.d.ts +63 -0
- package/dist/legacy/v1/utils/math/algebra/ga.js +268 -0
- package/dist/legacy/v1/utils/math/algebra/gadirections.d.ts +9 -0
- package/dist/legacy/v1/utils/math/algebra/gadirections.js +18 -0
- package/dist/legacy/v1/utils/math/algebra/galines.d.ts +23 -0
- package/dist/legacy/v1/utils/math/algebra/galines.js +32 -0
- package/dist/legacy/v1/utils/math/algebra/gapoints.d.ts +8 -0
- package/dist/legacy/v1/utils/math/algebra/gapoints.js +30 -0
- package/dist/legacy/v1/utils/math/algebra/gatransforms.d.ts +10 -0
- package/dist/legacy/v1/utils/math/algebra/gatransforms.js +23 -0
- package/dist/legacy/v1/utils/math/bbox.d.ts +10 -0
- package/dist/legacy/v1/utils/math/bbox.js +42 -0
- package/dist/legacy/v1/utils/math/geometry.d.ts +102 -0
- package/dist/legacy/v1/utils/math/geometry.js +790 -0
- package/dist/legacy/v1/utils/math/index.d.ts +309 -0
- package/dist/legacy/v1/utils/math/index.js +1140 -0
- package/dist/legacy/v1/utils/math/random.d.ts +4 -0
- package/dist/legacy/v1/utils/math/random.js +25 -0
- package/dist/legacy/v1/utils/measurements.d.ts +33 -0
- package/dist/legacy/v1/utils/measurements.js +65 -0
- package/dist/legacy/v1/utils/normalize.d.ts +14 -0
- package/dist/legacy/v1/utils/normalize.js +49 -0
- package/dist/legacy/v1/utils/restore.d.ts +197 -0
- package/dist/legacy/v1/utils/restore.js +1255 -0
- package/dist/legacy/v1/utils/scopes.d.ts +260 -0
- package/dist/legacy/v1/utils/scopes.js +661 -0
- package/dist/legacy/v1/utils/standards.d.ts +12 -0
- package/dist/legacy/v1/utils/standards.js +10 -0
- package/dist/legacy/v1/utils/state/index.d.ts +2 -0
- package/dist/legacy/v1/utils/state/index.js +68 -0
- package/dist/legacy/v1/utils/url.d.ts +8 -0
- package/dist/legacy/v1/utils/url.js +33 -0
- package/dist/parse.d.ts +54 -0
- package/dist/parse.js +1318 -0
- package/dist/restore/index.d.ts +3 -0
- package/dist/restore/index.js +3 -0
- package/dist/restore/restoreDataState.d.ts +191 -0
- package/dist/restore/restoreDataState.js +716 -0
- package/dist/restore/restoreElements.d.ts +34 -0
- package/dist/restore/restoreElements.js +1281 -0
- package/dist/restore/restoreStandards.d.ts +8 -0
- package/dist/restore/restoreStandards.js +224 -0
- package/dist/serialize.d.ts +3 -0
- package/dist/serialize.js +2465 -0
- package/dist/technical/index.d.ts +3 -0
- package/dist/technical/index.js +3 -0
- package/dist/technical/measurements.d.ts +31 -0
- package/dist/technical/measurements.js +64 -0
- package/dist/technical/scopes.d.ts +261 -0
- package/dist/technical/scopes.js +661 -0
- package/dist/technical/standards.d.ts +124 -0
- package/dist/technical/standards.js +10 -0
- package/dist/types/elements/index.d.ts +1356 -0
- package/dist/types/elements/index.js +1 -0
- package/dist/types/elements/typeChecks.d.ts +40 -0
- package/dist/types/elements/typeChecks.js +188 -0
- package/dist/types/geometryTypes.d.ts +90 -0
- package/dist/types/geometryTypes.js +1 -0
- package/dist/types/index.d.ts +591 -0
- package/dist/types/index.js +3 -0
- package/dist/types/utility-types.d.ts +31 -0
- package/dist/types/utility-types.js +1 -0
- package/dist/utils/bounds.d.ts +75 -0
- package/dist/utils/bounds.js +414 -0
- package/dist/utils/constants.d.ts +288 -0
- package/dist/utils/constants.js +529 -0
- package/dist/utils/elements/frameElement.d.ts +4 -0
- package/dist/utils/elements/frameElement.js +16 -0
- package/dist/utils/elements/freedrawElement.d.ts +2 -0
- package/dist/utils/elements/freedrawElement.js +46 -0
- package/dist/utils/elements/index.d.ts +51 -0
- package/dist/utils/elements/index.js +215 -0
- package/dist/utils/elements/linearElement.d.ts +53 -0
- package/dist/utils/elements/linearElement.js +539 -0
- package/dist/utils/elements/newElement.d.ts +72 -0
- package/dist/utils/elements/newElement.js +268 -0
- package/dist/utils/elements/textElement.d.ts +89 -0
- package/dist/utils/elements/textElement.js +565 -0
- package/dist/utils/elements/viewportElement.d.ts +6 -0
- package/dist/utils/elements/viewportElement.js +9 -0
- package/dist/utils/filebyte.d.ts +39 -0
- package/dist/utils/filebyte.js +117 -0
- package/dist/utils/functionCodec.d.ts +5 -0
- package/dist/utils/functionCodec.js +86 -0
- package/dist/utils/index.d.ts +32 -0
- package/dist/utils/index.js +53 -0
- package/dist/utils/math/algebra/ga.d.ts +63 -0
- package/dist/utils/math/algebra/ga.js +268 -0
- package/dist/utils/math/algebra/gadirections.d.ts +9 -0
- package/dist/utils/math/algebra/gadirections.js +18 -0
- package/dist/utils/math/algebra/galines.d.ts +23 -0
- package/dist/utils/math/algebra/galines.js +32 -0
- package/dist/utils/math/algebra/gapoints.d.ts +8 -0
- package/dist/utils/math/algebra/gapoints.js +30 -0
- package/dist/utils/math/algebra/gatransforms.d.ts +10 -0
- package/dist/utils/math/algebra/gatransforms.js +23 -0
- package/dist/utils/math/algebra/index.d.ts +5 -0
- package/dist/utils/math/algebra/index.js +5 -0
- package/dist/utils/math/bbox.d.ts +10 -0
- package/dist/utils/math/bbox.js +42 -0
- package/dist/utils/math/geometry.d.ts +102 -0
- package/dist/utils/math/geometry.js +790 -0
- package/dist/utils/math/index.d.ts +323 -0
- package/dist/utils/math/index.js +1188 -0
- package/dist/utils/math/random.d.ts +4 -0
- package/dist/utils/math/random.js +25 -0
- package/dist/utils/normalize.d.ts +14 -0
- package/dist/utils/normalize.js +49 -0
- package/dist/utils/shape.d.ts +15 -0
- package/dist/utils/shape.js +254 -0
- package/dist/utils/state/grid.d.ts +7 -0
- package/dist/utils/state/grid.js +25 -0
- package/dist/utils/state/index.d.ts +9 -0
- package/dist/utils/state/index.js +131 -0
- package/dist/utils/url.d.ts +8 -0
- package/dist/utils/url.js +33 -0
- package/dist/utils/version.d.ts +1 -0
- package/dist/utils/version.js +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,1356 @@
|
|
|
1
|
+
export * from "./typeChecks";
|
|
2
|
+
import { BEZIER_MIRRORING, BLENDING, BLOCK_ATTACHMENT, BOOLEAN_OPERATION, COLUMN_TYPE, DATUM_BRACKET_STYLE, DATUM_TARGET_TYPE, DIMENSION_FIT_RULE, DIMENSION_TEXT_PLACEMENT, DIMENSION_TYPE, ELEMENT_CONTENT_PREFERENCE, FEATURE_MODIFIER, GDT_SYMBOL, HATCH_STYLE, IMAGE_STATUS, LINE_HEAD, LINE_SPACING_TYPE, MARK_ELLIPSE_CENTER, MATERIAL_CONDITION, PARAMETRIC_SOURCE_TYPE, STACKED_TEXT_ALIGN, STROKE_CAP, STROKE_JOIN, STROKE_PLACEMENT, STROKE_PREFERENCE, STROKE_SIDE_PREFERENCE, TABLE_CELL_ALIGNMENT, TABLE_FLOW_DIRECTION, TEXT_ALIGN, TEXT_FIELD_SOURCE_PROPERTY, TEXT_FIELD_SOURCE_TYPE, TEXT_FLOW_DIRECTION, TOLERANCE_DISPLAY, TOLERANCE_TYPE, TOLERANCE_ZONE_TYPE, VERTICAL_ALIGN, VIEWPORT_SHADE_PLOT } from "ducjs/flatbuffers/duc";
|
|
3
|
+
import { Standard, StandardUnits } from "ducjs/technical/standards";
|
|
4
|
+
import { DucView, PrecisionValue, Scope } from "ducjs/types";
|
|
5
|
+
import { Axis, GeometricPoint, Percentage, Radian, ScaleFactor } from "ducjs/types/geometryTypes";
|
|
6
|
+
import { MakeBrand, MarkNonNullable, MarkOptional, Merge, ValueOf } from "ducjs/types/utility-types";
|
|
7
|
+
import { FONT_FAMILY, FREEDRAW_EASINGS } from "ducjs/utils/constants";
|
|
8
|
+
/**
|
|
9
|
+
* Base styles that all elements share
|
|
10
|
+
*/
|
|
11
|
+
export type _DucElementStylesBase = {
|
|
12
|
+
roundness: PrecisionValue;
|
|
13
|
+
blending?: Blending;
|
|
14
|
+
/** @deprecated
|
|
15
|
+
* Use stroke.content.src instead
|
|
16
|
+
*/
|
|
17
|
+
strokeColor?: string;
|
|
18
|
+
/** @deprecated
|
|
19
|
+
* Use background.content.src instead
|
|
20
|
+
*/
|
|
21
|
+
backgroundColor?: string;
|
|
22
|
+
background: ElementBackground[];
|
|
23
|
+
stroke: ElementStroke[];
|
|
24
|
+
opacity: Percentage;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Base element properties that all elements share
|
|
28
|
+
*/
|
|
29
|
+
export type _DucElementBase = Readonly<_DucElementStylesBase & {
|
|
30
|
+
id: string;
|
|
31
|
+
x: PrecisionValue;
|
|
32
|
+
y: PrecisionValue;
|
|
33
|
+
/**
|
|
34
|
+
* The scope where the element is currently
|
|
35
|
+
* mm, cm, m, in, ft, yd, mi, etc...
|
|
36
|
+
*/
|
|
37
|
+
scope: Scope;
|
|
38
|
+
label: string;
|
|
39
|
+
isVisible: boolean;
|
|
40
|
+
width: PrecisionValue;
|
|
41
|
+
height: PrecisionValue;
|
|
42
|
+
angle: Radian;
|
|
43
|
+
/** Random integer used to seed shape generation
|
|
44
|
+
doesn't differ across renders. */
|
|
45
|
+
seed: number;
|
|
46
|
+
/** Integer that is sequentially incremented on each change. Used to reconcile
|
|
47
|
+
elements during collaboration or when saving to server. */
|
|
48
|
+
version: number;
|
|
49
|
+
/** Random integer that is regenerated on each change.
|
|
50
|
+
Used for deterministic reconciliation of updates during collaboration,
|
|
51
|
+
in case the versions (see above) are identical. */
|
|
52
|
+
versionNonce: number;
|
|
53
|
+
/** Whether the element is a plot (i.e. visible on plotting) */
|
|
54
|
+
isPlot: boolean;
|
|
55
|
+
/** Whether the element is annotative (scales with DucViewport) */
|
|
56
|
+
isAnnotative: boolean;
|
|
57
|
+
/** Whether the element is deleted */
|
|
58
|
+
isDeleted: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* List of groups the element belongs to.
|
|
61
|
+
* Ordered from deepest to shallowest.
|
|
62
|
+
*/
|
|
63
|
+
groupIds: readonly GroupId[];
|
|
64
|
+
/**
|
|
65
|
+
* List of regions the element belongs.
|
|
66
|
+
* Used to define boolean operations between elements.
|
|
67
|
+
* Ordered from deepest to shallowest.
|
|
68
|
+
*/
|
|
69
|
+
regionIds: readonly RegionId[];
|
|
70
|
+
/** The layer the element belongs to */
|
|
71
|
+
layerId: string | null;
|
|
72
|
+
/** The frame the element belongs to */
|
|
73
|
+
frameId: string | null;
|
|
74
|
+
/** other elements that are bound to this element
|
|
75
|
+
* if we mutate this element, the bound elements will be updated automatically
|
|
76
|
+
* for transform properties like x, y, angle, etc.
|
|
77
|
+
*/
|
|
78
|
+
boundElements: readonly Readonly<BoundElement>[] | null;
|
|
79
|
+
/** z-index of the element in the scene
|
|
80
|
+
* Explicit stacking order, higher values are rendered on top
|
|
81
|
+
*/
|
|
82
|
+
zIndex: number;
|
|
83
|
+
/** epoch (ms) timestamp of last element update */
|
|
84
|
+
updated: number;
|
|
85
|
+
/** String in a fractional form defined by https://github.com/rocicorp/fractional-indexing.
|
|
86
|
+
Used for ordering in multiplayer scenarios, such as during reconciliation or undo / redo.
|
|
87
|
+
Always kept in sync with the array order by `syncMovedIndices` and `syncInvalidIndices`.
|
|
88
|
+
Could be null, i.e. for new elements which were not yet assigned to the scene. */
|
|
89
|
+
index: FractionalIndex | null;
|
|
90
|
+
link: string | null;
|
|
91
|
+
locked: boolean;
|
|
92
|
+
description: string | null;
|
|
93
|
+
customData?: Record<string, any>;
|
|
94
|
+
}>;
|
|
95
|
+
export type FillStyle = ValueOf<typeof ELEMENT_CONTENT_PREFERENCE>;
|
|
96
|
+
export type StrokePlacement = ValueOf<typeof STROKE_PLACEMENT>;
|
|
97
|
+
export type Blending = ValueOf<typeof BLENDING>;
|
|
98
|
+
export type GroupId = string;
|
|
99
|
+
export type LayerId = string;
|
|
100
|
+
export type RegionId = string;
|
|
101
|
+
export type PointerType = "mouse" | "pen" | "touch";
|
|
102
|
+
export type FractionalIndex = string & {
|
|
103
|
+
_brand: "franctionalIndex";
|
|
104
|
+
};
|
|
105
|
+
export type ImageStatus = ValueOf<typeof IMAGE_STATUS>;
|
|
106
|
+
export type ExternalFileId = string & {
|
|
107
|
+
_brand: "ExternalFileId";
|
|
108
|
+
};
|
|
109
|
+
export type BooleanOperation = ValueOf<typeof BOOLEAN_OPERATION>;
|
|
110
|
+
/**
|
|
111
|
+
* Map of duc elements.
|
|
112
|
+
* Unspecified whether deleted or non-deleted.
|
|
113
|
+
* Can be a subset of Scene elements.
|
|
114
|
+
*/
|
|
115
|
+
export type ElementsMap = Map<DucElement["id"], DucElement>;
|
|
116
|
+
/**
|
|
117
|
+
* These are elements that don't have any additional properties.
|
|
118
|
+
*/
|
|
119
|
+
export type DucGenericElement = DucSelectionElement | DucRectangleElement;
|
|
120
|
+
/**
|
|
121
|
+
* DucElement should be JSON serializable and (eventually) contain
|
|
122
|
+
* no computed data. The list of all DucElements should be shareable
|
|
123
|
+
* between peers and contain no state local to the peer.
|
|
124
|
+
*/
|
|
125
|
+
export type DucElement = DucGenericElement | DucTextElement | DucLinearElement | DucFreeDrawElement | DucArrowElement | DucImageElement | DucFrameElement | DucEmbeddableElement | DucTableElement | DucDocElement | DucEllipseElement | DucBlockInstanceElement | DucPolygonElement | DucParametricElement | DucFeatureControlFrameElement | DucLeaderElement | DucDimensionElement | DucViewportElement | DucPlotElement | DucXRayElement | DucPdfElement | DucMermaidElement;
|
|
126
|
+
export type DucElementTypes = DucElement["type"];
|
|
127
|
+
export type NonDeleted<TElement extends DucElement> = TElement & {
|
|
128
|
+
isDeleted: boolean;
|
|
129
|
+
};
|
|
130
|
+
export type NonDeletedDucElement = NonDeleted<DucElement> & {
|
|
131
|
+
idx?: number;
|
|
132
|
+
};
|
|
133
|
+
export type DucBinderElement = DucLinearElement | DucDimensionElement | DucFeatureControlFrameElement | DucLeaderElement;
|
|
134
|
+
export type DucBindableElement = DucRectangleElement | DucPolygonElement | DucEllipseElement | DucTextElement | DucImageElement | DucEmbeddableElement | DucFrameElement | DucTableElement | DucDocElement | DucFeatureControlFrameElement | DucLinearElement | DucPdfElement | DucMermaidElement;
|
|
135
|
+
export type DucTextContainer = DucRectangleElement | DucPolygonElement | DucEllipseElement | DucArrowElement;
|
|
136
|
+
export type DucFlowchartNodeElement = DucRectangleElement | DucPolygonElement | DucEllipseElement;
|
|
137
|
+
export type RectangularElement = DucRectangleElement | DucPolygonElement | DucFrameLikeElement | DucEmbeddableElement | DucImageElement | DucTextElement | DucSelectionElement | DucDocElement | DucTableElement | DucFeatureControlFrameElement | DucViewportElement | DucPlotElement | DucPdfElement | DucBlockInstanceElement;
|
|
138
|
+
export type DucStackLikeElement = DucPlotElement | DucViewportElement | DucFrameElement;
|
|
139
|
+
export type DucLinearLikeElement = DucLinearElement | DucViewportElement | DucArrowElement;
|
|
140
|
+
export type DucFrameLikeElement = DucPlotElement | DucFrameElement;
|
|
141
|
+
export type DucIframeLikeElement = DucEmbeddableElement | DucTableElement | DucDocElement;
|
|
142
|
+
export type ElementConstructorOpts = MarkOptional<Omit<DucGenericElement, "id" | "type" | "isDeleted" | "updated">, "width" | "height" | "angle" | "groupIds" | "frameId" | "index" | "boundElements" | "seed" | "version" | "versionNonce" | "link" | "background" | "stroke" | "roundness" | "locked" | "opacity" | "customData" | "isVisible" | "description" | "scope" | "blending" | "isPlot" | "isAnnotative" | "regionIds" | "layerId">;
|
|
143
|
+
export type ElementUpdate<TElement extends DucElement> = Omit<Partial<TElement>, "id" | "version" | "versionNonce" | "updated">;
|
|
144
|
+
export type DucElementType = DucElement["type"];
|
|
145
|
+
export type DucCommonStyle = {
|
|
146
|
+
background: ElementBackground;
|
|
147
|
+
stroke: ElementStroke;
|
|
148
|
+
};
|
|
149
|
+
export type DucElementsIncludingDeleted = readonly DucElement[];
|
|
150
|
+
/**
|
|
151
|
+
* Map of non-deleted elements.
|
|
152
|
+
* Can be a subset of Scene elements.
|
|
153
|
+
*/
|
|
154
|
+
export type NonDeletedElementsMap = Map<DucElement["id"], NonDeletedDucElement> & MakeBrand<"NonDeletedElementsMap">;
|
|
155
|
+
/**
|
|
156
|
+
* Map of all duc Scene elements, including deleted.
|
|
157
|
+
* Not a subset. Use this type when you need access to current Scene elements.
|
|
158
|
+
*/
|
|
159
|
+
export type SceneElementsMap = Map<DucElement["id"], DucElement> & MakeBrand<"SceneElementsMap">;
|
|
160
|
+
/**
|
|
161
|
+
* Map of all non-deleted Scene elements.
|
|
162
|
+
* Not a subset. Use this type when you need access to current Scene elements.
|
|
163
|
+
*/
|
|
164
|
+
export type NonDeletedSceneElementsMap = Map<DucElement["id"], NonDeletedDucElement> & MakeBrand<"NonDeletedSceneElementsMap">;
|
|
165
|
+
export type ElementsMapOrArray = readonly DucElement[] | Readonly<ElementsMap>;
|
|
166
|
+
export type OptionalDucElementBase = Partial<_DucElementBase>;
|
|
167
|
+
export type OptionalDucGroup = Partial<DucGroup>;
|
|
168
|
+
export type Ordered<TElement extends DucElement> = TElement & {
|
|
169
|
+
index: FractionalIndex;
|
|
170
|
+
};
|
|
171
|
+
export type OrderedDucElement = Ordered<DucElement>;
|
|
172
|
+
export type DucNonSelectionElement = Exclude<DucElement, DucSelectionElement>;
|
|
173
|
+
export type HatchStyle = ValueOf<typeof HATCH_STYLE>;
|
|
174
|
+
/**
|
|
175
|
+
* Pattern line definition for custom hatch patterns
|
|
176
|
+
*/
|
|
177
|
+
export type HatchPatternLine = {
|
|
178
|
+
/** Line angle in radians */
|
|
179
|
+
angle: Radian;
|
|
180
|
+
/** Line origin point */
|
|
181
|
+
origin: DucPoint;
|
|
182
|
+
/** Offset between parallel lines [x, y] */
|
|
183
|
+
offset: [PrecisionValue, PrecisionValue];
|
|
184
|
+
/** Dash pattern (empty array = solid line) */
|
|
185
|
+
dashPattern: PrecisionValue[];
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* Custom hatch pattern definition
|
|
189
|
+
*/
|
|
190
|
+
export type CustomHatchPattern = {
|
|
191
|
+
/** Pattern name */
|
|
192
|
+
name: string;
|
|
193
|
+
/** Pattern description */
|
|
194
|
+
description?: string;
|
|
195
|
+
/** Pattern line definitions */
|
|
196
|
+
lines: HatchPatternLine[];
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* Hatch style configuration
|
|
200
|
+
*/
|
|
201
|
+
export type DucHatchStyle = {
|
|
202
|
+
/** Default hatch style */
|
|
203
|
+
hatchStyle: HatchStyle;
|
|
204
|
+
/** Default pattern properties */
|
|
205
|
+
pattern: {
|
|
206
|
+
/** Pattern name (for predefined) or reference to custom pattern */
|
|
207
|
+
name: string;
|
|
208
|
+
/** Pattern scale factor */
|
|
209
|
+
scale: number;
|
|
210
|
+
/** Pattern rotation angle */
|
|
211
|
+
angle: Radian;
|
|
212
|
+
/** Pattern origin point */
|
|
213
|
+
origin: DucPoint;
|
|
214
|
+
/** Double pattern (second pattern at 90 degrees) */
|
|
215
|
+
double: boolean;
|
|
216
|
+
};
|
|
217
|
+
customPattern?: CustomHatchPattern;
|
|
218
|
+
};
|
|
219
|
+
export type TilingProperties = {
|
|
220
|
+
sizeInPercent: Percentage;
|
|
221
|
+
angle: Radian;
|
|
222
|
+
spacing?: number;
|
|
223
|
+
offsetX?: number;
|
|
224
|
+
offsetY?: number;
|
|
225
|
+
};
|
|
226
|
+
export type StrokePreference = ValueOf<typeof STROKE_PREFERENCE>;
|
|
227
|
+
export type StrokeCap = ValueOf<typeof STROKE_CAP>;
|
|
228
|
+
export type StrokeJoin = ValueOf<typeof STROKE_JOIN>;
|
|
229
|
+
export type StrokeStyle = {
|
|
230
|
+
preference: StrokePreference;
|
|
231
|
+
/**
|
|
232
|
+
* The cap of the stroke
|
|
233
|
+
* @default butt
|
|
234
|
+
*/
|
|
235
|
+
cap?: StrokeCap;
|
|
236
|
+
/**
|
|
237
|
+
* The join of the stroke
|
|
238
|
+
* @default miter
|
|
239
|
+
*/
|
|
240
|
+
join?: StrokeJoin;
|
|
241
|
+
/**
|
|
242
|
+
* The dash of the stroke
|
|
243
|
+
* @default [ 2, 2 ]
|
|
244
|
+
*/
|
|
245
|
+
dash?: number[];
|
|
246
|
+
/**
|
|
247
|
+
* Override the dash line into a custom shape
|
|
248
|
+
*/
|
|
249
|
+
dashLineOverride?: DucBlockInstanceElement["id"];
|
|
250
|
+
/**
|
|
251
|
+
* The cap of the dash
|
|
252
|
+
* @default butt
|
|
253
|
+
*/
|
|
254
|
+
dashCap?: StrokeCap;
|
|
255
|
+
/**
|
|
256
|
+
* The miter limit of the stroke
|
|
257
|
+
*/
|
|
258
|
+
miterLimit?: number;
|
|
259
|
+
};
|
|
260
|
+
export type StrokeSidePreference = ValueOf<typeof STROKE_SIDE_PREFERENCE>;
|
|
261
|
+
export type StrokeSides = {
|
|
262
|
+
preference: StrokeSidePreference;
|
|
263
|
+
values?: number[];
|
|
264
|
+
};
|
|
265
|
+
export type ElementContentBase = {
|
|
266
|
+
preference: FillStyle;
|
|
267
|
+
src: string;
|
|
268
|
+
visible: boolean;
|
|
269
|
+
opacity: Percentage;
|
|
270
|
+
tiling?: TilingProperties;
|
|
271
|
+
hatch?: DucHatchStyle;
|
|
272
|
+
imageFilter?: DucImageFilter;
|
|
273
|
+
};
|
|
274
|
+
export type ElementStroke = {
|
|
275
|
+
content: ElementContentBase;
|
|
276
|
+
width: PrecisionValue;
|
|
277
|
+
style: StrokeStyle;
|
|
278
|
+
placement: StrokePlacement;
|
|
279
|
+
strokeSides?: StrokeSides;
|
|
280
|
+
};
|
|
281
|
+
export type ElementBackground = {
|
|
282
|
+
content: ElementContentBase;
|
|
283
|
+
};
|
|
284
|
+
export type DucSelectionElement = _DucElementBase & {
|
|
285
|
+
type: "selection";
|
|
286
|
+
};
|
|
287
|
+
export type DucRectangleElement = _DucElementBase & {
|
|
288
|
+
type: "rectangle";
|
|
289
|
+
};
|
|
290
|
+
export type DucPolygonElement = _DucElementBase & {
|
|
291
|
+
type: "polygon";
|
|
292
|
+
/**
|
|
293
|
+
* number of sides of the polygon
|
|
294
|
+
*/
|
|
295
|
+
sides: number;
|
|
296
|
+
};
|
|
297
|
+
export type DucEllipseElement = _DucElementBase & {
|
|
298
|
+
type: "ellipse";
|
|
299
|
+
ratio: Percentage;
|
|
300
|
+
startAngle: Radian;
|
|
301
|
+
endAngle: Radian;
|
|
302
|
+
showAuxCrosshair: boolean;
|
|
303
|
+
};
|
|
304
|
+
export type DucEmbeddableElement = _DucElementBase & {
|
|
305
|
+
type: "embeddable";
|
|
306
|
+
};
|
|
307
|
+
export type DucPdfElement = _DucElementBase & {
|
|
308
|
+
type: "pdf";
|
|
309
|
+
fileId: ExternalFileId | null;
|
|
310
|
+
};
|
|
311
|
+
export type DucMermaidElement = _DucElementBase & {
|
|
312
|
+
type: "mermaid";
|
|
313
|
+
source: string;
|
|
314
|
+
/** if not provided, the theme will be the same as the document's theme, or default to 'default'
|
|
315
|
+
* we decided to go with a string type because of the unpredictably of having different themes
|
|
316
|
+
*/
|
|
317
|
+
theme?: string;
|
|
318
|
+
svgPath: string | null;
|
|
319
|
+
};
|
|
320
|
+
export type TableCellAlignment = ValueOf<typeof TABLE_CELL_ALIGNMENT>;
|
|
321
|
+
export type TableFlowDirection = ValueOf<typeof TABLE_FLOW_DIRECTION>;
|
|
322
|
+
/**
|
|
323
|
+
* Defines the styling for an individual cell or a default for all cells.
|
|
324
|
+
* These properties can be overridden at the row, column, and individual cell levels.
|
|
325
|
+
*/
|
|
326
|
+
export type DucTableCellStyle = _DucElementStylesBase & {
|
|
327
|
+
/** The text style for content within the cell */
|
|
328
|
+
textStyle: DucTextStyle;
|
|
329
|
+
/** Margin space inside the cell, between the content and the border */
|
|
330
|
+
margins: {
|
|
331
|
+
top: PrecisionValue;
|
|
332
|
+
right: PrecisionValue;
|
|
333
|
+
bottom: PrecisionValue;
|
|
334
|
+
left: PrecisionValue;
|
|
335
|
+
};
|
|
336
|
+
/** The alignment of content within the cell */
|
|
337
|
+
alignment: TableCellAlignment;
|
|
338
|
+
};
|
|
339
|
+
/**
|
|
340
|
+
* Defines the overall style for a DucTableElement.
|
|
341
|
+
* It sets the defaults for rows, columns, and cells, which can be
|
|
342
|
+
* individually overridden.
|
|
343
|
+
*/
|
|
344
|
+
export type DucTableStyle = _DucElementStylesBase & {
|
|
345
|
+
/** The direction in which new rows are added */
|
|
346
|
+
flowDirection: TableFlowDirection;
|
|
347
|
+
/** Default style for the header row(s) */
|
|
348
|
+
headerRowStyle: DucTableCellStyle;
|
|
349
|
+
/** Default style for the data row(s) */
|
|
350
|
+
dataRowStyle: DucTableCellStyle;
|
|
351
|
+
/** Default style for the data column(s) */
|
|
352
|
+
dataColumnStyle: DucTableCellStyle;
|
|
353
|
+
};
|
|
354
|
+
export type DucTableColumn = {
|
|
355
|
+
id: string;
|
|
356
|
+
width: PrecisionValue;
|
|
357
|
+
/** Style overrides for this column */
|
|
358
|
+
styleOverrides?: Partial<DucTableCellStyle>;
|
|
359
|
+
};
|
|
360
|
+
export type DucTableRow = {
|
|
361
|
+
id: string;
|
|
362
|
+
height: PrecisionValue;
|
|
363
|
+
/** Style overrides for this row */
|
|
364
|
+
styleOverrides?: Partial<DucTableCellStyle>;
|
|
365
|
+
};
|
|
366
|
+
export type DucTableCell = {
|
|
367
|
+
rowId: string;
|
|
368
|
+
columnId: string;
|
|
369
|
+
/**
|
|
370
|
+
* The content of the cell, stored as a Markdown string. This allows for rich text
|
|
371
|
+
* within cells without complicating the table's main data structure.
|
|
372
|
+
*/
|
|
373
|
+
data: string;
|
|
374
|
+
/**
|
|
375
|
+
* Defines if and how this cell merges with adjacent cells.
|
|
376
|
+
* A span of 1 means no merging.
|
|
377
|
+
* The root cell of a merge (top-left) holds the content and span data.
|
|
378
|
+
* Other cells covered by the span are effectively hidden.
|
|
379
|
+
*/
|
|
380
|
+
span?: {
|
|
381
|
+
/** Number of columns this cell spans to the right */
|
|
382
|
+
columns: number;
|
|
383
|
+
/** Number of rows this cell spans downwards */
|
|
384
|
+
rows: number;
|
|
385
|
+
};
|
|
386
|
+
/** Whether the content of this cell can be edited */
|
|
387
|
+
locked: boolean;
|
|
388
|
+
/**
|
|
389
|
+
* Style overrides for this specific cell.
|
|
390
|
+
* Any property set here will take precedence over row, column, and table styles.
|
|
391
|
+
*/
|
|
392
|
+
styleOverrides?: Partial<DucTableCellStyle>;
|
|
393
|
+
};
|
|
394
|
+
/**
|
|
395
|
+
* A structured table element composed of rows, columns, and cells.
|
|
396
|
+
* Its data is normalized for efficient updates, and styling is applied
|
|
397
|
+
* hierarchically. The element's base `stroke` and `background` style the
|
|
398
|
+
* outer border and fill.
|
|
399
|
+
*/
|
|
400
|
+
export type DucTableElement = _DucElementBase & DucTableStyle & {
|
|
401
|
+
type: "table";
|
|
402
|
+
/** An ordered list of column IDs, defining the horizontal layout */
|
|
403
|
+
columnOrder: readonly string[];
|
|
404
|
+
/** An ordered list of row IDs, defining the vertical layout */
|
|
405
|
+
rowOrder: readonly string[];
|
|
406
|
+
/** A record of all column definitions, keyed by their ID */
|
|
407
|
+
columns: Record<string, DucTableColumn>;
|
|
408
|
+
/** A record of all row definitions, keyed by their ID */
|
|
409
|
+
rows: Record<string, DucTableRow>;
|
|
410
|
+
/**
|
|
411
|
+
* A record of all cell data, keyed by a composite "rowId:columnId" string.
|
|
412
|
+
* This flat structure is efficient for lookups and updates.
|
|
413
|
+
*/
|
|
414
|
+
cells: Record<string, DucTableCell>;
|
|
415
|
+
/** Number of top rows to be treated as headers, using the headerRowStyle */
|
|
416
|
+
headerRowCount: number;
|
|
417
|
+
/** Whether table auto-sizes to content */
|
|
418
|
+
autoSize: {
|
|
419
|
+
columns: boolean;
|
|
420
|
+
rows: boolean;
|
|
421
|
+
};
|
|
422
|
+
};
|
|
423
|
+
export type ImageCrop = {
|
|
424
|
+
x: number;
|
|
425
|
+
y: number;
|
|
426
|
+
width: number;
|
|
427
|
+
height: number;
|
|
428
|
+
naturalWidth: number;
|
|
429
|
+
naturalHeight: number;
|
|
430
|
+
};
|
|
431
|
+
export type DucImageFilter = {
|
|
432
|
+
brightness: Percentage;
|
|
433
|
+
contrast: Percentage;
|
|
434
|
+
};
|
|
435
|
+
export type DucImageElement = _DucElementBase & {
|
|
436
|
+
type: "image";
|
|
437
|
+
fileId: ExternalFileId | null;
|
|
438
|
+
/** whether respective file is persisted */
|
|
439
|
+
status: ImageStatus;
|
|
440
|
+
/** X and Y scale factors <-1, 1>, used for image axis flipping */
|
|
441
|
+
scaleFlip: [number, number];
|
|
442
|
+
/** whether an element is cropped */
|
|
443
|
+
crop: ImageCrop | null;
|
|
444
|
+
filter: DucImageFilter | null;
|
|
445
|
+
};
|
|
446
|
+
export type InitializedDucImageElement = MarkNonNullable<DucImageElement, "fileId">;
|
|
447
|
+
export type FontFamilyKeys = keyof typeof FONT_FAMILY;
|
|
448
|
+
export type FontFamilyValues = typeof FONT_FAMILY[FontFamilyKeys];
|
|
449
|
+
export type FontString = string & {
|
|
450
|
+
_brand: "fontString";
|
|
451
|
+
};
|
|
452
|
+
export type TextAlign = ValueOf<typeof TEXT_ALIGN>;
|
|
453
|
+
export type VerticalAlign = ValueOf<typeof VERTICAL_ALIGN>;
|
|
454
|
+
export type LineSpacingType = ValueOf<typeof LINE_SPACING_TYPE>;
|
|
455
|
+
export type TextFieldSourceProperty = ValueOf<typeof TEXT_FIELD_SOURCE_PROPERTY>;
|
|
456
|
+
export type DucTextStyle = _DucElementStylesBase & {
|
|
457
|
+
/**
|
|
458
|
+
* Whether the text is left-to-right or right-to-left
|
|
459
|
+
* @default true
|
|
460
|
+
*/
|
|
461
|
+
isLtr: boolean;
|
|
462
|
+
/**
|
|
463
|
+
* The primary font family to use for the text
|
|
464
|
+
*/
|
|
465
|
+
fontFamily: FontFamilyValues;
|
|
466
|
+
/**
|
|
467
|
+
* Fallback font family for broader compatibility across all systems and languages
|
|
468
|
+
* Useful for emojis, non-latin characters, etc.
|
|
469
|
+
*/
|
|
470
|
+
bigFontFamily: string;
|
|
471
|
+
/** Horizontal alignment of the text within its bounding box */
|
|
472
|
+
textAlign: TextAlign;
|
|
473
|
+
/** Vertical alignment of the text within its bounding box */
|
|
474
|
+
verticalAlign: VerticalAlign;
|
|
475
|
+
/**
|
|
476
|
+
* Unitless line height multiplier (follows W3C standard).
|
|
477
|
+
* Actual line height in drawing units = fontSize × lineHeight
|
|
478
|
+
* Use `getLineHeightInPx` helper for pixel calculations.
|
|
479
|
+
*
|
|
480
|
+
* @example 1.2 means 20% extra space between lines
|
|
481
|
+
*/
|
|
482
|
+
lineHeight: number & {
|
|
483
|
+
_brand: "unitlessLineHeight";
|
|
484
|
+
};
|
|
485
|
+
/**
|
|
486
|
+
* Defines the line spacing properties for text.
|
|
487
|
+
*/
|
|
488
|
+
lineSpacing: {
|
|
489
|
+
/**
|
|
490
|
+
* The numerical value for the line spacing.
|
|
491
|
+
* Its interpretation depends on the `type` property.
|
|
492
|
+
*/
|
|
493
|
+
value: PrecisionValue | ScaleFactor;
|
|
494
|
+
/**
|
|
495
|
+
* Determines how the line spacing factor is applied.
|
|
496
|
+
* - `at_least`: The line spacing is the larger of the `value` or the tallest character's natural height.
|
|
497
|
+
* This ensures text doesn't overlap but respects a minimum spacing.
|
|
498
|
+
* - `exactly`: Forces the line spacing to the specified `value`, even if characters
|
|
499
|
+
* (especially tall ones like ascenders/descenders or special symbols) overlap.
|
|
500
|
+
* Useful for precise layout control where overlapping might be acceptable or handled externally.
|
|
501
|
+
* - `multiple`: The base line height (often derived from the font's intrinsic metrics and font size)
|
|
502
|
+
* is multiplied by the `value` (e.g., a `value` of 1.5 would mean 150% of the base line height).
|
|
503
|
+
* This is very common for relative spacing.
|
|
504
|
+
*/
|
|
505
|
+
type: LineSpacingType;
|
|
506
|
+
};
|
|
507
|
+
/**
|
|
508
|
+
* Italic angle in radians for oblique text rendering
|
|
509
|
+
* Positive values slant right, negative values slant left
|
|
510
|
+
*/
|
|
511
|
+
obliqueAngle: Radian;
|
|
512
|
+
/**
|
|
513
|
+
* Text height in drawing units (primary size parameter)
|
|
514
|
+
* This determines the height of capital letters
|
|
515
|
+
*/
|
|
516
|
+
fontSize: PrecisionValue;
|
|
517
|
+
/** Desired height on printed page (for annotative text) */
|
|
518
|
+
paperTextHeight?: PrecisionValue;
|
|
519
|
+
/**
|
|
520
|
+
* Character width as a ratio of text height
|
|
521
|
+
* Controls horizontal spacing and character proportions
|
|
522
|
+
*
|
|
523
|
+
* @example 0.7 means each character is 70% as wide as the text is tall
|
|
524
|
+
*/
|
|
525
|
+
widthFactor: ScaleFactor;
|
|
526
|
+
/** Render upside down */
|
|
527
|
+
isUpsideDown: boolean;
|
|
528
|
+
/** Render backwards/mirrored */
|
|
529
|
+
isBackwards: boolean;
|
|
530
|
+
};
|
|
531
|
+
export type DucTextElement = _DucElementBase & DucTextStyle & {
|
|
532
|
+
type: "text";
|
|
533
|
+
/**
|
|
534
|
+
* The display text, which can contain zero or more placeholders in the
|
|
535
|
+
* format `{{tag}}`. Each tag corresponds to an object in the `dynamic` array.
|
|
536
|
+
* Example: "Part: {{PN}} on Layer: {{LAYER}}"
|
|
537
|
+
*/
|
|
538
|
+
text: string;
|
|
539
|
+
/**
|
|
540
|
+
* An array of metadata objects that define the behavior of the placeholders
|
|
541
|
+
* found in the `text` property. If this is empty, the text is treated
|
|
542
|
+
* as purely static.
|
|
543
|
+
*/
|
|
544
|
+
dynamic: readonly DucTextDynamicPart[];
|
|
545
|
+
/**
|
|
546
|
+
* Text sizing behavior:
|
|
547
|
+
* - `true`: Width adjusts to fit text content (single line or natural wrapping)
|
|
548
|
+
* - `false`: Text wraps to fit within the element's fixed width
|
|
549
|
+
* @default true
|
|
550
|
+
*/
|
|
551
|
+
autoResize: boolean;
|
|
552
|
+
/** The ID of an element that this text is contained within (e.g., for labels on shapes) */
|
|
553
|
+
containerId: DucGenericElement["id"] | null;
|
|
554
|
+
/** A non-rendered, original version of the text, e.g., before finishing writing the text */
|
|
555
|
+
originalText: string;
|
|
556
|
+
};
|
|
557
|
+
/**
|
|
558
|
+
* A discriminated union that precisely defines the source of a dynamic part's data.
|
|
559
|
+
* This structure is highly extensible.
|
|
560
|
+
*/
|
|
561
|
+
export type DucTextDynamicSource = {
|
|
562
|
+
sourceType: TEXT_FIELD_SOURCE_TYPE.ELEMENT;
|
|
563
|
+
/** The unique ID of the source element. */
|
|
564
|
+
elementId: DucElement["id"];
|
|
565
|
+
/** The specific property to retrieve from the source element. */
|
|
566
|
+
property: TextFieldSourceProperty;
|
|
567
|
+
} | {
|
|
568
|
+
sourceType: TEXT_FIELD_SOURCE_TYPE.DICTIONARY;
|
|
569
|
+
/** The key to look up in the global drawing dictionary. */
|
|
570
|
+
key: string;
|
|
571
|
+
};
|
|
572
|
+
/**
|
|
573
|
+
* Defines a single dynamic component within a text string.
|
|
574
|
+
* This object contains all the metadata needed to resolve and format a placeholder.
|
|
575
|
+
*/
|
|
576
|
+
export type DucTextDynamicPart = {
|
|
577
|
+
/**
|
|
578
|
+
* A unique key for this part, which matches the placeholder in the text string.
|
|
579
|
+
* E.g., for a placeholder `{{PartNumber}}`, the tag would be "PartNumber".
|
|
580
|
+
*/
|
|
581
|
+
tag: string;
|
|
582
|
+
/** The source of the data for this dynamic part. */
|
|
583
|
+
source: DucTextDynamicSource;
|
|
584
|
+
/** Formatting rules for displaying the final value. */
|
|
585
|
+
formatting?: StandardUnits["primaryUnits"];
|
|
586
|
+
/** The last known value, used as a fallback or for initial display. */
|
|
587
|
+
cachedValue: string;
|
|
588
|
+
};
|
|
589
|
+
export type DucTextElementWithContainer = {
|
|
590
|
+
containerId: DucTextContainer["id"];
|
|
591
|
+
} & DucTextElement;
|
|
592
|
+
export type LineHead = ValueOf<typeof LINE_HEAD>;
|
|
593
|
+
export type DucPointBinding = {
|
|
594
|
+
elementId: DucBindableElement["id"];
|
|
595
|
+
/**
|
|
596
|
+
* Determines where along the edge of the bound element the arrow endpoint should attach.
|
|
597
|
+
* This value ranges from -1 to 1:
|
|
598
|
+
* - -1 → Attaches to the far left (for horizontal edges) or top (for vertical edges).
|
|
599
|
+
* - 0 → Attaches to the exact center of the edge.
|
|
600
|
+
* - 1 → Attaches to the far right (for horizontal edges) or bottom (for vertical edges).
|
|
601
|
+
*
|
|
602
|
+
* Focus ensures that the arrow dynamically adjusts as the bound element moves, resizes, or rotates.
|
|
603
|
+
*/
|
|
604
|
+
focus: number;
|
|
605
|
+
/**
|
|
606
|
+
* The gap distance between the bound element and the binding element.
|
|
607
|
+
*/
|
|
608
|
+
gap: PrecisionValue;
|
|
609
|
+
/**
|
|
610
|
+
* Represents a fixed point inside the bound element, defined as a normalized coordinate.
|
|
611
|
+
* This value is an array [x, y], where:
|
|
612
|
+
* - x (0.0 - 1.0) → The horizontal position inside the element (0 = left, 1 = right).
|
|
613
|
+
* - y (0.0 - 1.0) → The vertical position inside the element (0 = top, 1 = bottom).
|
|
614
|
+
* Unlike focus, fixedPoint ensures that the arrow stays pinned to a precise location
|
|
615
|
+
* inside the element, regardless of resizing or movement.
|
|
616
|
+
*
|
|
617
|
+
* - If fixedPoint is null, focus is used instead, meaning the arrow will attach dynamically to the edge.
|
|
618
|
+
* - If fixedPoint is set, it overrides focus, keeping the arrow attached to the exact specified point inside the element.
|
|
619
|
+
*/
|
|
620
|
+
fixedPoint: FixedPoint | null;
|
|
621
|
+
/**
|
|
622
|
+
* Represents a point within a DucLinearElement.
|
|
623
|
+
*
|
|
624
|
+
* The `offset` ranges from -1 to 1:
|
|
625
|
+
* - `0` corresponds to the actual point.
|
|
626
|
+
* - `-1` and `1` represent the percentage of the distance between the point at `index` and the previous or next point in the points array, respectively.
|
|
627
|
+
*
|
|
628
|
+
* @property {number} index - The index of the target point within the element.
|
|
629
|
+
* @property {number} offset - The offset from the point.
|
|
630
|
+
*/
|
|
631
|
+
point: {
|
|
632
|
+
index: number;
|
|
633
|
+
offset: number;
|
|
634
|
+
} | null;
|
|
635
|
+
/**
|
|
636
|
+
* The head of the line
|
|
637
|
+
* Reference: https://www.figma.com/design/5rYcUlscflBabQ9di2iFJ5/duc-Architecture?node-id=313-43&t=gNEFgevk9KZ3oAun-1
|
|
638
|
+
*/
|
|
639
|
+
head: DucHead | null;
|
|
640
|
+
};
|
|
641
|
+
export type DucHead = {
|
|
642
|
+
type: LineHead;
|
|
643
|
+
blockId: string | null;
|
|
644
|
+
size: PrecisionValue;
|
|
645
|
+
};
|
|
646
|
+
export interface DucPointPosition {
|
|
647
|
+
x: PrecisionValue;
|
|
648
|
+
y: PrecisionValue;
|
|
649
|
+
}
|
|
650
|
+
export type BezierMirroring = ValueOf<typeof BEZIER_MIRRORING>;
|
|
651
|
+
export type DucPoint = DucPointPosition & {
|
|
652
|
+
mirroring?: BezierMirroring;
|
|
653
|
+
};
|
|
654
|
+
export type DucLine = [DucLineReference, DucLineReference];
|
|
655
|
+
export type DucLineReference = {
|
|
656
|
+
index: number;
|
|
657
|
+
handle: DucPointPosition | null;
|
|
658
|
+
};
|
|
659
|
+
export type DucPath = {
|
|
660
|
+
lineIndices: readonly number[];
|
|
661
|
+
background: ElementBackground | null;
|
|
662
|
+
stroke: ElementStroke | null;
|
|
663
|
+
};
|
|
664
|
+
export type _DucLinearElementBase = _DucElementBase & {
|
|
665
|
+
points: readonly DucPoint[];
|
|
666
|
+
lines: readonly DucLine[];
|
|
667
|
+
pathOverrides: readonly DucPath[];
|
|
668
|
+
lastCommittedPoint: DucPoint | null;
|
|
669
|
+
startBinding: DucPointBinding | null;
|
|
670
|
+
endBinding: DucPointBinding | null;
|
|
671
|
+
};
|
|
672
|
+
export type DucLinearElement = _DucLinearElementBase & {
|
|
673
|
+
type: "line";
|
|
674
|
+
/**
|
|
675
|
+
* If true, the element's shape will wipe out the content below the element
|
|
676
|
+
* @default false
|
|
677
|
+
*/
|
|
678
|
+
wipeoutBelow: boolean;
|
|
679
|
+
};
|
|
680
|
+
export type DucArrowElement = _DucLinearElementBase & {
|
|
681
|
+
type: "arrow";
|
|
682
|
+
elbowed: boolean;
|
|
683
|
+
};
|
|
684
|
+
export type DucElbowArrowElement = Merge<DucArrowElement, {
|
|
685
|
+
elbowed: true;
|
|
686
|
+
startBinding: FixedPointBinding | null;
|
|
687
|
+
endBinding: FixedPointBinding | null;
|
|
688
|
+
}>;
|
|
689
|
+
export type FixedPoint = GeometricPoint;
|
|
690
|
+
export type FixedPointBinding = Merge<DucPointBinding, {
|
|
691
|
+
fixedPoint: FixedPoint;
|
|
692
|
+
}>;
|
|
693
|
+
export type BoundElement = {
|
|
694
|
+
id: DucLinearElement["id"];
|
|
695
|
+
type: DucElementTypes;
|
|
696
|
+
};
|
|
697
|
+
export type DucFreeDrawEasing = typeof FREEDRAW_EASINGS[keyof typeof FREEDRAW_EASINGS];
|
|
698
|
+
export type DucFreeDrawEnds = {
|
|
699
|
+
cap: boolean;
|
|
700
|
+
taper: number;
|
|
701
|
+
easing: DucFreeDrawEasing;
|
|
702
|
+
};
|
|
703
|
+
export type DucFreeDrawElement = _DucElementBase & {
|
|
704
|
+
type: "freedraw";
|
|
705
|
+
points: readonly DucPoint[];
|
|
706
|
+
size: PrecisionValue;
|
|
707
|
+
thinning: Percentage;
|
|
708
|
+
smoothing: Percentage;
|
|
709
|
+
streamline: Percentage;
|
|
710
|
+
easing: DucFreeDrawEasing;
|
|
711
|
+
start: DucFreeDrawEnds | null;
|
|
712
|
+
end: DucFreeDrawEnds | null;
|
|
713
|
+
pressures: readonly number[];
|
|
714
|
+
simulatePressure: boolean;
|
|
715
|
+
lastCommittedPoint: DucPoint | null;
|
|
716
|
+
svgPath: string | null;
|
|
717
|
+
};
|
|
718
|
+
export type DucBlockDuplicationArray = {
|
|
719
|
+
rows: number;
|
|
720
|
+
cols: number;
|
|
721
|
+
rowSpacing: PrecisionValue;
|
|
722
|
+
colSpacing: PrecisionValue;
|
|
723
|
+
};
|
|
724
|
+
/**
|
|
725
|
+
* Defines the schema for a single attribute within a block definition.
|
|
726
|
+
*/
|
|
727
|
+
export type DucBlockAttributeDefinition = {
|
|
728
|
+
/** The unique identifier for this attribute within the block (e.g., "PART_NUMBER"). */
|
|
729
|
+
tag: string;
|
|
730
|
+
/** The prompt displayed to the user when inserting the block (e.g., "Enter the part number:"). */
|
|
731
|
+
prompt?: string;
|
|
732
|
+
/** The default value for this attribute. */
|
|
733
|
+
defaultValue: string;
|
|
734
|
+
/** If true, the attribute's value is fixed and cannot be changed after insertion. */
|
|
735
|
+
isConstant: boolean;
|
|
736
|
+
};
|
|
737
|
+
export type DucBlock = {
|
|
738
|
+
id: string;
|
|
739
|
+
label: string;
|
|
740
|
+
description?: string;
|
|
741
|
+
version: number;
|
|
742
|
+
/** An array of all elements that constitute the block's geometry and annotations. */
|
|
743
|
+
elements: readonly DucElement[];
|
|
744
|
+
/**
|
|
745
|
+
* A record of attribute definitions for this block, keyed by their tag.
|
|
746
|
+
* This defines the "slots" for data that each instance can fill.
|
|
747
|
+
*/
|
|
748
|
+
attributeDefinitions: Readonly<Record<string, DucBlockAttributeDefinition>>;
|
|
749
|
+
};
|
|
750
|
+
export type DucBlockInstanceElement = _DucElementBase & {
|
|
751
|
+
type: "blockinstance";
|
|
752
|
+
blockId: string;
|
|
753
|
+
/**
|
|
754
|
+
* Keys are the element ids of the block instance
|
|
755
|
+
* Values are the element overrides
|
|
756
|
+
*/
|
|
757
|
+
elementOverrides?: Record<string, string>;
|
|
758
|
+
/**
|
|
759
|
+
* A record of the actual values for the attributes of this specific instance,
|
|
760
|
+
* keyed by the attribute tag defined in the DucBlock.
|
|
761
|
+
*/
|
|
762
|
+
attributeValues?: Readonly<Record<string, string>>;
|
|
763
|
+
duplicationArray: DucBlockDuplicationArray | null;
|
|
764
|
+
};
|
|
765
|
+
export type _DucStackBase = DucStackLikeStyles & {
|
|
766
|
+
label: string;
|
|
767
|
+
description: string | null;
|
|
768
|
+
isCollapsed: boolean;
|
|
769
|
+
isPlot: _DucElementBase["isPlot"];
|
|
770
|
+
isVisible: _DucElementBase["isVisible"];
|
|
771
|
+
locked: _DucElementBase["locked"];
|
|
772
|
+
};
|
|
773
|
+
export type DucStackLikeStyles = {
|
|
774
|
+
opacity: _DucElementBase["opacity"];
|
|
775
|
+
labelingColor: string;
|
|
776
|
+
};
|
|
777
|
+
export type _DucStackElementBase = _DucElementBase & _DucStackBase & {
|
|
778
|
+
clip: boolean;
|
|
779
|
+
labelVisible: boolean;
|
|
780
|
+
/** Everything inside the stack will use this standard */
|
|
781
|
+
standardOverride: Standard["id"] | null;
|
|
782
|
+
};
|
|
783
|
+
export type DucFrameElement = _DucStackElementBase & {
|
|
784
|
+
type: "frame";
|
|
785
|
+
};
|
|
786
|
+
export type DucGroup = _DucStackBase & {
|
|
787
|
+
id: GroupId;
|
|
788
|
+
};
|
|
789
|
+
export type DucRegion = _DucStackBase & {
|
|
790
|
+
id: RegionId;
|
|
791
|
+
/** The boolean operation to apply to all child elements. */
|
|
792
|
+
booleanOperation: BooleanOperation;
|
|
793
|
+
};
|
|
794
|
+
/**
|
|
795
|
+
* Defines a Layer, a named collection of properties that can be inherited by elements.
|
|
796
|
+
* A Layer is a logical concept, not a spatial one. It provides a central point of
|
|
797
|
+
* control for the visual appearance (stroke, background, opacity) and behavior
|
|
798
|
+
* (visibility, locking, plotting) of elements assigned to it.
|
|
799
|
+
*
|
|
800
|
+
*/
|
|
801
|
+
export type DucLayer = _DucStackBase & {
|
|
802
|
+
id: LayerId;
|
|
803
|
+
readonly: boolean;
|
|
804
|
+
/** A container for the default styling properties that elements on this layer will inherit */
|
|
805
|
+
overrides: {
|
|
806
|
+
stroke: ElementStroke;
|
|
807
|
+
background: ElementBackground;
|
|
808
|
+
} | null;
|
|
809
|
+
};
|
|
810
|
+
/**
|
|
811
|
+
* Viewport scale represents how model space is displayed in a viewport.
|
|
812
|
+
* For a scale notation A:B, this represents the ratio A/B.
|
|
813
|
+
*
|
|
814
|
+
* Examples:
|
|
815
|
+
* - 1:200 viewport → ViewportScale = 1/200 = 0.005
|
|
816
|
+
* - 1:50 viewport → ViewportScale = 1/50 = 0.02
|
|
817
|
+
* - 1:1 viewport → ViewportScale = 1/1 = 1
|
|
818
|
+
* - 2:1 viewport → ViewportScale = 2/1 = 2
|
|
819
|
+
* - 10:1 viewport → ViewportScale = 10/1 = 10
|
|
820
|
+
*
|
|
821
|
+
* This represents how much model space is "zoomed" in the viewport.
|
|
822
|
+
*/
|
|
823
|
+
export type ViewportScale = number & {
|
|
824
|
+
_brand: "viewportScale";
|
|
825
|
+
};
|
|
826
|
+
/**
|
|
827
|
+
* Annotation scale represents the factor by which annotative objects
|
|
828
|
+
* are scaled to maintain consistent appearance across different viewport scales.
|
|
829
|
+
* For a scale notation A:B, this represents B/A.
|
|
830
|
+
*
|
|
831
|
+
* Examples:
|
|
832
|
+
* - 1:200 drawing → AnnotationScale = 200/1 = 200
|
|
833
|
+
* - 1:50 drawing → AnnotationScale = 50/1 = 50
|
|
834
|
+
* - 1:1 drawing → AnnotationScale = 1/1 = 1
|
|
835
|
+
* - 2:1 drawing → AnnotationScale = 1/2 = 0.5
|
|
836
|
+
* - 10:1 drawing → AnnotationScale = 1/10 = 0.1
|
|
837
|
+
*
|
|
838
|
+
* This is typically the inverse of the viewport scale.
|
|
839
|
+
*/
|
|
840
|
+
export type AnnotationScale = number & {
|
|
841
|
+
_brand: "annotationScale";
|
|
842
|
+
};
|
|
843
|
+
export type ViewportShadePlot = ValueOf<typeof VIEWPORT_SHADE_PLOT>;
|
|
844
|
+
/**
|
|
845
|
+
* This is the style for the viewport element
|
|
846
|
+
* Grid settings, UCS, Snapping and more can be overridden through the overrideStandard property from the _DucStackElementBase
|
|
847
|
+
*/
|
|
848
|
+
export type DucViewportStyle = _DucElementStylesBase & {
|
|
849
|
+
scaleIndicatorVisible: boolean;
|
|
850
|
+
};
|
|
851
|
+
export type DucViewportElement = _DucLinearElementBase & _DucStackBase & DucViewportStyle & {
|
|
852
|
+
type: "viewport";
|
|
853
|
+
/** View configuration */
|
|
854
|
+
view: DucView;
|
|
855
|
+
/** Viewport scale settings */
|
|
856
|
+
scale: ViewportScale;
|
|
857
|
+
/** Shade plot setting */
|
|
858
|
+
shadePlot: ViewportShadePlot;
|
|
859
|
+
/** Frozen layers in this viewport */
|
|
860
|
+
frozenGroupIds: GroupId[];
|
|
861
|
+
/** Everything inside the viewport will use this standard */
|
|
862
|
+
standardOverride: Standard["id"] | null;
|
|
863
|
+
};
|
|
864
|
+
/**
|
|
865
|
+
* Defines the properties of a printable area, including size and margins.
|
|
866
|
+
*/
|
|
867
|
+
export type PlotLayout = {
|
|
868
|
+
/** Margins inset from the edge of the paper. */
|
|
869
|
+
margins: {
|
|
870
|
+
top: PrecisionValue;
|
|
871
|
+
right: PrecisionValue;
|
|
872
|
+
bottom: PrecisionValue;
|
|
873
|
+
left: PrecisionValue;
|
|
874
|
+
};
|
|
875
|
+
};
|
|
876
|
+
export type DucPlotStyle = _DucElementStylesBase & {};
|
|
877
|
+
/**
|
|
878
|
+
* A DucPlotElement represents a finite layout or "paper space" within the infinite canvas.
|
|
879
|
+
* It serves as a container for viewports and other annotations, defining the final
|
|
880
|
+
* composition for printing or exporting. The element's own width/height should match
|
|
881
|
+
* the paperWidth/paperHeight defined in its layout.
|
|
882
|
+
*/
|
|
883
|
+
export type DucPlotElement = _DucStackElementBase & DucPlotStyle & {
|
|
884
|
+
type: "plot";
|
|
885
|
+
/** The layout definition for this plot, including paper size and margins. */
|
|
886
|
+
layout: PlotLayout;
|
|
887
|
+
};
|
|
888
|
+
export type DucXRayStyle = _DucElementStylesBase & {
|
|
889
|
+
/**
|
|
890
|
+
* The color of the x-ray
|
|
891
|
+
*/
|
|
892
|
+
color: string;
|
|
893
|
+
};
|
|
894
|
+
export type DucXRayElement = _DucElementBase & DucXRayStyle & {
|
|
895
|
+
type: "xray";
|
|
896
|
+
origin: DucPoint;
|
|
897
|
+
direction: DucPoint;
|
|
898
|
+
/**
|
|
899
|
+
* If true, the x-ray will start from the origin.
|
|
900
|
+
* If false, the x-ray will be a full infinite line.
|
|
901
|
+
* @default false
|
|
902
|
+
*/
|
|
903
|
+
startFromOrigin: boolean;
|
|
904
|
+
};
|
|
905
|
+
export type BlockAttachment = ValueOf<typeof BLOCK_ATTACHMENT>;
|
|
906
|
+
/**
|
|
907
|
+
* Defines the visual appearance and behavior of a leader.
|
|
908
|
+
*/
|
|
909
|
+
export type DucLeaderStyle = _DucElementStylesBase & {
|
|
910
|
+
/**
|
|
911
|
+
* Override the heads of the leader
|
|
912
|
+
* The tuple represents [startHead, endHead]
|
|
913
|
+
*/
|
|
914
|
+
headsOverride?: [DucHead, DucHead];
|
|
915
|
+
/** The "dogleg" or "landing" segment that connects the leader line to the content. */
|
|
916
|
+
dogleg?: PrecisionValue;
|
|
917
|
+
/** Default styling for text content. */
|
|
918
|
+
textStyle: DucTextStyle;
|
|
919
|
+
/**
|
|
920
|
+
* How the text content attaches to the leader's landing line.
|
|
921
|
+
* 'top': Text is below the line. 'middle': Text is centered on the line.
|
|
922
|
+
*/
|
|
923
|
+
textAttachment: VerticalAlign;
|
|
924
|
+
/** How the block content attaches to the leader's landing line. */
|
|
925
|
+
blockAttachment: BlockAttachment;
|
|
926
|
+
};
|
|
927
|
+
/**
|
|
928
|
+
* Defines the content attached to a leader. The leader is atomic, so its
|
|
929
|
+
* content is defined within it, not as a separate scene element.
|
|
930
|
+
*/
|
|
931
|
+
export type LeaderContent = {
|
|
932
|
+
type: "text";
|
|
933
|
+
/** The rich text or markdown string for the content. */
|
|
934
|
+
text: DucTextElement["text"];
|
|
935
|
+
} | {
|
|
936
|
+
type: "block";
|
|
937
|
+
/** The ID of the DucBlock definition to use as content. */
|
|
938
|
+
blockId: DucBlockInstanceElement["blockId"];
|
|
939
|
+
/**
|
|
940
|
+
* The attribute values and element overrides for this specific block instance.
|
|
941
|
+
* This is a subset of the properties from DucBlockInstanceElement.
|
|
942
|
+
*/
|
|
943
|
+
instanceData: {
|
|
944
|
+
attributeValues?: DucBlockInstanceElement["attributeValues"];
|
|
945
|
+
elementOverrides?: DucBlockInstanceElement["elementOverrides"];
|
|
946
|
+
};
|
|
947
|
+
};
|
|
948
|
+
/**
|
|
949
|
+
* A leader element that connects an annotation (text or a block) to a point
|
|
950
|
+
* or feature in the drawing. It is a single, atomic entity that manages its
|
|
951
|
+
* own geometry and content. It is designed to be compatible with the modern
|
|
952
|
+
*/
|
|
953
|
+
export type DucLeaderElement = _DucLinearElementBase & DucLeaderStyle & {
|
|
954
|
+
type: "leader";
|
|
955
|
+
/**
|
|
956
|
+
* The content attached to the leader. Stored internally to keep the element atomic.
|
|
957
|
+
*/
|
|
958
|
+
leaderContent: LeaderContent | null;
|
|
959
|
+
/**
|
|
960
|
+
* The anchor point for the content block, in world coordinates.
|
|
961
|
+
* The leader's dogleg/landing connects to this point.
|
|
962
|
+
*/
|
|
963
|
+
contentAnchor: GeometricPoint;
|
|
964
|
+
};
|
|
965
|
+
export type DimensionType = ValueOf<typeof DIMENSION_TYPE>;
|
|
966
|
+
export type MarkEllipseCenter = ValueOf<typeof MARK_ELLIPSE_CENTER>;
|
|
967
|
+
export type ToleranceDisplay = ValueOf<typeof TOLERANCE_DISPLAY>;
|
|
968
|
+
export type DimensionFitRule = ValueOf<typeof DIMENSION_FIT_RULE>;
|
|
969
|
+
export type DimensionTextPlacement = ValueOf<typeof DIMENSION_TEXT_PLACEMENT>;
|
|
970
|
+
/**
|
|
971
|
+
* The key geometric points that define a dimension's measurement.
|
|
972
|
+
* The meaning of each point depends on the dimensionType.
|
|
973
|
+
*/
|
|
974
|
+
export type DimensionDefinitionPoints = {
|
|
975
|
+
/**
|
|
976
|
+
* Primary origin point (e.g., start of a linear dimension, point on a circle for radius).
|
|
977
|
+
* DXF DefPoint1
|
|
978
|
+
*/
|
|
979
|
+
origin1: GeometricPoint;
|
|
980
|
+
/**
|
|
981
|
+
* Secondary origin point (e.g., end of a linear dimension, end of an arc).
|
|
982
|
+
* DXF DefPoint2
|
|
983
|
+
*/
|
|
984
|
+
origin2?: GeometricPoint;
|
|
985
|
+
/**
|
|
986
|
+
* A point that defines the position of the dimension line or arc.
|
|
987
|
+
* DXF DefPoint3
|
|
988
|
+
*/
|
|
989
|
+
location: GeometricPoint;
|
|
990
|
+
/**
|
|
991
|
+
* Center point (for radial/angular/diameter) or vertex (for angular).
|
|
992
|
+
* DXF DefPoint4
|
|
993
|
+
*/
|
|
994
|
+
center?: GeometricPoint;
|
|
995
|
+
/**
|
|
996
|
+
* A point defining a jog in the dimension line.
|
|
997
|
+
* DXF DefPoint5
|
|
998
|
+
*/
|
|
999
|
+
jog?: GeometricPoint;
|
|
1000
|
+
};
|
|
1001
|
+
/**
|
|
1002
|
+
* Defines the complete visual appearance of a dimension.
|
|
1003
|
+
* This style can be stored in a library and applied to many dimension instances.
|
|
1004
|
+
*/
|
|
1005
|
+
export type DucDimensionStyle = {
|
|
1006
|
+
/** Style for the main dimension line and its arrowheads */
|
|
1007
|
+
dimLine: {
|
|
1008
|
+
stroke: ElementStroke;
|
|
1009
|
+
/** Gap between the dimension line and the text when text is placed inside */
|
|
1010
|
+
textGap: PrecisionValue;
|
|
1011
|
+
};
|
|
1012
|
+
/** Style for the extension lines that connect the dimension to the feature */
|
|
1013
|
+
extLine: {
|
|
1014
|
+
stroke: ElementStroke;
|
|
1015
|
+
/** Distance to extend the line beyond the dimension line */
|
|
1016
|
+
overshoot: PrecisionValue;
|
|
1017
|
+
/** Gap between the feature origin and the start of the extension line */
|
|
1018
|
+
offset: PrecisionValue;
|
|
1019
|
+
};
|
|
1020
|
+
/** The text style used for the dimension's measurement and annotations */
|
|
1021
|
+
textStyle: DucTextStyle;
|
|
1022
|
+
/** Configuration for arrowheads and other symbols */
|
|
1023
|
+
symbols: {
|
|
1024
|
+
/**
|
|
1025
|
+
* Override the arrow heads for each dimension line
|
|
1026
|
+
* The tuple represents [startHead, endHead]
|
|
1027
|
+
*/
|
|
1028
|
+
headsOverride?: [DucHead, DucHead];
|
|
1029
|
+
/** Center mark configuration for radial/diameter dimensions */
|
|
1030
|
+
centerMark: {
|
|
1031
|
+
type: MarkEllipseCenter;
|
|
1032
|
+
size: PrecisionValue;
|
|
1033
|
+
};
|
|
1034
|
+
};
|
|
1035
|
+
/** Default settings for dimensional tolerances */
|
|
1036
|
+
tolerance: {
|
|
1037
|
+
/** Whether to display tolerances by default */
|
|
1038
|
+
enabled: boolean;
|
|
1039
|
+
/** Default display method (e.g., Symmetrical, Limits) */
|
|
1040
|
+
displayMethod: ToleranceDisplay;
|
|
1041
|
+
/** Default upper tolerance value */
|
|
1042
|
+
upperValue: number;
|
|
1043
|
+
/** Default lower tolerance value */
|
|
1044
|
+
lowerValue: number;
|
|
1045
|
+
/** Decimal places for tolerance values */
|
|
1046
|
+
precision: number;
|
|
1047
|
+
/** The text style for the tolerance values, inheriting from the main textStyle */
|
|
1048
|
+
textStyle: Partial<DucTextStyle>;
|
|
1049
|
+
};
|
|
1050
|
+
/** Rules for how to arrange text and arrows when space is limited */
|
|
1051
|
+
fit: {
|
|
1052
|
+
/** Determines what to move when text and arrows don't fit between extension lines */
|
|
1053
|
+
rule: DimensionFitRule;
|
|
1054
|
+
/** If text is moved, determines its placement relative to the dimension line */
|
|
1055
|
+
textPlacement: DimensionTextPlacement;
|
|
1056
|
+
/** Forces text to always be placed between extension lines */
|
|
1057
|
+
forceTextInside: boolean;
|
|
1058
|
+
};
|
|
1059
|
+
};
|
|
1060
|
+
/**
|
|
1061
|
+
* A dimension element is an atomic annotation that measures and displays the
|
|
1062
|
+
* distance or angle between points. It renders its own lines, arrows, and text
|
|
1063
|
+
* based on its definition points and style, ensuring a clean and robust data model.
|
|
1064
|
+
*/
|
|
1065
|
+
export type DucDimensionElement = _DucElementBase & DucDimensionStyle & {
|
|
1066
|
+
type: "dimension";
|
|
1067
|
+
/** The type of dimension, which determines how definition points are interpreted */
|
|
1068
|
+
dimensionType: DimensionType;
|
|
1069
|
+
/** The core geometric points that define what is being measured */
|
|
1070
|
+
definitionPoints: DimensionDefinitionPoints;
|
|
1071
|
+
/**
|
|
1072
|
+
* The oblique angle for the extension lines, used for isometric-style dimensions.
|
|
1073
|
+
* An angle of 0 means they are perpendicular to the dimension line.
|
|
1074
|
+
*/
|
|
1075
|
+
obliqueAngle: Radian;
|
|
1076
|
+
/**
|
|
1077
|
+
* For 'ordinate' dimensions, specifies whether it measures the X or Y coordinate.
|
|
1078
|
+
*/
|
|
1079
|
+
ordinateAxis: Axis | null;
|
|
1080
|
+
/**
|
|
1081
|
+
* Defines how the definition points are associated with other elements when `isAssociative` is true.
|
|
1082
|
+
* The keys correspond to the keys in `definitionPoints`.
|
|
1083
|
+
*/
|
|
1084
|
+
bindings?: {
|
|
1085
|
+
origin1: DucPointBinding | null;
|
|
1086
|
+
origin2: DucPointBinding | null;
|
|
1087
|
+
center: DucPointBinding | null;
|
|
1088
|
+
};
|
|
1089
|
+
/**
|
|
1090
|
+
* User-override for the dimension text content.
|
|
1091
|
+
* - If `null`, the measured value is automatically calculated and displayed.
|
|
1092
|
+
* - If a string, this value is displayed instead.
|
|
1093
|
+
* Use `<>` within the string (e.g., "R<>") to include the calculated measurement.
|
|
1094
|
+
*/
|
|
1095
|
+
textOverride: string | null;
|
|
1096
|
+
/**
|
|
1097
|
+
* User-override for the text position.
|
|
1098
|
+
* - If `null`, the position is automatically determined by the 'fit' rules in the style.
|
|
1099
|
+
* - If a point, the text is moved to this exact location.
|
|
1100
|
+
*/
|
|
1101
|
+
textPosition: GeometricPoint | null;
|
|
1102
|
+
/** Instance-specific overrides for tolerance, taking precedence over the style's defaults */
|
|
1103
|
+
toleranceOverride?: Partial<DucDimensionStyle["tolerance"]>;
|
|
1104
|
+
/** If this is a baseline dimension, contains data linking it to the base */
|
|
1105
|
+
baselineData?: {
|
|
1106
|
+
baseDimensionId: string;
|
|
1107
|
+
};
|
|
1108
|
+
/** If this is a continued dimension, contains data linking it to the previous one */
|
|
1109
|
+
continueData?: {
|
|
1110
|
+
continueFromDimensionId: string;
|
|
1111
|
+
};
|
|
1112
|
+
/** Calculated measurement value (read-only, for inspection/API use) */
|
|
1113
|
+
readonly calculatedValue: PrecisionValue;
|
|
1114
|
+
};
|
|
1115
|
+
export type GDTSymbol = ValueOf<typeof GDT_SYMBOL>;
|
|
1116
|
+
export type MaterialCondition = ValueOf<typeof MATERIAL_CONDITION>;
|
|
1117
|
+
export type FeatureModifier = ValueOf<typeof FEATURE_MODIFIER>;
|
|
1118
|
+
export type ToleranceZoneType = ValueOf<typeof TOLERANCE_ZONE_TYPE>;
|
|
1119
|
+
export type DatumTargetType = ValueOf<typeof DATUM_TARGET_TYPE>;
|
|
1120
|
+
export type ToleranceType = ValueOf<typeof TOLERANCE_TYPE>;
|
|
1121
|
+
export type DatumBracketStyle = ValueOf<typeof DATUM_BRACKET_STYLE>;
|
|
1122
|
+
/**
|
|
1123
|
+
* Represents a single datum reference in a datum reference frame (e.g., "| A(M) |").
|
|
1124
|
+
*/
|
|
1125
|
+
export type DatumReference = {
|
|
1126
|
+
/** The datum letter or letters (e.g., "A", "B", "A-B") */
|
|
1127
|
+
letters: string;
|
|
1128
|
+
/** Material condition modifier, if any (e.g., Maximum, Least) */
|
|
1129
|
+
modifier?: MaterialCondition;
|
|
1130
|
+
};
|
|
1131
|
+
/**
|
|
1132
|
+
* Defines the tolerance value and its related specifications within a segment.
|
|
1133
|
+
*/
|
|
1134
|
+
export type ToleranceClause = {
|
|
1135
|
+
/** The primary tolerance value, represented as a string to support various formats */
|
|
1136
|
+
value: string;
|
|
1137
|
+
/** The type of tolerance zone (e.g., Cylindrical, Spherical) */
|
|
1138
|
+
zoneType?: ToleranceZoneType;
|
|
1139
|
+
/** A list of modifiers that apply directly to the feature, like Diameter or Projected Zone */
|
|
1140
|
+
featureModifiers: readonly FeatureModifier[];
|
|
1141
|
+
/** Material condition modifier for the tolerance itself */
|
|
1142
|
+
materialCondition?: MaterialCondition;
|
|
1143
|
+
};
|
|
1144
|
+
/**
|
|
1145
|
+
* A single segment within a Feature Control Frame row.
|
|
1146
|
+
* Typically contains a geometric symbol, a tolerance clause, and datum references.
|
|
1147
|
+
*/
|
|
1148
|
+
export type FeatureControlFrameSegment = {
|
|
1149
|
+
/** The geometric characteristic symbol (e.g., Position, Flatness, Profile) */
|
|
1150
|
+
symbol: GDTSymbol;
|
|
1151
|
+
/** The tolerance specification for this segment */
|
|
1152
|
+
tolerance: ToleranceClause;
|
|
1153
|
+
/** The datum reference frame, ordered by priority */
|
|
1154
|
+
datums: readonly [
|
|
1155
|
+
primary?: DatumReference,
|
|
1156
|
+
secondary?: DatumReference,
|
|
1157
|
+
tertiary?: DatumReference
|
|
1158
|
+
];
|
|
1159
|
+
};
|
|
1160
|
+
/**
|
|
1161
|
+
* Defines the visual appearance of a Feature Control Frame.
|
|
1162
|
+
* This can be stored in a style library and reused.
|
|
1163
|
+
*/
|
|
1164
|
+
export type DucFeatureControlFrameStyle = _DucElementStylesBase & {
|
|
1165
|
+
/** The base text style for numbers and letters within the frame */
|
|
1166
|
+
textStyle: DucTextStyle;
|
|
1167
|
+
/** Layout and spacing properties */
|
|
1168
|
+
layout: {
|
|
1169
|
+
/** Padding between the content and the outer frame border */
|
|
1170
|
+
padding: PrecisionValue;
|
|
1171
|
+
/** Spacing between segments (vertical lines) in a row */
|
|
1172
|
+
segmentSpacing: PrecisionValue;
|
|
1173
|
+
/** Spacing between rows in a composite frame */
|
|
1174
|
+
rowSpacing: PrecisionValue;
|
|
1175
|
+
};
|
|
1176
|
+
/** Configuration for GD&T symbols */
|
|
1177
|
+
symbols: {
|
|
1178
|
+
/** Scale factor for symbols relative to the text height */
|
|
1179
|
+
scale: number;
|
|
1180
|
+
};
|
|
1181
|
+
/** Styling for datum references */
|
|
1182
|
+
datumStyle: {
|
|
1183
|
+
/** The style of bracket to draw around datum letters */
|
|
1184
|
+
bracketStyle: DatumBracketStyle;
|
|
1185
|
+
};
|
|
1186
|
+
};
|
|
1187
|
+
/**
|
|
1188
|
+
* A Geometric Dimensioning and Tolerancing (GD&T) Feature Control Frame element.
|
|
1189
|
+
* This element can represent a tolerance specification or define a datum feature.
|
|
1190
|
+
*/
|
|
1191
|
+
export type DucFeatureControlFrameElement = _DucElementBase & DucFeatureControlFrameStyle & {
|
|
1192
|
+
type: "featurecontrolframe";
|
|
1193
|
+
/**
|
|
1194
|
+
* An array of rows. Most FCFs have one row. Composite frames have multiple rows.
|
|
1195
|
+
* Each row is an array of segments that are drawn horizontally.
|
|
1196
|
+
*/
|
|
1197
|
+
rows: readonly (readonly FeatureControlFrameSegment[])[];
|
|
1198
|
+
/**
|
|
1199
|
+
* Modifiers that apply to the entire feature control frame.
|
|
1200
|
+
*/
|
|
1201
|
+
frameModifiers?: {
|
|
1202
|
+
allAround?: boolean;
|
|
1203
|
+
allOver?: boolean;
|
|
1204
|
+
continuousFeature?: boolean;
|
|
1205
|
+
between?: {
|
|
1206
|
+
start: string;
|
|
1207
|
+
end: string;
|
|
1208
|
+
};
|
|
1209
|
+
projectedToleranceZone?: PrecisionValue;
|
|
1210
|
+
};
|
|
1211
|
+
/**
|
|
1212
|
+
* A reference to a leader element that points to this FCF.
|
|
1213
|
+
* The leader element itself holds the geometry and start/end bindings.
|
|
1214
|
+
* This provides a simple, one-way link.
|
|
1215
|
+
*/
|
|
1216
|
+
leaderElementId: DucLeaderElement["id"] | null;
|
|
1217
|
+
/**
|
|
1218
|
+
* If present, this element acts as a **Datum Feature Symbol**, defining the specified
|
|
1219
|
+
* datum letter and attached to a feature. The `rows` property would be empty.
|
|
1220
|
+
*/
|
|
1221
|
+
datumDefinition?: {
|
|
1222
|
+
/** The datum letter this symbol defines (e.g., "A", "B") */
|
|
1223
|
+
letter: string;
|
|
1224
|
+
/**
|
|
1225
|
+
* An optional binding directly to a point on the feature being identified as the datum.
|
|
1226
|
+
* Used when a leader is not present.
|
|
1227
|
+
*/
|
|
1228
|
+
featureBinding?: DucPointBinding;
|
|
1229
|
+
};
|
|
1230
|
+
};
|
|
1231
|
+
export type TextFlowDirection = ValueOf<typeof TEXT_FLOW_DIRECTION>;
|
|
1232
|
+
export type ColumnType = ValueOf<typeof COLUMN_TYPE>;
|
|
1233
|
+
export type StackedTextAlign = ValueOf<typeof STACKED_TEXT_ALIGN>;
|
|
1234
|
+
/**
|
|
1235
|
+
* Defines advanced styling for a DucDocElement, extending the base text styles.
|
|
1236
|
+
* These properties control the overall layout and appearance of the document block.
|
|
1237
|
+
*/
|
|
1238
|
+
export type DucDocStyle = DucTextStyle & {
|
|
1239
|
+
paragraph: {
|
|
1240
|
+
/** Indentation for the first line of each paragraph */
|
|
1241
|
+
firstLineIndent: PrecisionValue;
|
|
1242
|
+
/** Indentation for all lines except the first (hanging indent) */
|
|
1243
|
+
hangingIndent: PrecisionValue;
|
|
1244
|
+
/** Indentation from the left edge of the element's bounding box */
|
|
1245
|
+
leftIndent: PrecisionValue;
|
|
1246
|
+
/** Indentation from the right edge of the element's bounding box */
|
|
1247
|
+
rightIndent: PrecisionValue;
|
|
1248
|
+
/** Extra spacing added before each paragraph */
|
|
1249
|
+
spaceBefore: PrecisionValue;
|
|
1250
|
+
/** Extra spacing added after each paragraph */
|
|
1251
|
+
spaceAfter: PrecisionValue;
|
|
1252
|
+
/** A list of tab stop positions from the left indent */
|
|
1253
|
+
tabStops: PrecisionValue[];
|
|
1254
|
+
};
|
|
1255
|
+
stackFormat: {
|
|
1256
|
+
/** Enable automatic stacking of text around specified characters */
|
|
1257
|
+
autoStack: boolean;
|
|
1258
|
+
/** Characters that trigger stacking (e.g., "/", "#", "^") */
|
|
1259
|
+
stackChars: string[];
|
|
1260
|
+
/** Properties for how stacked text is rendered */
|
|
1261
|
+
properties: {
|
|
1262
|
+
/** Scale of the upper text relative to the main font size */
|
|
1263
|
+
upperScale: number;
|
|
1264
|
+
/** Scale of the lower text relative to the main font size */
|
|
1265
|
+
lowerScale: number;
|
|
1266
|
+
/** Alignment of stacked text (e.g., center, decimal) */
|
|
1267
|
+
alignment: StackedTextAlign;
|
|
1268
|
+
};
|
|
1269
|
+
};
|
|
1270
|
+
};
|
|
1271
|
+
/**
|
|
1272
|
+
* Defines the properties of a single column within a multi-column DucDocElement.
|
|
1273
|
+
* The collection of these definitions dictates the overall column layout.
|
|
1274
|
+
*/
|
|
1275
|
+
export type TextColumn = {
|
|
1276
|
+
/** The width of the column in drawing units. */
|
|
1277
|
+
width: PrecisionValue;
|
|
1278
|
+
/** The space between this column and the next, also known as the gutter. */
|
|
1279
|
+
gutter: PrecisionValue;
|
|
1280
|
+
};
|
|
1281
|
+
/**
|
|
1282
|
+
* A rich text document element
|
|
1283
|
+
* It supports complex formatting through its style properties and uses a Markdown
|
|
1284
|
+
* string for inline text styling, which can be edited with a rich text editor.
|
|
1285
|
+
*/
|
|
1286
|
+
export type DucDocElement = _DucElementBase & DucDocStyle & {
|
|
1287
|
+
type: "doc";
|
|
1288
|
+
/**
|
|
1289
|
+
* The content of the document, stored as a Markdown string.
|
|
1290
|
+
* This approach allows a rich text editor (like Tiptap) to manage the complex
|
|
1291
|
+
* inline formatting (bold, italic, colors, hyperlinks, etc.) while keeping the
|
|
1292
|
+
* core data structure simple and clean.
|
|
1293
|
+
*
|
|
1294
|
+
* It can also contain wildcards like `{@fieldname}` for dynamic data insertion.
|
|
1295
|
+
* Example: "This is **bold text** and this is a {color:red}red word{/color}."
|
|
1296
|
+
*
|
|
1297
|
+
* It can also contain zero or more placeholders in the format `{{tag}}`.
|
|
1298
|
+
* Example: "This document was last saved on {{SaveDate}} by {{Author}}."
|
|
1299
|
+
*/
|
|
1300
|
+
text: string;
|
|
1301
|
+
/**
|
|
1302
|
+
* An array of metadata objects that define the behavior of the placeholders
|
|
1303
|
+
* found in the `text` property. If this is empty, the text is treated
|
|
1304
|
+
* as purely static.
|
|
1305
|
+
*/
|
|
1306
|
+
dynamic: readonly DucTextDynamicPart[];
|
|
1307
|
+
/** Direction of text flow for multi-column layouts */
|
|
1308
|
+
flowDirection: TextFlowDirection;
|
|
1309
|
+
/**
|
|
1310
|
+
* Defines the structural properties of the columns.
|
|
1311
|
+
*/
|
|
1312
|
+
columns: {
|
|
1313
|
+
/**
|
|
1314
|
+
* - `none`: A single column.
|
|
1315
|
+
* - `static`: A fixed number of columns with defined widths/heights.
|
|
1316
|
+
* - `dynamic`: Text flows automatically between columns based on height.
|
|
1317
|
+
*/
|
|
1318
|
+
type: ColumnType;
|
|
1319
|
+
/** An array defining each column's properties */
|
|
1320
|
+
definitions: TextColumn[];
|
|
1321
|
+
/** Whether column height adjusts automatically in dynamic mode */
|
|
1322
|
+
autoHeight: boolean;
|
|
1323
|
+
};
|
|
1324
|
+
/**
|
|
1325
|
+
* Text sizing behavior:
|
|
1326
|
+
* - `true`: Width and/or height adjust to fit text content.
|
|
1327
|
+
* - `false`: Text wraps or is clipped to fit the element's fixed bounds.
|
|
1328
|
+
* @default true
|
|
1329
|
+
*/
|
|
1330
|
+
autoResize: boolean;
|
|
1331
|
+
};
|
|
1332
|
+
/**
|
|
1333
|
+
* Defines the source of the 3D geometry for a Parametric Element.
|
|
1334
|
+
* The geometry is either generated from live code or loaded from an external file.
|
|
1335
|
+
*/
|
|
1336
|
+
export type ParametricElementSource = {
|
|
1337
|
+
/** The geometry is defined by executable Replicad code. */
|
|
1338
|
+
type: PARAMETRIC_SOURCE_TYPE.CODE;
|
|
1339
|
+
/** The JavaScript code that generates the Replicad model. */
|
|
1340
|
+
code: string;
|
|
1341
|
+
} | {
|
|
1342
|
+
/** The geometry is loaded from a static 3D file. */
|
|
1343
|
+
type: PARAMETRIC_SOURCE_TYPE.FILE;
|
|
1344
|
+
/** A reference to the imported file in the DucExternalFiles collection. */
|
|
1345
|
+
fileId: ExternalFileId;
|
|
1346
|
+
};
|
|
1347
|
+
/**
|
|
1348
|
+
* An element that embeds a 3D model on the 2D canvas, defined either by
|
|
1349
|
+
* parametric Replicad code or by an imported 3D file (e.g., STEP, STL).
|
|
1350
|
+
* It includes its own 3D view and display controls.
|
|
1351
|
+
*/
|
|
1352
|
+
export type DucParametricElement = _DucElementBase & {
|
|
1353
|
+
type: "parametric";
|
|
1354
|
+
/** Defines the source of the 3D geometry (either from code or a file). */
|
|
1355
|
+
source: ParametricElementSource;
|
|
1356
|
+
};
|