@synnaxlabs/x 0.7.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 (164) hide show
  1. package/.eslintrc.cjs +18 -0
  2. package/.turbo/turbo-build.log +16 -0
  3. package/.vscode/settings.json +3 -0
  4. package/LICENSE +4 -0
  5. package/README.md +44 -0
  6. package/dist/binary/encoder.d.ts +59 -0
  7. package/dist/binary/encoder.spec.d.ts +1 -0
  8. package/dist/binary/index.d.ts +1 -0
  9. package/dist/case.d.ts +5 -0
  10. package/dist/change/change.d.ts +32 -0
  11. package/dist/change/index.d.ts +1 -0
  12. package/dist/clamp.d.ts +1 -0
  13. package/dist/compare/compare.d.ts +39 -0
  14. package/dist/compare/index.d.ts +1 -0
  15. package/dist/debounce.d.ts +2 -0
  16. package/dist/deep/copy.d.ts +1 -0
  17. package/dist/deep/delete.d.ts +2 -0
  18. package/dist/deep/delete.spec.d.ts +1 -0
  19. package/dist/deep/equal.d.ts +8 -0
  20. package/dist/deep/equal.spec.d.ts +1 -0
  21. package/dist/deep/external.d.ts +7 -0
  22. package/dist/deep/index.d.ts +1 -0
  23. package/dist/deep/key.d.ts +30 -0
  24. package/dist/deep/memo.d.ts +1 -0
  25. package/dist/deep/merge.d.ts +2 -0
  26. package/dist/deep/merge.spec.d.ts +1 -0
  27. package/dist/deep/partial.d.ts +3 -0
  28. package/dist/destructor.d.ts +1 -0
  29. package/dist/identity.d.ts +1 -0
  30. package/dist/index.d.ts +25 -0
  31. package/dist/join.d.ts +1 -0
  32. package/dist/kv/index.d.ts +1 -0
  33. package/dist/kv/types.d.ts +32 -0
  34. package/dist/mock/MockGLBufferController.d.ts +20 -0
  35. package/dist/mock/index.d.ts +1 -0
  36. package/dist/observe/index.d.ts +1 -0
  37. package/dist/observe/observe.d.ts +11 -0
  38. package/dist/optional.d.ts +1 -0
  39. package/dist/primitive.d.ts +8 -0
  40. package/dist/record.d.ts +14 -0
  41. package/dist/renderable.d.ts +4 -0
  42. package/dist/runtime/detect.d.ts +9 -0
  43. package/dist/runtime/external.d.ts +2 -0
  44. package/dist/runtime/index.d.ts +1 -0
  45. package/dist/runtime/os.d.ts +9 -0
  46. package/dist/search.d.ts +15 -0
  47. package/dist/spatial/base.d.ts +102 -0
  48. package/dist/spatial/bounds.d.ts +31 -0
  49. package/dist/spatial/bounds.spec.d.ts +1 -0
  50. package/dist/spatial/box.d.ts +265 -0
  51. package/dist/spatial/box.spec.d.ts +1 -0
  52. package/dist/spatial/dimensions.d.ts +59 -0
  53. package/dist/spatial/dimensions.spec.d.ts +1 -0
  54. package/dist/spatial/direction.d.ts +10 -0
  55. package/dist/spatial/direction.spec.d.ts +1 -0
  56. package/dist/spatial/external.d.ts +8 -0
  57. package/dist/spatial/index.d.ts +1 -0
  58. package/dist/spatial/location.d.ts +52 -0
  59. package/dist/spatial/location.spec.d.ts +1 -0
  60. package/dist/spatial/position.d.ts +2 -0
  61. package/dist/spatial/scale.d.ts +241 -0
  62. package/dist/spatial/scale.spec.d.ts +1 -0
  63. package/dist/spatial/spatial.d.ts +1 -0
  64. package/dist/spatial/xy.d.ts +116 -0
  65. package/dist/spatial/xy.spec.d.ts +1 -0
  66. package/dist/telem/encode.d.ts +1 -0
  67. package/dist/telem/generate.d.ts +2 -0
  68. package/dist/telem/gl.d.ts +11 -0
  69. package/dist/telem/index.d.ts +3 -0
  70. package/dist/telem/series.d.ts +104 -0
  71. package/dist/telem/series.spec.d.ts +1 -0
  72. package/dist/telem/telem.d.ts +633 -0
  73. package/dist/telem/telem.spec.d.ts +1 -0
  74. package/dist/toArray.d.ts +1 -0
  75. package/dist/transform.d.ts +1 -0
  76. package/dist/unique.d.ts +1 -0
  77. package/dist/url/index.d.ts +1 -0
  78. package/dist/url/url.d.ts +46 -0
  79. package/dist/url/url.spec.d.ts +1 -0
  80. package/dist/worker/worker.d.ts +32 -0
  81. package/dist/worker/worker.spec.d.ts +1 -0
  82. package/dist/x.cjs.js +9046 -0
  83. package/dist/x.cjs.js.map +1 -0
  84. package/dist/x.es.js +9047 -0
  85. package/dist/x.es.js.map +1 -0
  86. package/package.json +42 -0
  87. package/src/binary/encoder.spec.ts +31 -0
  88. package/src/binary/encoder.ts +118 -0
  89. package/src/binary/index.ts +10 -0
  90. package/src/case.ts +31 -0
  91. package/src/change/change.ts +31 -0
  92. package/src/change/index.ts +10 -0
  93. package/src/clamp.ts +14 -0
  94. package/src/compare/compare.ts +116 -0
  95. package/src/compare/index.ts +10 -0
  96. package/src/debounce.ts +45 -0
  97. package/src/deep/copy.ts +13 -0
  98. package/src/deep/delete.spec.ts +36 -0
  99. package/src/deep/delete.ts +27 -0
  100. package/src/deep/equal.spec.ts +82 -0
  101. package/src/deep/equal.ts +65 -0
  102. package/src/deep/external.ts +15 -0
  103. package/src/deep/index.ts +10 -0
  104. package/src/deep/key.ts +46 -0
  105. package/src/deep/merge.spec.ts +63 -0
  106. package/src/deep/merge.ts +41 -0
  107. package/src/deep/partial.ts +14 -0
  108. package/src/destructor.ts +10 -0
  109. package/src/identity.ts +14 -0
  110. package/src/index.ts +34 -0
  111. package/src/join.ts +14 -0
  112. package/src/kv/index.ts +10 -0
  113. package/src/kv/types.ts +52 -0
  114. package/src/mock/MockGLBufferController.ts +70 -0
  115. package/src/mock/index.ts +10 -0
  116. package/src/observe/index.ts +10 -0
  117. package/src/observe/observe.ts +33 -0
  118. package/src/optional.ts +10 -0
  119. package/src/primitive.ts +46 -0
  120. package/src/record.ts +45 -0
  121. package/src/renderable.ts +20 -0
  122. package/src/runtime/detect.ts +34 -0
  123. package/src/runtime/external.ts +11 -0
  124. package/src/runtime/index.ts +10 -0
  125. package/src/runtime/os.ts +38 -0
  126. package/src/search.ts +40 -0
  127. package/src/spatial/base.ts +80 -0
  128. package/src/spatial/bounds.spec.ts +99 -0
  129. package/src/spatial/bounds.ts +80 -0
  130. package/src/spatial/box.spec.ts +137 -0
  131. package/src/spatial/box.ts +326 -0
  132. package/src/spatial/dimensions.spec.ts +47 -0
  133. package/src/spatial/dimensions.ts +64 -0
  134. package/src/spatial/direction.spec.ts +25 -0
  135. package/src/spatial/direction.ts +47 -0
  136. package/src/spatial/external.ts +17 -0
  137. package/src/spatial/index.ts +10 -0
  138. package/src/spatial/location.spec.ts +24 -0
  139. package/src/spatial/location.ts +124 -0
  140. package/src/spatial/position.ts +26 -0
  141. package/src/spatial/scale.spec.ts +74 -0
  142. package/src/spatial/scale.ts +351 -0
  143. package/src/spatial/spatial.ts +17 -0
  144. package/src/spatial/xy.spec.ts +68 -0
  145. package/src/spatial/xy.ts +164 -0
  146. package/src/telem/encode.ts +22 -0
  147. package/src/telem/generate.ts +19 -0
  148. package/src/telem/gl.ts +22 -0
  149. package/src/telem/index.ts +12 -0
  150. package/src/telem/series.spec.ts +289 -0
  151. package/src/telem/series.ts +449 -0
  152. package/src/telem/telem.spec.ts +302 -0
  153. package/src/telem/telem.ts +1237 -0
  154. package/src/toArray.ts +11 -0
  155. package/src/transform.ts +10 -0
  156. package/src/unique.ts +10 -0
  157. package/src/url/index.ts +10 -0
  158. package/src/url/url.spec.ts +47 -0
  159. package/src/url/url.ts +113 -0
  160. package/src/worker/worker.spec.ts +41 -0
  161. package/src/worker/worker.ts +86 -0
  162. package/tsconfig.json +7 -0
  163. package/tsconfig.vite.json +4 -0
  164. package/vite.config.ts +23 -0
@@ -0,0 +1,31 @@
1
+ import { type Bounds, bounds, type CrudeBounds } from '../spatial/base';
2
+ export { type Bounds, bounds };
3
+ export type Crude = CrudeBounds;
4
+ export declare const construct: (lower: number | Crude, upper?: number) => Bounds;
5
+ export declare const ZERO: {
6
+ lower: number;
7
+ upper: number;
8
+ };
9
+ export declare const INFINITE: {
10
+ lower: number;
11
+ upper: number;
12
+ };
13
+ export declare const DECIMAL: {
14
+ lower: number;
15
+ upper: number;
16
+ };
17
+ export declare const CLIP: {
18
+ lower: number;
19
+ upper: number;
20
+ };
21
+ export declare const equals: (a?: Bounds, b?: Bounds) => boolean;
22
+ export declare const makeValid: (a: Bounds) => Bounds;
23
+ export declare const clamp: (bounds: Bounds, target: number) => number;
24
+ export declare const contains: (bounds: Bounds, target: number) => boolean;
25
+ export declare const overlapsWith: (a: Bounds, b: Bounds) => boolean;
26
+ export declare const span: (a: Bounds) => number;
27
+ export declare const isZero: (a: Bounds) => boolean;
28
+ export declare const spanIsZero: (a: Bounds) => boolean;
29
+ export declare const isFinite: (a: Bounds) => boolean;
30
+ export declare const max: (bounds: Crude[]) => Bounds;
31
+ export declare const min: (bounds: Crude[]) => Bounds;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,265 @@
1
+ import { z } from "zod";
2
+ import type * as bounds from '../spatial/bounds';
3
+ import type * as dimensions from '../spatial/dimensions';
4
+ import * as direction from '../spatial/direction';
5
+ import * as location from '../spatial/location';
6
+ import * as xy from '../spatial/xy';
7
+ declare const cssBox: z.ZodObject<{
8
+ top: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
9
+ left: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
10
+ width: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
11
+ height: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ width: string | number;
14
+ height: string | number;
15
+ top: string | number;
16
+ left: string | number;
17
+ }, {
18
+ width: string | number;
19
+ height: string | number;
20
+ top: string | number;
21
+ left: string | number;
22
+ }>;
23
+ declare const domRect: z.ZodObject<{
24
+ left: z.ZodNumber;
25
+ top: z.ZodNumber;
26
+ right: z.ZodNumber;
27
+ bottom: z.ZodNumber;
28
+ }, "strip", z.ZodTypeAny, {
29
+ top: number;
30
+ right: number;
31
+ bottom: number;
32
+ left: number;
33
+ }, {
34
+ top: number;
35
+ right: number;
36
+ bottom: number;
37
+ left: number;
38
+ }>;
39
+ export declare const box: z.ZodObject<{
40
+ one: z.ZodObject<{
41
+ x: z.ZodNumber;
42
+ y: z.ZodNumber;
43
+ }, "strip", z.ZodTypeAny, {
44
+ x: number;
45
+ y: number;
46
+ }, {
47
+ x: number;
48
+ y: number;
49
+ }>;
50
+ two: z.ZodObject<{
51
+ x: z.ZodNumber;
52
+ y: z.ZodNumber;
53
+ }, "strip", z.ZodTypeAny, {
54
+ x: number;
55
+ y: number;
56
+ }, {
57
+ x: number;
58
+ y: number;
59
+ }>;
60
+ root: z.ZodObject<{
61
+ x: z.ZodEnum<["left", "right"]>;
62
+ y: z.ZodEnum<["top", "bottom"]>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ x: "right" | "left";
65
+ y: "top" | "bottom";
66
+ }, {
67
+ x: "right" | "left";
68
+ y: "top" | "bottom";
69
+ }>;
70
+ }, "strip", z.ZodTypeAny, {
71
+ one: {
72
+ x: number;
73
+ y: number;
74
+ };
75
+ two: {
76
+ x: number;
77
+ y: number;
78
+ };
79
+ root: {
80
+ x: "right" | "left";
81
+ y: "top" | "bottom";
82
+ };
83
+ }, {
84
+ one: {
85
+ x: number;
86
+ y: number;
87
+ };
88
+ two: {
89
+ x: number;
90
+ y: number;
91
+ };
92
+ root: {
93
+ x: "right" | "left";
94
+ y: "top" | "bottom";
95
+ };
96
+ }>;
97
+ export type Box = z.infer<typeof box>;
98
+ export type CSS = z.infer<typeof cssBox>;
99
+ export type DOMRect = z.infer<typeof domRect>;
100
+ type Crude = DOMRect | Box | {
101
+ getBoundingClientRect: () => DOMRect;
102
+ };
103
+ /** A box centered at (0,0) with a width and height of 0. */
104
+ export declare const ZERO: {
105
+ one: {
106
+ x: number; /**
107
+ * Box represents a general box in 2D space. It typically represents a bounding box
108
+ * for a DOM element, but can also represent a box in clip space or decimal space.
109
+ *
110
+ * It'simportant to note that the behavior of a Box varies depending on its coordinate
111
+ * system.Make sure you're aware of which coordinate system you're using.
112
+ *
113
+ * Many of the properties and methods on a Box access the same semantic value. The
114
+ * different accessors are there for ease of use and semantics.
115
+ */
116
+ y: number;
117
+ };
118
+ two: {
119
+ x: number; /**
120
+ * Box represents a general box in 2D space. It typically represents a bounding box
121
+ * for a DOM element, but can also represent a box in clip space or decimal space.
122
+ *
123
+ * It'simportant to note that the behavior of a Box varies depending on its coordinate
124
+ * system.Make sure you're aware of which coordinate system you're using.
125
+ *
126
+ * Many of the properties and methods on a Box access the same semantic value. The
127
+ * different accessors are there for ease of use and semantics.
128
+ */
129
+ y: number;
130
+ };
131
+ root: {
132
+ x: "right" | "left";
133
+ y: "top" | "bottom";
134
+ };
135
+ };
136
+ /**
137
+ * A box centered at (0,0) with a width and height of 1, and rooted in the
138
+ * bottom left. Note that pixel space is typically rooted in the top left.
139
+ */
140
+ export declare const DECIMAL: {
141
+ one: {
142
+ x: number; /**
143
+ * Box represents a general box in 2D space. It typically represents a bounding box
144
+ * for a DOM element, but can also represent a box in clip space or decimal space.
145
+ *
146
+ * It'simportant to note that the behavior of a Box varies depending on its coordinate
147
+ * system.Make sure you're aware of which coordinate system you're using.
148
+ *
149
+ * Many of the properties and methods on a Box access the same semantic value. The
150
+ * different accessors are there for ease of use and semantics.
151
+ */
152
+ y: number;
153
+ };
154
+ two: {
155
+ x: number;
156
+ y: number;
157
+ };
158
+ root: {
159
+ x: "right" | "left";
160
+ y: "top" | "bottom";
161
+ };
162
+ };
163
+ export declare const copy: (b: Box, root?: location.CornerXY) => Box;
164
+ /**
165
+ * Box represents a general box in 2D space. It typically represents a bounding box
166
+ * for a DOM element, but can also represent a box in clip space or decimal space.
167
+ *
168
+ * It'simportant to note that the behavior of a Box varies depending on its coordinate
169
+ * system.Make sure you're aware of which coordinate system you're using.
170
+ *
171
+ * Many of the properties and methods on a Box access the same semantic value. The
172
+ * different accessors are there for ease of use and semantics.
173
+ */
174
+ export declare const construct: (first: number | DOMRect | xy.XY | Box | {
175
+ getBoundingClientRect: () => DOMRect;
176
+ }, second?: number | xy.XY | dimensions.Dimensions | dimensions.Signed, width?: number, height?: number, coordinateRoot?: location.CornerXY) => Box;
177
+ /**
178
+ * Checks if a box contains a point or another box.
179
+ *
180
+ * @param value - The point or box to check.
181
+ * @returns true if the box inclusively contains the point or box and false otherwise.
182
+ */
183
+ export declare const contains: (b: Crude, value: Box | xy.XY) => boolean;
184
+ /**
185
+ * @returns true if the given box is semantically equal to this box and false otherwise.
186
+ */
187
+ export declare const equals: (a: Box, b: Box) => boolean;
188
+ /**
189
+ * @returns the dimensions of the box. Note that these dimensions are guaranteed to
190
+ * be positive. To get the signed dimensions, use the `signedDims` property.
191
+ */
192
+ export declare const dims: (b: Box) => dimensions.Dimensions;
193
+ /**
194
+ * @returns the dimensions of the box. Note that these dimensions may be negative.
195
+ * To get the unsigned dimensions, use the `dims` property.
196
+ */
197
+ export declare const signedDims: (b: Box) => dimensions.Signed;
198
+ /**
199
+ * @returns the css representation of the box.
200
+ */
201
+ export declare const css: (b: Box) => CSS;
202
+ export declare const dim: (b: Crude, dir: direction.Crude, signed?: boolean) => number;
203
+ /** @returns the pont corresponding to the given corner of the box. */
204
+ export declare const xyLoc: (b: Crude, l: location.XY) => xy.XY;
205
+ /**
206
+ * @returns a one dimensional coordinate corresponding to the location of the given
207
+ * side of the box i.e. the x coordinate of the left side, the y coordinate of the
208
+ * top side, etc.
209
+ */
210
+ export declare const loc: (b: Crude, loc: location.Location) => number;
211
+ export declare const locPoint: (b: Box, loc_: location.Location) => xy.XY;
212
+ export declare const isZero: (b: Box) => boolean;
213
+ export declare const width: (b: Crude) => number;
214
+ export declare const height: (b: Crude) => number;
215
+ export declare const signedWidth: (b: Crude) => number;
216
+ export declare const signedHeight: (b: Crude) => number;
217
+ export declare const topLeft: (b: Crude) => xy.XY;
218
+ export declare const topRight: (b: Crude) => xy.XY;
219
+ export declare const bottomLeft: (b: Crude) => xy.XY;
220
+ export declare const bottomRight: (b: Crude) => xy.XY;
221
+ export declare const right: (b: Crude) => number;
222
+ export declare const bottom: (b: Crude) => number;
223
+ export declare const left: (b: Crude) => number;
224
+ export declare const top: (b: Crude) => number;
225
+ export declare const center: (b: Crude) => xy.XY;
226
+ export declare const x: (b: Crude) => number;
227
+ export declare const y: (b: Crude) => number;
228
+ export declare const root: (b: Crude) => xy.XY;
229
+ export declare const xBounds: (b: Crude) => bounds.Bounds;
230
+ export declare const yBounds: (b: Crude) => bounds.Bounds;
231
+ export declare const reRoot: (b: Box, corner: location.CornerXY) => Box;
232
+ /**
233
+ * Reposition a box so that it is visible within a given bound.
234
+ *
235
+ * @param target The box to reposition - Only works if the root is topLeft
236
+ * @param bound The box to reposition within - Only works if the root is topLeft
237
+ *
238
+ * @returns the repsoitioned box and a boolean indicating if the box was repositioned
239
+ * or not.
240
+ */
241
+ export declare const positionSoVisible: (target_: Crude, bound_: Crude) => [Box, boolean];
242
+ /**
243
+ * Reposition a box so that it is centered within a given bound.
244
+ *
245
+ * @param target The box to reposition - Only works if the root is topLeft
246
+ * @param bound The box to reposition within - Only works if the root is topLeft
247
+ * @returns the repsoitioned box
248
+ */
249
+ export declare const positionInCenter: (target_: Crude, bound_: Crude) => Box;
250
+ export declare const isBox: (value: unknown) => value is {
251
+ one: {
252
+ x: number;
253
+ y: number;
254
+ };
255
+ two: {
256
+ x: number;
257
+ y: number;
258
+ };
259
+ root: {
260
+ x: "right" | "left";
261
+ y: "top" | "bottom";
262
+ };
263
+ };
264
+ export declare const aspect: (b: Box) => number;
265
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,59 @@
1
+ import { z } from "zod";
2
+ import { dimensions, type Dimensions } from '../spatial/base';
3
+ export { dimensions, type Dimensions };
4
+ export declare const signed: z.ZodObject<{
5
+ signedWidth: z.ZodNumber;
6
+ signedHeight: z.ZodNumber;
7
+ }, "strip", z.ZodTypeAny, {
8
+ signedWidth: number;
9
+ signedHeight: number;
10
+ }, {
11
+ signedWidth: number;
12
+ signedHeight: number;
13
+ }>;
14
+ export declare const crude: z.ZodUnion<[z.ZodObject<{
15
+ width: z.ZodNumber;
16
+ height: z.ZodNumber;
17
+ }, "strip", z.ZodTypeAny, {
18
+ width: number;
19
+ height: number;
20
+ }, {
21
+ width: number;
22
+ height: number;
23
+ }>, z.ZodObject<{
24
+ signedWidth: z.ZodNumber;
25
+ signedHeight: z.ZodNumber;
26
+ }, "strip", z.ZodTypeAny, {
27
+ signedWidth: number;
28
+ signedHeight: number;
29
+ }, {
30
+ signedWidth: number;
31
+ signedHeight: number;
32
+ }>, z.ZodObject<{
33
+ x: z.ZodNumber;
34
+ y: z.ZodNumber;
35
+ }, "strip", z.ZodTypeAny, {
36
+ x: number;
37
+ y: number;
38
+ }, {
39
+ x: number;
40
+ y: number;
41
+ }>, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>]>;
42
+ export type Crude = z.infer<typeof crude>;
43
+ export declare const ZERO: {
44
+ width: number;
45
+ height: number;
46
+ };
47
+ export declare const DECIMAL: {
48
+ width: number;
49
+ height: number;
50
+ };
51
+ export declare const construct: (width: number | Crude, height?: number) => Dimensions;
52
+ export type Signed = z.infer<typeof signed>;
53
+ export declare const equals: (ca: Crude, cb?: Crude | null) => boolean;
54
+ export declare const swap: (ca: Crude) => Dimensions;
55
+ export declare const svgViewBox: (ca: Crude) => string;
56
+ export declare const couple: (ca: Crude) => [number, number];
57
+ export declare const max: (crude: Crude[]) => Dimensions;
58
+ export declare const min: (crude: Crude[]) => Dimensions;
59
+ export declare const scale: (ca: Crude, factor: number) => Dimensions;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import { type Dimension, type Direction, type Location, type direction, type SignedDimension, type CrudeDirection } from '../spatial/base';
2
+ export type { Direction, direction };
3
+ export declare const crude: import("zod").ZodUnion<[import("zod").ZodEnum<["x", "y"]>, import("zod").ZodEnum<["top", "right", "bottom", "left", "center"]>]>;
4
+ export type Crude = CrudeDirection;
5
+ export declare const construct: (c: Crude) => Direction;
6
+ export declare const swap: (direction: CrudeDirection) => Direction;
7
+ export declare const dimension: (direction: CrudeDirection) => Dimension;
8
+ export declare const location: (direction: CrudeDirection) => Location;
9
+ export declare const isDirection: (c: unknown) => c is "x" | "y";
10
+ export declare const signedDimension: (direction: CrudeDirection) => SignedDimension;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export * as bounds from '../spatial/bounds';
2
+ export * as box from '../spatial/box';
3
+ export * as dimensions from '../spatial/dimensions';
4
+ export * as direction from '../spatial/direction';
5
+ export * as location from '../spatial/location';
6
+ export * as xy from '../spatial/xy';
7
+ export * as scale from '../spatial/scale';
8
+ export * as spatial from '../spatial/spatial';
@@ -0,0 +1 @@
1
+ export * from '../spatial/external';
@@ -0,0 +1,52 @@
1
+ import { z } from "zod";
2
+ import { location, type Location, X_LOCATIONS, Y_LOCATIONS, CENTER_LOCATIONS, type XLocation, type OuterLocation, type YLocation, outerLocation, type Direction, type CrudeLocation } from '../spatial/base';
3
+ export { location, type Location, X_LOCATIONS, Y_LOCATIONS, CENTER_LOCATIONS, outerLocation as outer, };
4
+ export declare const x: z.ZodEnum<["left", "right"]>;
5
+ export declare const y: z.ZodEnum<["top", "bottom"]>;
6
+ export type X = XLocation;
7
+ export type Y = YLocation;
8
+ export type Outer = OuterLocation;
9
+ export declare const crude: z.ZodUnion<[z.ZodEnum<["x", "y"]>, z.ZodEnum<["top", "right", "bottom", "left", "center"]>, z.ZodType<String, z.ZodTypeDef, String>]>;
10
+ export type Crude = CrudeLocation;
11
+ export declare const construct: (cl: Crude) => Location;
12
+ export declare const swap: (cl: Crude) => Location;
13
+ export declare const rotate90: (cl: Crude) => Location;
14
+ export declare const direction: (cl: Crude) => Direction;
15
+ export declare const xy: z.ZodObject<{
16
+ x: z.ZodEnum<["top", "right", "bottom", "left", "center"]>;
17
+ y: z.ZodEnum<["top", "right", "bottom", "left", "center"]>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ x: "center" | "top" | "right" | "bottom" | "left";
20
+ y: "center" | "top" | "right" | "bottom" | "left";
21
+ }, {
22
+ x: "center" | "top" | "right" | "bottom" | "left";
23
+ y: "center" | "top" | "right" | "bottom" | "left";
24
+ }>;
25
+ export declare const corner: z.ZodObject<{
26
+ x: z.ZodEnum<["left", "right"]>;
27
+ y: z.ZodEnum<["top", "bottom"]>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ x: "right" | "left";
30
+ y: "top" | "bottom";
31
+ }, {
32
+ x: "right" | "left";
33
+ y: "top" | "bottom";
34
+ }>;
35
+ export type XY = z.infer<typeof xy>;
36
+ export type CornerXY = z.infer<typeof corner>;
37
+ export type CornerXYString = "topLeft" | "topRight" | "bottomLeft" | "bottomRight";
38
+ export declare const TOP_LEFT: CornerXY;
39
+ export declare const TOP_RIGHT: CornerXY;
40
+ export declare const BOTTOM_LEFT: CornerXY;
41
+ export declare const BOTTOM_RIGHT: CornerXY;
42
+ export declare const CENTER: XY;
43
+ export declare const TOP_CENTER: XY;
44
+ export declare const BOTTOM_CENTER: XY;
45
+ export declare const RIGHT_CENTER: XY;
46
+ export declare const LEFT_CENTER: XY;
47
+ export declare const xyEquals: (a: XY, b: XY) => boolean;
48
+ export declare const xyCouple: (a: XY) => [Location, Location];
49
+ export declare const isX: (a: Crude) => boolean;
50
+ export declare const isY: (a: Crude) => boolean;
51
+ export declare const xyToString: (a: XY) => string;
52
+ export declare const constructXY: (x: Crude | XY, y?: Crude) => XY;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import * as xy from '../spatial/xy';
2
+ export declare const posititonSoVisible: (target: HTMLElement, p: xy.XY) => [xy.XY, boolean];
@@ -0,0 +1,241 @@
1
+ import { z } from "zod";
2
+ import * as bounds from '../spatial/bounds';
3
+ import { type Box } from '../spatial/box';
4
+ import type * as dims from '../spatial/dimensions';
5
+ import * as location from '../spatial/location';
6
+ import * as xy from '../spatial/xy';
7
+ export declare const crudeXYTransform: z.ZodObject<{
8
+ offset: z.ZodUnion<[z.ZodNumber, z.ZodObject<{
9
+ x: z.ZodNumber;
10
+ y: z.ZodNumber;
11
+ }, "strip", z.ZodTypeAny, {
12
+ x: number;
13
+ y: number;
14
+ }, {
15
+ x: number;
16
+ y: number;
17
+ }>, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{
18
+ width: z.ZodNumber;
19
+ height: z.ZodNumber;
20
+ }, "strip", z.ZodTypeAny, {
21
+ width: number;
22
+ height: number;
23
+ }, {
24
+ width: number;
25
+ height: number;
26
+ }>, z.ZodObject<{
27
+ signedWidth: z.ZodNumber;
28
+ signedHeight: z.ZodNumber;
29
+ }, "strip", z.ZodTypeAny, {
30
+ signedWidth: number;
31
+ signedHeight: number;
32
+ }, {
33
+ signedWidth: number;
34
+ signedHeight: number;
35
+ }>, z.ZodObject<{
36
+ clientX: z.ZodNumber;
37
+ clientY: z.ZodNumber;
38
+ }, "strip", z.ZodTypeAny, {
39
+ clientX: number;
40
+ clientY: number;
41
+ }, {
42
+ clientX: number;
43
+ clientY: number;
44
+ }>]>;
45
+ scale: z.ZodUnion<[z.ZodNumber, z.ZodObject<{
46
+ x: z.ZodNumber;
47
+ y: z.ZodNumber;
48
+ }, "strip", z.ZodTypeAny, {
49
+ x: number;
50
+ y: number;
51
+ }, {
52
+ x: number;
53
+ y: number;
54
+ }>, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{
55
+ width: z.ZodNumber;
56
+ height: z.ZodNumber;
57
+ }, "strip", z.ZodTypeAny, {
58
+ width: number;
59
+ height: number;
60
+ }, {
61
+ width: number;
62
+ height: number;
63
+ }>, z.ZodObject<{
64
+ signedWidth: z.ZodNumber;
65
+ signedHeight: z.ZodNumber;
66
+ }, "strip", z.ZodTypeAny, {
67
+ signedWidth: number;
68
+ signedHeight: number;
69
+ }, {
70
+ signedWidth: number;
71
+ signedHeight: number;
72
+ }>, z.ZodObject<{
73
+ clientX: z.ZodNumber;
74
+ clientY: z.ZodNumber;
75
+ }, "strip", z.ZodTypeAny, {
76
+ clientX: number;
77
+ clientY: number;
78
+ }, {
79
+ clientX: number;
80
+ clientY: number;
81
+ }>]>;
82
+ }, "strip", z.ZodTypeAny, {
83
+ offset: (number | [number, number] | {
84
+ width: number;
85
+ height: number;
86
+ } | {
87
+ signedWidth: number;
88
+ signedHeight: number;
89
+ } | {
90
+ x: number;
91
+ y: number;
92
+ } | {
93
+ clientX: number;
94
+ clientY: number;
95
+ }) & (number | [number, number] | {
96
+ width: number;
97
+ height: number;
98
+ } | {
99
+ signedWidth: number;
100
+ signedHeight: number;
101
+ } | {
102
+ x: number;
103
+ y: number;
104
+ } | {
105
+ clientX: number;
106
+ clientY: number;
107
+ } | undefined);
108
+ scale: (number | [number, number] | {
109
+ width: number;
110
+ height: number;
111
+ } | {
112
+ signedWidth: number;
113
+ signedHeight: number;
114
+ } | {
115
+ x: number;
116
+ y: number;
117
+ } | {
118
+ clientX: number;
119
+ clientY: number;
120
+ }) & (number | [number, number] | {
121
+ width: number;
122
+ height: number;
123
+ } | {
124
+ signedWidth: number;
125
+ signedHeight: number;
126
+ } | {
127
+ x: number;
128
+ y: number;
129
+ } | {
130
+ clientX: number;
131
+ clientY: number;
132
+ } | undefined);
133
+ }, {
134
+ offset: (number | [number, number] | {
135
+ width: number;
136
+ height: number;
137
+ } | {
138
+ signedWidth: number;
139
+ signedHeight: number;
140
+ } | {
141
+ x: number;
142
+ y: number;
143
+ } | {
144
+ clientX: number;
145
+ clientY: number;
146
+ }) & (number | [number, number] | {
147
+ width: number;
148
+ height: number;
149
+ } | {
150
+ signedWidth: number;
151
+ signedHeight: number;
152
+ } | {
153
+ x: number;
154
+ y: number;
155
+ } | {
156
+ clientX: number;
157
+ clientY: number;
158
+ } | undefined);
159
+ scale: (number | [number, number] | {
160
+ width: number;
161
+ height: number;
162
+ } | {
163
+ signedWidth: number;
164
+ signedHeight: number;
165
+ } | {
166
+ x: number;
167
+ y: number;
168
+ } | {
169
+ clientX: number;
170
+ clientY: number;
171
+ }) & (number | [number, number] | {
172
+ width: number;
173
+ height: number;
174
+ } | {
175
+ signedWidth: number;
176
+ signedHeight: number;
177
+ } | {
178
+ x: number;
179
+ y: number;
180
+ } | {
181
+ clientX: number;
182
+ clientY: number;
183
+ } | undefined);
184
+ }>;
185
+ export type XYTransformT = z.infer<typeof crudeXYTransform>;
186
+ export type BoundVariant = "domain" | "range";
187
+ type ValueType = "position" | "dimension";
188
+ type Operation = (currScale: bounds.Bounds | null, type: ValueType, number: number, reverse: boolean) => OperationReturn;
189
+ type OperationReturn = [bounds.Bounds | null, number];
190
+ interface TypedOperation extends Operation {
191
+ type: "translate" | "magnify" | "scale" | "invert" | "clamp" | "re-bound";
192
+ }
193
+ export declare class Scale {
194
+ ops: TypedOperation[];
195
+ currBounds: bounds.Bounds | null;
196
+ currType: ValueType | null;
197
+ private reversed;
198
+ constructor();
199
+ static translate(value: number): Scale;
200
+ static magnify(value: number): Scale;
201
+ static scale(lowerOrBound: number | bounds.Bounds, upper?: number): Scale;
202
+ translate(value: number): Scale;
203
+ magnify(value: number): Scale;
204
+ scale(lowerOrBound: number | bounds.Bounds, upper?: number): Scale;
205
+ clamp(lowerOrBound: number | bounds.Bounds, upper?: number): Scale;
206
+ reBound(lowerOrBound: number | bounds.Bounds, upper?: number): Scale;
207
+ invert(): Scale;
208
+ pos(v: number): number;
209
+ dim(v: number): number;
210
+ private new;
211
+ private exec;
212
+ reverse(): Scale;
213
+ static readonly IDENTITY: Scale;
214
+ }
215
+ export declare const xyScaleToTransform: (scale: XY) => XYTransformT;
216
+ export declare class XY {
217
+ x: Scale;
218
+ y: Scale;
219
+ currRoot: location.CornerXY | null;
220
+ constructor(x?: Scale, y?: Scale, root?: location.CornerXY | null);
221
+ static translate(xy: number | xy.XY, y?: number): XY;
222
+ static translateX(x: number): XY;
223
+ static translateY(y: number): XY;
224
+ static clamp(box: Box): XY;
225
+ static magnify(xy: xy.XY): XY;
226
+ static scale(box: dims.Dimensions | Box): XY;
227
+ static reBound(box: Box): XY;
228
+ translate(cp: number | xy.Crude, y?: number): XY;
229
+ translateX(x: number): XY;
230
+ translateY(y: number): XY;
231
+ magnify(xy: xy.XY): XY;
232
+ scale(b: Box | dims.Dimensions): XY;
233
+ reBound(b: Box): XY;
234
+ clamp(b: Box): XY;
235
+ copy(): XY;
236
+ reverse(): XY;
237
+ pos(xy: xy.XY): xy.XY;
238
+ box(b: Box): Box;
239
+ static readonly IDENTITY: XY;
240
+ }
241
+ export {};