@likec4/core 1.44.0 → 1.46.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.
Files changed (74) hide show
  1. package/dist/builder/index.d.mts +15 -13
  2. package/dist/builder/index.mjs +33 -17
  3. package/dist/compute-view/index.d.mts +8 -7
  4. package/dist/compute-view/index.mjs +7 -6
  5. package/dist/compute-view/relationships-view/index.d.mts +8 -7
  6. package/dist/compute-view/relationships-view/index.mjs +2 -2
  7. package/dist/geometry/index.d.mts +109 -0
  8. package/dist/geometry/index.mjs +328 -0
  9. package/dist/index.d.mts +29 -7
  10. package/dist/index.mjs +10 -8
  11. package/dist/model/connection/deployment/index.d.mts +10 -9
  12. package/dist/model/connection/deployment/index.mjs +2 -2
  13. package/dist/model/connection/index.d.mts +11 -10
  14. package/dist/model/connection/index.mjs +3 -3
  15. package/dist/model/connection/model/index.d.mts +10 -9
  16. package/dist/model/connection/model/index.mjs +2 -2
  17. package/dist/model/index.d.mts +13 -26
  18. package/dist/model/index.mjs +4 -4
  19. package/dist/shared/{core.Bv3cd-jC.mjs → core.3ZhnKAlZ.mjs} +9 -5
  20. package/dist/shared/{core.CKNmSm2W.d.mts → core.5gPDaaG5.d.mts} +9 -15
  21. package/dist/shared/{core.BnOetIAR.d.mts → core.9U0HL3oG.d.mts} +3 -3
  22. package/dist/shared/{core.M9ayqQZa.mjs → core.BK-tI3Q3.mjs} +2 -3
  23. package/dist/shared/{core.DjAM-S6a.d.mts → core.BLG-ADpi.d.mts} +16 -14
  24. package/dist/shared/core.BPGOjone.d.mts +46 -0
  25. package/dist/shared/{core.DIE3F6sw.mjs → core.BYdtmqY5.mjs} +1 -2
  26. package/dist/shared/core.BhNcrwzK.mjs +7 -0
  27. package/dist/shared/{core.CDOKQTW6.d.mts → core.BkSYCfRg.d.mts} +2 -2
  28. package/dist/shared/core.BkVA6gjl.mjs +5 -0
  29. package/dist/shared/{core.5ZQ-r3Oa.d.mts → core.BqtAzeAh.d.mts} +1 -1
  30. package/dist/shared/{core.DEieYfbG.mjs → core.BspBF3SJ.mjs} +22 -70
  31. package/dist/shared/{core.BnDbAOR2.d.mts → core.Byj60hH6.d.mts} +3 -3
  32. package/dist/shared/{core.CR3PmPzr.mjs → core.CBLX4mT8.mjs} +3811 -15032
  33. package/dist/shared/{core.DX-WYEPA.d.mts → core.CDdf8izT.d.mts} +4 -2
  34. package/dist/shared/core.CLSZtnFh.mjs +69 -0
  35. package/dist/shared/{core.bKIs4oDO.mjs → core.CQPEY2wQ.mjs} +5 -4
  36. package/dist/shared/{core.WwMWeiFL.d.mts → core.CQYL_Z-_.d.mts} +3 -3
  37. package/dist/shared/{core.6VsRBhGY.mjs → core.CdNCAwq7.mjs} +1 -1
  38. package/dist/shared/{core.DrUt0Lbi.mjs → core.CmGY9blO.mjs} +198 -291
  39. package/dist/shared/core.Coi_LOUZ.mjs +7 -0
  40. package/dist/shared/{core.C_Ni6yHl.mjs → core.D0WZutNd.mjs} +3 -1
  41. package/dist/shared/{core.DTJYgLXI.d.mts → core.D4Y4U8Lp.d.mts} +3 -3
  42. package/dist/shared/{core.BMtVqKl7.d.mts → core.DE-g9oFF.d.mts} +22 -46
  43. package/dist/shared/{core.23WeDKcI.mjs → core.DJpiszim.mjs} +265 -233
  44. package/dist/shared/{core.h4TqqSC0.mjs → core.DU8pv3Q6.mjs} +71 -1174
  45. package/dist/shared/{core.CHwVhuc9.mjs → core.DbQpDoJS.mjs} +12 -15
  46. package/dist/shared/{core.CbsSAn1j.mjs → core.DbfO90vF.mjs} +1 -12
  47. package/dist/shared/{core.C0Ye2OCr.mjs → core.DqlrMlsf.mjs} +1 -1
  48. package/dist/shared/core.Qv7vZIwZ.mjs +1282 -0
  49. package/dist/shared/core.oSV6SRfk.mjs +13 -0
  50. package/dist/shared/{core.BuQZczj6.mjs → core.om36dXXW.mjs} +5 -2
  51. package/dist/shared/{core.8mmHFn9g.d.mts → core.or6-EHsb.d.mts} +2 -2
  52. package/dist/shared/{core.DFCHU59b.mjs → core.xeuDd__E.mjs} +3 -4
  53. package/dist/styles/index.d.mts +7 -6
  54. package/dist/styles/index.mjs +4 -4
  55. package/dist/types/_aux.d.mts +2 -2
  56. package/dist/types/expression-model.d.mts +3 -3
  57. package/dist/types/expression.d.mts +3 -3
  58. package/dist/types/fqnRef.d.mts +2 -2
  59. package/dist/types/fqnRef.mjs +1 -1
  60. package/dist/types/index.d.mts +11 -9
  61. package/dist/types/index.mjs +6 -166
  62. package/dist/types/scalar.d.mts +1 -1
  63. package/dist/types/scalar.mjs +1 -1
  64. package/dist/utils/graphology/index.mjs +1 -1
  65. package/dist/utils/index.d.mts +3 -3
  66. package/dist/utils/index.mjs +9 -8
  67. package/dist/utils/iterable/index.d.mts +17 -1
  68. package/dist/utils/iterable/index.mjs +17 -1
  69. package/geometry/package.json +4 -0
  70. package/package.json +20 -12
  71. package/dist/shared/core.B9BjmjuH.mjs +0 -9
  72. package/dist/shared/core.BR4zXDH-.mjs +0 -13
  73. package/dist/shared/core.BdPcbSkN.mjs +0 -118
  74. package/dist/shared/core.OHD4KXm9.mjs +0 -5
@@ -1,14 +1,15 @@
1
1
  import { LastArrayElement, Split, Simplify, IsLiteral, Writable, IfNever, IsNever, TupleToUnion, Tagged, PartialDeep } from 'type-fest';
2
- import { L as LikeC4Model } from '../shared/core.DjAM-S6a.mjs';
3
- import { D as DeploymentFqn, F as Fqn } from '../shared/core.DX-WYEPA.mjs';
4
- import { e as DeploymentElement, h as DeploymentRelationship, o as ParsedView, a0 as ParsedDeploymentView, P as ParsedLikeC4ModelData } from '../shared/core.CKNmSm2W.mjs';
5
- import { f as Element, h as ModelRelation, r as AnyViewRuleStyle, v as AutoLayoutDirection, ag as ParsedElementView, i as ElementSpecification$1, k as RelationshipSpecification, T as TagSpecification, m as LikeC4ProjectStylesConfig } from '../shared/core.BMtVqKl7.mjs';
6
- import { f as Participant, E as Expression, u as ElementShape, D as ThemeColor, s as BorderStyle, q as ShapeSize, r as SpacingSize, p as TextSize, y as RelationshipArrowType, v as RelationshipLineType } from '../shared/core.BnOetIAR.mjs';
2
+ import { f as LikeC4Model } from '../shared/core.BLG-ADpi.mjs';
3
+ import { D as DeploymentFqn, F as Fqn, M as MarkdownOrString } from '../shared/core.CDdf8izT.mjs';
4
+ import { f as DeploymentElement, j as DeploymentRelationship, p as ParsedView, a0 as ParsedDeploymentView, P as ParsedLikeC4ModelData } from '../shared/core.5gPDaaG5.mjs';
5
+ import { f as Element, g as ModelRelation, q as AnyViewRuleStyle, w as AutoLayoutDirection, ah as ParsedElementView, h as ElementSpecification$1, j as RelationshipSpecification, T as TagSpecification, L as LikeC4ProjectStylesConfig } from '../shared/core.DE-g9oFF.mjs';
6
+ import { o as Participant, j as Expression, h as ElementShape, T as ThemeColor, B as BorderStyle, e as ShapeSize, S as SpacingSize, d as TextSize, g as RelationshipArrowType, f as RelationshipLineType } from '../shared/core.9U0HL3oG.mjs';
7
7
  import { ModelFqnExpr, ModelRelationExpr } from '../types/expression-model.mjs';
8
8
  import { N as NonEmptyArray, K as KeysOf } from '../shared/core.DB0Ue5Wx.mjs';
9
- import { Y as setProject, d as Aux, S as SpecAux, A as Any } from '../shared/core.CDOKQTW6.mjs';
10
- import '../shared/core.8mmHFn9g.mjs';
9
+ import { Y as setProject, e as Aux, f as SpecAux, A as Any } from '../shared/core.BkSYCfRg.mjs';
10
+ import '../shared/core.or6-EHsb.mjs';
11
11
  import '../shared/core.CywrQs86.mjs';
12
+ import '../shared/core.BPGOjone.mjs';
12
13
  import '../types/fqnRef.mjs';
13
14
 
14
15
  type ToNested$1<T, Id extends string> = T extends TypesNested<infer P, any, any, any, any, any, any, any, infer F> ? TypesNested<`${P}.${Id}`, T['ElementKind'], T['Fqn'], T['ViewId'], T['RelationshipKind'], T['Tag'], T['MetadataKey'], T['DeploymentKind'], `${P}.${Id}` | F> : T extends AnyTypes ? TypesNested<Id, T['ElementKind'], T['Fqn'], T['ViewId'], T['RelationshipKind'], T['Tag'], T['MetadataKey'], T['DeploymentKind'], Id | T['DeploymentFqn']> : never;
@@ -660,8 +661,8 @@ type Metadata<MetadataKey extends string> = IsNever<MetadataKey> extends true ?
660
661
  } : Record<string, string | NonEmptyArray<string>>;
661
662
  type NewElementProps<Tag, Metadata> = {
662
663
  title?: string;
663
- summary?: string;
664
- description?: string;
664
+ summary?: MarkdownOrString | string;
665
+ description?: MarkdownOrString | string;
665
666
  technology?: string;
666
667
  tags?: IfNever<Tag, never, [Tag, ...Tag[]]>;
667
668
  metadata?: Metadata;
@@ -682,8 +683,8 @@ type NewElementProps<Tag, Metadata> = {
682
683
  };
683
684
  type NewDeploymentNodeProps<Tag, Metadata> = {
684
685
  title?: string;
685
- summary?: string;
686
- description?: string;
686
+ summary?: MarkdownOrString | string;
687
+ description?: MarkdownOrString | string;
687
688
  technology?: string;
688
689
  tags?: IfNever<Tag, never, [Tag, ...Tag[]]>;
689
690
  metadata?: Metadata;
@@ -704,7 +705,7 @@ type NewDeploymentNodeProps<Tag, Metadata> = {
704
705
  };
705
706
  type NewViewProps<Tag> = {
706
707
  title?: string;
707
- description?: string;
708
+ description?: MarkdownOrString | string;
708
709
  tags?: IfNever<Tag, never, [Tag, ...Tag[]]>;
709
710
  links?: Array<string | {
710
711
  title?: string;
@@ -714,8 +715,9 @@ type NewViewProps<Tag> = {
714
715
  type NewRelationProps<Kind, Tag, Metadata> = {
715
716
  kind?: Kind;
716
717
  title?: string;
717
- description?: string;
718
+ description?: MarkdownOrString | string;
718
719
  technology?: string;
720
+ notes?: MarkdownOrString | string;
719
721
  tags?: IfNever<Tag, never, [Tag, ...Tag[]]>;
720
722
  metadata?: Metadata;
721
723
  head?: RelationshipArrowType;
@@ -1,18 +1,19 @@
1
- import { d as defu, t as t$6 } from '../shared/core.DEieYfbG.mjs';
1
+ import { d as defu } from '../shared/core.CLSZtnFh.mjs';
2
2
  import { t as t$1, a as t$7 } from '../shared/core.BsSXS-_R.mjs';
3
- import { t as t$5 } from '../shared/core.B9BjmjuH.mjs';
4
- import { j as e } from '../shared/core.BuQZczj6.mjs';
3
+ import { t as t$5 } from '../shared/core.Coi_LOUZ.mjs';
4
+ import { t as t$6 } from '../shared/core.BspBF3SJ.mjs';
5
+ import { k as e } from '../shared/core.om36dXXW.mjs';
5
6
  import { e as e$3 } from '../shared/core.DRJma0Ol.mjs';
6
7
  import { a as _type, u as e$2, _ as _stage, d as isDeployedInstance, p as isElementView } from '../shared/core.DH7TXqXf.mjs';
7
8
  import { t as t$2 } from '../shared/core.CbT8JVYL.mjs';
8
- import { a as t$4, c as computeLikeC4Model } from '../shared/core.23WeDKcI.mjs';
9
- import { a as t$3 } from '../shared/core.h4TqqSC0.mjs';
9
+ import { a as t$4, c as computeLikeC4Model } from '../shared/core.DJpiszim.mjs';
10
+ import { t as t$3 } from '../shared/core.Qv7vZIwZ.mjs';
10
11
  import { assignTagColors } from '../styles/index.mjs';
11
- import { n as nameFromFqn, d as isSameHierarchy, p as parentFqn } from '../shared/core.6VsRBhGY.mjs';
12
+ import { n as nameFromFqn, d as isSameHierarchy, p as parentFqn } from '../shared/core.CdNCAwq7.mjs';
12
13
  import { e as e$1 } from '../shared/core.CqAJJpK_.mjs';
13
14
  import { ModelFqnExpr } from '../types/expression-model.mjs';
14
15
  import { i as invariant } from '../shared/core.D4npX2q8.mjs';
15
- import { e as exact } from '../shared/core.M9ayqQZa.mjs';
16
+ import { e as exact } from '../shared/core.BK-tI3Q3.mjs';
16
17
  import { FqnRef } from '../types/fqnRef.mjs';
17
18
 
18
19
  function t(...t){return t$1(Object.fromEntries,t)}
@@ -366,6 +367,15 @@ function validateSpec({ tags, elements, deployments, relationships, ...specifica
366
367
  relationships: ensureObj(relationships ?? {})
367
368
  };
368
369
  }
370
+ function toMarkdownOrString(input) {
371
+ if (e$2(input)) {
372
+ return null;
373
+ }
374
+ if (typeof input === "string") {
375
+ return { txt: input };
376
+ }
377
+ return input;
378
+ }
369
379
  function builder(_spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _views = /* @__PURE__ */ new Map(), _globals = {
370
380
  predicates: {},
371
381
  dynamicPredicates: {},
@@ -406,7 +416,7 @@ function builder(_spec, _elements = /* @__PURE__ */ new Map(), _relations = [],
406
416
  exact({
407
417
  id,
408
418
  title,
409
- description: description ? { txt: description } : null,
419
+ description: toMarkdownOrString(description),
410
420
  tags,
411
421
  links,
412
422
  _stage: "parsed",
@@ -570,6 +580,7 @@ function builder(_spec, _elements = /* @__PURE__ */ new Map(), _relations = [],
570
580
  title = "",
571
581
  links: _links = [],
572
582
  description = null,
583
+ notes = null,
573
584
  ...props
574
585
  } = defu(
575
586
  typeof _props === "string" ? { title: _props } : { ..._props },
@@ -584,7 +595,8 @@ function builder(_spec, _elements = /* @__PURE__ */ new Map(), _relations = [],
584
595
  model: target
585
596
  },
586
597
  title,
587
- ...description && { description: { txt: description } },
598
+ ...description && { description: toMarkdownOrString(description) },
599
+ ...notes && { notes: toMarkdownOrString(notes) },
588
600
  links,
589
601
  ...props
590
602
  }));
@@ -597,6 +609,7 @@ function builder(_spec, _elements = /* @__PURE__ */ new Map(), _relations = [],
597
609
  title = "",
598
610
  links,
599
611
  description = null,
612
+ notes = null,
600
613
  ...props
601
614
  } = defu(
602
615
  typeof _props === "string" ? { title: _props } : { ..._props },
@@ -607,7 +620,8 @@ function builder(_spec, _elements = /* @__PURE__ */ new Map(), _relations = [],
607
620
  model: target
608
621
  },
609
622
  title,
610
- ...description && { description: { txt: description } },
623
+ ...description && { description: toMarkdownOrString(description) },
624
+ ...notes && { notes: toMarkdownOrString(notes) },
611
625
  links: mapLinks(links),
612
626
  ...props
613
627
  }));
@@ -635,8 +649,8 @@ function builder(_spec, _elements = /* @__PURE__ */ new Map(), _relations = [],
635
649
  id: _id,
636
650
  kind,
637
651
  title: title ?? nameFromFqn(_id),
638
- ...description && { description: { txt: description } },
639
- ...summary && { summary: { txt: summary } },
652
+ ...description && { description: toMarkdownOrString(description) },
653
+ ...summary && { summary: toMarkdownOrString(summary) },
640
654
  style: exact({
641
655
  icon,
642
656
  color: color ?? specStyle?.color,
@@ -799,8 +813,8 @@ function builder(_spec, _elements = /* @__PURE__ */ new Map(), _relations = [],
799
813
  id: _id,
800
814
  element: target,
801
815
  ...title && { title },
802
- ...summary && { summary: { txt: summary } },
803
- ...description && { description: { txt: description } },
816
+ ...summary && { summary: toMarkdownOrString(summary) },
817
+ ...description && { description: toMarkdownOrString(description) },
804
818
  style: exact({
805
819
  icon,
806
820
  color,
@@ -820,6 +834,7 @@ function builder(_spec, _elements = /* @__PURE__ */ new Map(), _relations = [],
820
834
  title = null,
821
835
  links,
822
836
  description = null,
837
+ notes = null,
823
838
  ...props
824
839
  } = typeof _props === "string" ? { title: _props } : { ..._props };
825
840
  b.__addDeploymentRelation(exact({
@@ -830,7 +845,8 @@ function builder(_spec, _elements = /* @__PURE__ */ new Map(), _relations = [],
830
845
  deployment: target
831
846
  },
832
847
  title,
833
- ...description && { description: { txt: description } },
848
+ ...description && { description: toMarkdownOrString(description) },
849
+ ...notes && { notes: toMarkdownOrString(notes) },
834
850
  links: mapLinks(links),
835
851
  ...props
836
852
  }));
@@ -859,8 +875,8 @@ function builder(_spec, _elements = /* @__PURE__ */ new Map(), _relations = [],
859
875
  id: _id,
860
876
  kind,
861
877
  title: title ?? nameFromFqn(_id),
862
- ...description && { description: { txt: description } },
863
- ...summary && { summary: { txt: summary } },
878
+ ...description && { description: toMarkdownOrString(description) },
879
+ ...summary && { summary: toMarkdownOrString(summary) },
864
880
  style: exact({
865
881
  icon,
866
882
  color: color ?? specStyle?.color,
@@ -1,14 +1,15 @@
1
- import { A as Any, t as toComputed, c as AnyParsed } from '../shared/core.CDOKQTW6.mjs';
2
- import { L as LikeC4Model } from '../shared/core.DjAM-S6a.mjs';
3
- import { P as ParsedLikeC4ModelData, C as ComputedLikeC4ModelData, o as ParsedView, r as ComputedView } from '../shared/core.CKNmSm2W.mjs';
1
+ import { A as Any, t as toComputed, d as AnyParsed } from '../shared/core.BkSYCfRg.mjs';
2
+ import { f as LikeC4Model } from '../shared/core.BLG-ADpi.mjs';
3
+ import { P as ParsedLikeC4ModelData, C as ComputedLikeC4ModelData, p as ParsedView, r as ComputedView } from '../shared/core.5gPDaaG5.mjs';
4
4
  import 'type-fest';
5
5
  import '../shared/core.DB0Ue5Wx.mjs';
6
- import '../shared/core.DX-WYEPA.mjs';
7
- import '../shared/core.8mmHFn9g.mjs';
8
- import '../shared/core.BnOetIAR.mjs';
6
+ import '../shared/core.CDdf8izT.mjs';
7
+ import '../shared/core.or6-EHsb.mjs';
8
+ import '../shared/core.9U0HL3oG.mjs';
9
9
  import '../types/fqnRef.mjs';
10
- import '../shared/core.BMtVqKl7.mjs';
10
+ import '../shared/core.DE-g9oFF.mjs';
11
11
  import '../types/expression-model.mjs';
12
+ import '../shared/core.BPGOjone.mjs';
12
13
  import '../shared/core.CywrQs86.mjs';
13
14
 
14
15
  type ComputeViewResult<V> = {
@@ -1,11 +1,12 @@
1
- import { w as willCreateCycle, t as topologicalSortExports, a as t$2, n as n$1 } from '../shared/core.23WeDKcI.mjs';
2
- export { c as computeLikeC4Model, b as computeParsedModelData, d as computeView, u as unsafeComputeView } from '../shared/core.23WeDKcI.mjs';
3
- import { n } from '../shared/core.CHwVhuc9.mjs';
4
- import { t, a as t$1 } from '../shared/core.h4TqqSC0.mjs';
1
+ import { w as willCreateCycle, t as topologicalSortExports, a as t$2, n as n$1 } from '../shared/core.DJpiszim.mjs';
2
+ export { c as computeLikeC4Model, b as computeParsedModelData, d as computeView, u as unsafeComputeView } from '../shared/core.DJpiszim.mjs';
3
+ import { n } from '../shared/core.BhNcrwzK.mjs';
4
+ import { t } from '../shared/core.DU8pv3Q6.mjs';
5
5
  import { r as isExtendsElementView, p as isElementView } from '../shared/core.DH7TXqXf.mjs';
6
- import { G as Graph } from '../shared/core.DrUt0Lbi.mjs';
7
- import { c as isNonEmptyArray } from '../shared/core.6VsRBhGY.mjs';
6
+ import { G as Graph } from '../shared/core.CmGY9blO.mjs';
7
+ import { c as isNonEmptyArray } from '../shared/core.CdNCAwq7.mjs';
8
8
  import { t as t$3 } from '../shared/core.CbT8JVYL.mjs';
9
+ import { t as t$1 } from '../shared/core.Qv7vZIwZ.mjs';
9
10
 
10
11
  function resolveRulesExtendedViews(unresolvedViews) {
11
12
  const g = new Graph({
@@ -1,15 +1,16 @@
1
- import { A as Any, U as Unknown, o as ElementId, V as ViewId } from '../../shared/core.CDOKQTW6.mjs';
2
- import { E as ElementModel, R as RelationshipModel, L as LikeC4Model } from '../../shared/core.DjAM-S6a.mjs';
1
+ import { A as Any, U as Unknown, a as ElementId, V as ViewId } from '../../shared/core.BkSYCfRg.mjs';
2
+ import { E as ElementModel, R as RelationshipModel, f as LikeC4Model } from '../../shared/core.BLG-ADpi.mjs';
3
3
  import 'type-fest';
4
4
  import '../../shared/core.DB0Ue5Wx.mjs';
5
- import '../../shared/core.DX-WYEPA.mjs';
6
- import '../../shared/core.8mmHFn9g.mjs';
7
- import '../../shared/core.BnOetIAR.mjs';
5
+ import '../../shared/core.CDdf8izT.mjs';
6
+ import '../../shared/core.or6-EHsb.mjs';
7
+ import '../../shared/core.9U0HL3oG.mjs';
8
8
  import '../../types/fqnRef.mjs';
9
- import '../../shared/core.BMtVqKl7.mjs';
9
+ import '../../shared/core.DE-g9oFF.mjs';
10
10
  import '../../types/expression-model.mjs';
11
+ import '../../shared/core.BPGOjone.mjs';
11
12
  import '../../shared/core.CywrQs86.mjs';
12
- import '../../shared/core.CKNmSm2W.mjs';
13
+ import '../../shared/core.5gPDaaG5.mjs';
13
14
 
14
15
  type RelationshipsViewData<M extends Any = Unknown> = {
15
16
  incomers: ReadonlySet<ElementModel<M>>;
@@ -1,5 +1,5 @@
1
- import { t } from '../../shared/core.OHD4KXm9.mjs';
2
- import { f as sortParentsFirst, b as isDescendantOf, i as isAncestor } from '../../shared/core.6VsRBhGY.mjs';
1
+ import { t } from '../../shared/core.3ZhnKAlZ.mjs';
2
+ import { f as sortParentsFirst, b as isDescendantOf, i as isAncestor } from '../../shared/core.CdNCAwq7.mjs';
3
3
  import { D as DefaultMap } from '../../shared/core.BbE4y-yl.mjs';
4
4
  import { a as nonNullable, i as invariant } from '../../shared/core.D4npX2q8.mjs';
5
5
  import { t as toSet, a as toArray, i as imap } from '../../shared/core.C3JowhaZ.mjs';
@@ -0,0 +1,109 @@
1
+ export { B as BBox, P as Point, R as RectBox, X as XYPoint } from '../shared/core.BPGOjone.mjs';
2
+
3
+ interface VectorValue {
4
+ readonly x: number;
5
+ readonly y: number;
6
+ }
7
+ declare class Vector implements VectorValue {
8
+ readonly x: number;
9
+ readonly y: number;
10
+ constructor(x: number, y: number);
11
+ static create(position: VectorValue): Vector;
12
+ static create(x: number, y: number): Vector;
13
+ /**
14
+ * Adds two vectors.
15
+ * @param a The first vector.
16
+ * @param b The second vector.
17
+ * @returns The sum of the two vectors.
18
+ */
19
+ static add(a: VectorValue, b: VectorValue): VectorValue;
20
+ /**
21
+ * Subtracts two vectors.
22
+ * @param a The first vector.
23
+ * @param b The second vector.
24
+ * @returns The difference of the two vectors.
25
+ */
26
+ static subtract(a: VectorValue, b: VectorValue): VectorValue;
27
+ /**
28
+ * Multiplies a vector by a scalar.
29
+ * @param a The vector.
30
+ * @param b The scalar.
31
+ * @returns The scaled vector.
32
+ */
33
+ static multiply(a: VectorValue, b: number): VectorValue;
34
+ /**
35
+ * Divides a vector by a scalar.
36
+ * @param a The vector.
37
+ * @param b The scalar.
38
+ * @returns The scaled vector.
39
+ */
40
+ static divide(a: VectorValue, b: number): VectorValue;
41
+ /**
42
+ * Calculates the dot product of the vectors.
43
+ * @param a The first vector.
44
+ * @param b The second vector.
45
+ * @returns The dot product.
46
+ */
47
+ static dot(a: VectorValue, b: VectorValue): number;
48
+ /**
49
+ * Adds the given vector to this vector.
50
+ * @param b The vector to add.
51
+ * @returns A new vector that is the sum of this vector and the given vector.
52
+ */
53
+ add(b: VectorValue): Vector;
54
+ /**
55
+ * Subtracts the given vector from this vector.
56
+ * @param b The vector to subtract.
57
+ * @returns A new vector that is the difference of this vector and the given vector.
58
+ */
59
+ subtract(b: VectorValue): Vector;
60
+ /**
61
+ * Multiplies this vector by a scalar.
62
+ * @param b The scalar to multiply by.
63
+ * @returns A new vector that is the product of this vector and the given scalar.
64
+ */
65
+ multiply(b: number): Vector;
66
+ /**
67
+ * Divides this vector by a scalar.
68
+ * @param b The scalar to divide by.
69
+ * @returns A new vector that is the quotient of this vector and the given scalar.
70
+ */
71
+ divide(b: number): Vector;
72
+ /**
73
+ * Calculates the dot product of this vector and another vector.
74
+ * @param b The other vector.
75
+ * @returns The dot product.
76
+ */
77
+ dot(b: VectorValue): number;
78
+ /**
79
+ * Calculates the cross product of this vector and another vector.
80
+ * The cross product of two 2D vectors is a scalar value: a.x * b.y - a.y * b.x
81
+ * @param b The other vector.
82
+ * @returns The cross product as a scalar.
83
+ */
84
+ cross(b: VectorValue): number;
85
+ /**
86
+ * Calculates the length (magnitude) of this vector.
87
+ * @returns The length of the vector.
88
+ */
89
+ length(): number;
90
+ /**
91
+ * Normalizes the vector (makes it unit length, i.e., has a length of 1).
92
+ * @returns A new vector that is the normalized version of this vector.
93
+ */
94
+ normalize(): Vector;
95
+ /**
96
+ * Rounds the components of the vector to the nearest integers.
97
+ * @returns A new vector with rounded components.
98
+ */
99
+ round(): Vector;
100
+ /**
101
+ * Converts the vector to a plain object.
102
+ * @returns An object with x and y properties.
103
+ */
104
+ toObject(): VectorValue;
105
+ }
106
+ declare function vector(source: VectorValue | Vector): Vector;
107
+ declare function vector(x: number, y: number): Vector;
108
+
109
+ export { Vector, type VectorValue, vector };