@retikz/core 0.1.0 → 0.2.0-alpha.2

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 (117) hide show
  1. package/dist/es/compile/anchor-cache.d.ts +12 -0
  2. package/dist/es/compile/anchor-cache.d.ts.map +1 -0
  3. package/dist/es/compile/anchor-cache.js +41 -0
  4. package/dist/es/compile/compile.d.ts +2 -2
  5. package/dist/es/compile/compile.d.ts.map +1 -1
  6. package/dist/es/compile/compile.js +150 -40
  7. package/dist/es/compile/index.d.ts +1 -0
  8. package/dist/es/compile/index.d.ts.map +1 -1
  9. package/dist/es/compile/name-stack.d.ts +81 -0
  10. package/dist/es/compile/name-stack.d.ts.map +1 -0
  11. package/dist/es/compile/name-stack.js +104 -0
  12. package/dist/es/compile/node.d.ts +9 -5
  13. package/dist/es/compile/node.d.ts.map +1 -1
  14. package/dist/es/compile/node.js +19 -11
  15. package/dist/es/compile/path/anchor.d.ts +11 -5
  16. package/dist/es/compile/path/anchor.d.ts.map +1 -1
  17. package/dist/es/compile/path/anchor.js +24 -13
  18. package/dist/es/compile/path/index.d.ts +9 -3
  19. package/dist/es/compile/path/index.d.ts.map +1 -1
  20. package/dist/es/compile/path/index.js +18 -17
  21. package/dist/es/compile/path/label.d.ts +1 -1
  22. package/dist/es/compile/path/label.d.ts.map +1 -1
  23. package/dist/es/compile/path/label.js +17 -4
  24. package/dist/es/compile/path/relative.d.ts +10 -4
  25. package/dist/es/compile/path/relative.d.ts.map +1 -1
  26. package/dist/es/compile/path/relative.js +16 -8
  27. package/dist/es/compile/position.d.ts +19 -3
  28. package/dist/es/compile/position.d.ts.map +1 -1
  29. package/dist/es/compile/position.js +28 -8
  30. package/dist/es/compile/scope.d.ts +66 -0
  31. package/dist/es/compile/scope.d.ts.map +1 -0
  32. package/dist/es/compile/scope.js +256 -0
  33. package/dist/es/compile/style.d.ts +46 -0
  34. package/dist/es/compile/style.d.ts.map +1 -0
  35. package/dist/es/compile/style.js +259 -0
  36. package/dist/es/index.d.ts +2 -2
  37. package/dist/es/index.d.ts.map +1 -1
  38. package/dist/es/index.js +3 -1
  39. package/dist/es/ir/index.d.ts +2 -0
  40. package/dist/es/ir/index.d.ts.map +1 -1
  41. package/dist/es/ir/node.d.ts +5 -2
  42. package/dist/es/ir/node.d.ts.map +1 -1
  43. package/dist/es/ir/node.js +1 -0
  44. package/dist/es/ir/path/path.d.ts +531 -0
  45. package/dist/es/ir/path/path.d.ts.map +1 -1
  46. package/dist/es/ir/path/path.js +1 -0
  47. package/dist/es/ir/path/step.d.ts +834 -0
  48. package/dist/es/ir/path/step.d.ts.map +1 -1
  49. package/dist/es/ir/path/step.js +5 -1
  50. package/dist/es/ir/scene.d.ts +18 -3542
  51. package/dist/es/ir/scene.d.ts.map +1 -1
  52. package/dist/es/ir/scene.js +11 -3
  53. package/dist/es/ir/scope.d.ts +3690 -0
  54. package/dist/es/ir/scope.d.ts.map +1 -0
  55. package/dist/es/ir/scope.js +89 -0
  56. package/dist/es/ir/transform.d.ts +204 -0
  57. package/dist/es/ir/transform.d.ts.map +1 -0
  58. package/dist/es/ir/transform.js +56 -0
  59. package/dist/lib/compile/anchor-cache.cjs +41 -0
  60. package/dist/lib/compile/anchor-cache.d.ts +12 -0
  61. package/dist/lib/compile/anchor-cache.d.ts.map +1 -0
  62. package/dist/lib/compile/compile.cjs +150 -40
  63. package/dist/lib/compile/compile.d.ts +2 -2
  64. package/dist/lib/compile/compile.d.ts.map +1 -1
  65. package/dist/lib/compile/index.d.ts +1 -0
  66. package/dist/lib/compile/index.d.ts.map +1 -1
  67. package/dist/lib/compile/name-stack.cjs +104 -0
  68. package/dist/lib/compile/name-stack.d.ts +81 -0
  69. package/dist/lib/compile/name-stack.d.ts.map +1 -0
  70. package/dist/lib/compile/node.cjs +19 -11
  71. package/dist/lib/compile/node.d.ts +9 -5
  72. package/dist/lib/compile/node.d.ts.map +1 -1
  73. package/dist/lib/compile/path/anchor.cjs +23 -12
  74. package/dist/lib/compile/path/anchor.d.ts +11 -5
  75. package/dist/lib/compile/path/anchor.d.ts.map +1 -1
  76. package/dist/lib/compile/path/index.cjs +18 -17
  77. package/dist/lib/compile/path/index.d.ts +9 -3
  78. package/dist/lib/compile/path/index.d.ts.map +1 -1
  79. package/dist/lib/compile/path/label.cjs +17 -4
  80. package/dist/lib/compile/path/label.d.ts +1 -1
  81. package/dist/lib/compile/path/label.d.ts.map +1 -1
  82. package/dist/lib/compile/path/relative.cjs +16 -8
  83. package/dist/lib/compile/path/relative.d.ts +10 -4
  84. package/dist/lib/compile/path/relative.d.ts.map +1 -1
  85. package/dist/lib/compile/position.cjs +28 -8
  86. package/dist/lib/compile/position.d.ts +19 -3
  87. package/dist/lib/compile/position.d.ts.map +1 -1
  88. package/dist/lib/compile/scope.cjs +261 -0
  89. package/dist/lib/compile/scope.d.ts +66 -0
  90. package/dist/lib/compile/scope.d.ts.map +1 -0
  91. package/dist/lib/compile/style.cjs +262 -0
  92. package/dist/lib/compile/style.d.ts +46 -0
  93. package/dist/lib/compile/style.d.ts.map +1 -0
  94. package/dist/lib/index.cjs +8 -0
  95. package/dist/lib/index.d.ts +2 -2
  96. package/dist/lib/index.d.ts.map +1 -1
  97. package/dist/lib/ir/index.d.ts +2 -0
  98. package/dist/lib/ir/index.d.ts.map +1 -1
  99. package/dist/lib/ir/node.cjs +1 -0
  100. package/dist/lib/ir/node.d.ts +5 -2
  101. package/dist/lib/ir/node.d.ts.map +1 -1
  102. package/dist/lib/ir/path/path.cjs +1 -0
  103. package/dist/lib/ir/path/path.d.ts +531 -0
  104. package/dist/lib/ir/path/path.d.ts.map +1 -1
  105. package/dist/lib/ir/path/step.cjs +5 -1
  106. package/dist/lib/ir/path/step.d.ts +834 -0
  107. package/dist/lib/ir/path/step.d.ts.map +1 -1
  108. package/dist/lib/ir/scene.cjs +11 -3
  109. package/dist/lib/ir/scene.d.ts +18 -3542
  110. package/dist/lib/ir/scene.d.ts.map +1 -1
  111. package/dist/lib/ir/scope.cjs +94 -0
  112. package/dist/lib/ir/scope.d.ts +3690 -0
  113. package/dist/lib/ir/scope.d.ts.map +1 -0
  114. package/dist/lib/ir/transform.cjs +56 -0
  115. package/dist/lib/ir/transform.d.ts +204 -0
  116. package/dist/lib/ir/transform.d.ts.map +1 -0
  117. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../src/ir/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,KAAK,MAAM,EAAc,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAE,KAAK,MAAM,EAAc,MAAM,QAAQ,CAAC;AAEjD,OAAO,EAAE,KAAK,WAAW,EAAmB,MAAM,aAAa,CAAC;AAOhE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMnB,CAAC;AAEZ;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmGrB,CAAC"}
@@ -0,0 +1,56 @@
1
+ const require_position = require("./position/position.cjs");
2
+ const require_polar_position = require("./position/polar-position.cjs");
3
+ const require_at_position = require("./position/at-position.cjs");
4
+ let zod = require("zod");
5
+ //#region src/ir/transform.ts
6
+ var TranslateSchema = zod.z.object({
7
+ kind: zod.z.literal("translate").describe("Discriminator: Cartesian translate (the 3-variant Scene transform shape)."),
8
+ x: zod.z.number().describe("Cartesian x translation in user units."),
9
+ y: zod.z.number().describe("Cartesian y translation in user units (screen y-down).")
10
+ }).describe("Cartesian translate transform; mirrors the Position [x, y] literal. Lowered directly to Scene `GroupPrim` translate.");
11
+ var PolarTranslateSchema = zod.z.object({
12
+ kind: zod.z.literal("polar-translate").describe("Discriminator: polar translate; mirrors PolarPosition."),
13
+ origin: zod.z.union([
14
+ zod.z.string().min(1),
15
+ require_position.PositionSchema,
16
+ require_polar_position.PolarPositionSchema
17
+ ]).optional().describe("Origin reference (same union as PolarPosition.origin): node id string / Cartesian [x, y] / nested PolarPosition; omit = origin at (0, 0) so this acts as an absolute polar shift."),
18
+ angle: zod.z.number().finite().describe("Angle in degrees; 0° = +x, 90° = +y (screen-down); matches PolarPosition.angle convention."),
19
+ radius: zod.z.number().finite().describe("Radius / distance in user units; negative values are accepted (equivalent to angle + 180°).")
20
+ }).describe("Polar translate transform; mirrors PolarPosition. Lowered to Cartesian translate at compile time via resolvePosition.");
21
+ var AtTranslateSchema = zod.z.object({
22
+ kind: zod.z.literal("at-translate").describe("Discriminator: direction-relative translate; mirrors AtPosition."),
23
+ direction: zod.z.nativeEnum(require_at_position.AT_DIRECTIONS).describe("Direction enum (8 values, shared with AtPosition.direction)."),
24
+ of: zod.z.string().min(1).describe("Referent node id; must be defined earlier in the IR (forward references rejected, mirroring AtPosition.of)."),
25
+ distance: zod.z.number().positive().optional().describe("Distance along direction in user units; omit → falls back to CompileOptions.nodeDistance (same default chain as AtPosition.distance).")
26
+ }).describe("Direction-relative translate transform; mirrors AtPosition. Lowered to Cartesian translate at compile time via resolvePosition.");
27
+ var OffsetTranslateSchema = zod.z.object({
28
+ kind: zod.z.literal("offset-translate").describe("Discriminator: offset-from-referent translate; mirrors OffsetPosition."),
29
+ of: zod.z.union([
30
+ zod.z.string().min(1),
31
+ require_position.PositionSchema,
32
+ require_polar_position.PolarPositionSchema
33
+ ]).describe("Referent base point (same union as OffsetPosition.of): node id (forward references rejected) / Cartesian [x, y] / PolarPosition."),
34
+ offset: zod.z.tuple([zod.z.number().finite(), zod.z.number().finite()]).optional().describe("Additional [dx, dy] offset in user units; omit = [0, 0] so the transform translates exactly to the referent.")
35
+ }).describe("Offset translate transform; mirrors OffsetPosition. Lowered to Cartesian translate at compile time via resolvePosition.");
36
+ var RotateSchema = zod.z.object({
37
+ kind: zod.z.literal("rotate").describe("Discriminator: rotation about a point."),
38
+ degrees: zod.z.number().finite().describe("Rotation angle in degrees; positive = visually clockwise under screen y-down."),
39
+ cx: zod.z.number().finite().optional().describe("Rotation center x in user units; omit = 0 (rotate about local origin)."),
40
+ cy: zod.z.number().finite().optional().describe("Rotation center y in user units; omit = 0 (rotate about local origin).")
41
+ }).describe("Rotation transform; identical shape to Scene `RotateTransform`. Passed through to GroupPrim without further lowering.");
42
+ var ScaleSchema = zod.z.object({
43
+ kind: zod.z.literal("scale").describe("Discriminator: uniform / anisotropic scale."),
44
+ x: zod.z.number().finite().describe("Scale factor on the x axis. Zero scale collapses the coordinate system and is not invertible — relative positions inside the scope degrade to the local origin (0, 0). Avoid zero in practice; use a tiny positive value if a \"near-invisible\" effect is desired."),
45
+ y: zod.z.number().finite().optional().describe("Scale factor on the y axis; omit = x (uniform scaling). Zero scale falls back to (0, 0) for relative position inverse projection (see `x`).")
46
+ }).describe("Scale transform; identical shape to Scene `ScaleTransform`. Passed through to GroupPrim without further lowering.");
47
+ var TransformSchema = zod.z.discriminatedUnion("kind", [
48
+ TranslateSchema,
49
+ PolarTranslateSchema,
50
+ AtTranslateSchema,
51
+ OffsetTranslateSchema,
52
+ RotateSchema,
53
+ ScaleSchema
54
+ ]).describe("IR-level transform; 6 variants. The 4 translate variants (translate / polar-translate / at-translate / offset-translate) mirror the Node.position union one-for-one; rotate and scale match the Scene `Transform` shape. At compile time the 4 translate variants are lowered to Cartesian translate via resolvePosition before being pushed onto the cumulative chain emitted to Scene `GroupPrim` (which stays at 3 variants).");
55
+ //#endregion
56
+ exports.TransformSchema = TransformSchema;
@@ -0,0 +1,204 @@
1
+ import { z } from 'zod';
2
+ declare const TranslateSchema: z.ZodObject<{
3
+ kind: z.ZodLiteral<"translate">;
4
+ x: z.ZodNumber;
5
+ y: z.ZodNumber;
6
+ }, "strip", z.ZodTypeAny, {
7
+ kind: "translate";
8
+ x: number;
9
+ y: number;
10
+ }, {
11
+ kind: "translate";
12
+ x: number;
13
+ y: number;
14
+ }>;
15
+ declare const PolarTranslateSchema: z.ZodObject<{
16
+ kind: z.ZodLiteral<"polar-translate">;
17
+ origin: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, z.ZodType<import('./position').PolarPosition, z.ZodTypeDef, import('./position').PolarPosition>]>>;
18
+ angle: z.ZodNumber;
19
+ radius: z.ZodNumber;
20
+ }, "strip", z.ZodTypeAny, {
21
+ angle: number;
22
+ radius: number;
23
+ kind: "polar-translate";
24
+ origin?: string | [number, number] | import('./position').PolarPosition | undefined;
25
+ }, {
26
+ angle: number;
27
+ radius: number;
28
+ kind: "polar-translate";
29
+ origin?: string | [number, number] | import('./position').PolarPosition | undefined;
30
+ }>;
31
+ declare const AtTranslateSchema: z.ZodObject<{
32
+ kind: z.ZodLiteral<"at-translate">;
33
+ direction: z.ZodNativeEnum<{
34
+ readonly above: "above";
35
+ readonly below: "below";
36
+ readonly left: "left";
37
+ readonly right: "right";
38
+ readonly 'above-left': "above-left";
39
+ readonly 'above-right': "above-right";
40
+ readonly 'below-left': "below-left";
41
+ readonly 'below-right': "below-right";
42
+ }>;
43
+ of: z.ZodString;
44
+ distance: z.ZodOptional<z.ZodNumber>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ direction: "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right";
47
+ of: string;
48
+ kind: "at-translate";
49
+ distance?: number | undefined;
50
+ }, {
51
+ direction: "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right";
52
+ of: string;
53
+ kind: "at-translate";
54
+ distance?: number | undefined;
55
+ }>;
56
+ declare const OffsetTranslateSchema: z.ZodObject<{
57
+ kind: z.ZodLiteral<"offset-translate">;
58
+ of: z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, z.ZodType<import('./position').PolarPosition, z.ZodTypeDef, import('./position').PolarPosition>]>;
59
+ offset: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
60
+ }, "strip", z.ZodTypeAny, {
61
+ of: string | [number, number] | import('./position').PolarPosition;
62
+ kind: "offset-translate";
63
+ offset?: [number, number] | undefined;
64
+ }, {
65
+ of: string | [number, number] | import('./position').PolarPosition;
66
+ kind: "offset-translate";
67
+ offset?: [number, number] | undefined;
68
+ }>;
69
+ declare const RotateSchema: z.ZodObject<{
70
+ kind: z.ZodLiteral<"rotate">;
71
+ degrees: z.ZodNumber;
72
+ cx: z.ZodOptional<z.ZodNumber>;
73
+ cy: z.ZodOptional<z.ZodNumber>;
74
+ }, "strip", z.ZodTypeAny, {
75
+ kind: "rotate";
76
+ degrees: number;
77
+ cx?: number | undefined;
78
+ cy?: number | undefined;
79
+ }, {
80
+ kind: "rotate";
81
+ degrees: number;
82
+ cx?: number | undefined;
83
+ cy?: number | undefined;
84
+ }>;
85
+ declare const ScaleSchema: z.ZodObject<{
86
+ kind: z.ZodLiteral<"scale">;
87
+ x: z.ZodNumber;
88
+ y: z.ZodOptional<z.ZodNumber>;
89
+ }, "strip", z.ZodTypeAny, {
90
+ kind: "scale";
91
+ x: number;
92
+ y?: number | undefined;
93
+ }, {
94
+ kind: "scale";
95
+ x: number;
96
+ y?: number | undefined;
97
+ }>;
98
+ export declare const TransformSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
99
+ kind: z.ZodLiteral<"translate">;
100
+ x: z.ZodNumber;
101
+ y: z.ZodNumber;
102
+ }, "strip", z.ZodTypeAny, {
103
+ kind: "translate";
104
+ x: number;
105
+ y: number;
106
+ }, {
107
+ kind: "translate";
108
+ x: number;
109
+ y: number;
110
+ }>, z.ZodObject<{
111
+ kind: z.ZodLiteral<"polar-translate">;
112
+ origin: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, z.ZodType<import('./position').PolarPosition, z.ZodTypeDef, import('./position').PolarPosition>]>>;
113
+ angle: z.ZodNumber;
114
+ radius: z.ZodNumber;
115
+ }, "strip", z.ZodTypeAny, {
116
+ angle: number;
117
+ radius: number;
118
+ kind: "polar-translate";
119
+ origin?: string | [number, number] | import('./position').PolarPosition | undefined;
120
+ }, {
121
+ angle: number;
122
+ radius: number;
123
+ kind: "polar-translate";
124
+ origin?: string | [number, number] | import('./position').PolarPosition | undefined;
125
+ }>, z.ZodObject<{
126
+ kind: z.ZodLiteral<"at-translate">;
127
+ direction: z.ZodNativeEnum<{
128
+ readonly above: "above";
129
+ readonly below: "below";
130
+ readonly left: "left";
131
+ readonly right: "right";
132
+ readonly 'above-left': "above-left";
133
+ readonly 'above-right': "above-right";
134
+ readonly 'below-left': "below-left";
135
+ readonly 'below-right': "below-right";
136
+ }>;
137
+ of: z.ZodString;
138
+ distance: z.ZodOptional<z.ZodNumber>;
139
+ }, "strip", z.ZodTypeAny, {
140
+ direction: "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right";
141
+ of: string;
142
+ kind: "at-translate";
143
+ distance?: number | undefined;
144
+ }, {
145
+ direction: "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right";
146
+ of: string;
147
+ kind: "at-translate";
148
+ distance?: number | undefined;
149
+ }>, z.ZodObject<{
150
+ kind: z.ZodLiteral<"offset-translate">;
151
+ of: z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, z.ZodType<import('./position').PolarPosition, z.ZodTypeDef, import('./position').PolarPosition>]>;
152
+ offset: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
153
+ }, "strip", z.ZodTypeAny, {
154
+ of: string | [number, number] | import('./position').PolarPosition;
155
+ kind: "offset-translate";
156
+ offset?: [number, number] | undefined;
157
+ }, {
158
+ of: string | [number, number] | import('./position').PolarPosition;
159
+ kind: "offset-translate";
160
+ offset?: [number, number] | undefined;
161
+ }>, z.ZodObject<{
162
+ kind: z.ZodLiteral<"rotate">;
163
+ degrees: z.ZodNumber;
164
+ cx: z.ZodOptional<z.ZodNumber>;
165
+ cy: z.ZodOptional<z.ZodNumber>;
166
+ }, "strip", z.ZodTypeAny, {
167
+ kind: "rotate";
168
+ degrees: number;
169
+ cx?: number | undefined;
170
+ cy?: number | undefined;
171
+ }, {
172
+ kind: "rotate";
173
+ degrees: number;
174
+ cx?: number | undefined;
175
+ cy?: number | undefined;
176
+ }>, z.ZodObject<{
177
+ kind: z.ZodLiteral<"scale">;
178
+ x: z.ZodNumber;
179
+ y: z.ZodOptional<z.ZodNumber>;
180
+ }, "strip", z.ZodTypeAny, {
181
+ kind: "scale";
182
+ x: number;
183
+ y?: number | undefined;
184
+ }, {
185
+ kind: "scale";
186
+ x: number;
187
+ y?: number | undefined;
188
+ }>]>;
189
+ /** IR 层 transform 类型——6 变体 discriminated union(4 translate + rotate + scale) */
190
+ export type IRTransform = z.infer<typeof TransformSchema>;
191
+ /** 笛卡尔 translate 子分支 */
192
+ export type IRTranslateTransform = z.infer<typeof TranslateSchema>;
193
+ /** 极坐标 translate 子分支 */
194
+ export type IRPolarTranslateTransform = z.infer<typeof PolarTranslateSchema>;
195
+ /** 相对方向 translate 子分支 */
196
+ export type IRAtTranslateTransform = z.infer<typeof AtTranslateSchema>;
197
+ /** 偏移 translate 子分支 */
198
+ export type IROffsetTranslateTransform = z.infer<typeof OffsetTranslateSchema>;
199
+ /** 旋转子分支 */
200
+ export type IRRotateTransform = z.infer<typeof RotateSchema>;
201
+ /** 缩放子分支 */
202
+ export type IRScaleTransform = z.infer<typeof ScaleSchema>;
203
+ export {};
204
+ //# sourceMappingURL=transform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/ir/transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,QAAA,MAAM,eAAe;;;;;;;;;;;;EAYlB,CAAC;AAEJ,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;EA0BvB,CAAC;AAEJ,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;EAwBpB,CAAC;AAEJ,QAAA,MAAM,qBAAqB;;;;;;;;;;;;EAmBxB,CAAC;AAEJ,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;EAsBf,CAAC;AAEJ,QAAA,MAAM,WAAW;;;;;;;;;;;;EAqBd,CAAC;AAEJ,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAWzB,CAAC;AAEJ,gFAAgF;AAChF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,wBAAwB;AACxB,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACnE,wBAAwB;AACxB,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAC7E,yBAAyB;AACzB,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACvE,uBAAuB;AACvB,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC/E,YAAY;AACZ,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAC7D,YAAY;AACZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@retikz/core",
3
- "version": "0.1.0",
3
+ "version": "0.2.0-alpha.2",
4
4
  "description": "retikz v0.1 core: framework-agnostic IR, scene compiler, and pure parsers.",
5
5
  "type": "module",
6
6
  "author": "Pionpill",