foldkit 0.156.0 → 0.157.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/README.md +3 -3
- package/dist/asyncData/asyncData.d.ts +7 -7
- package/dist/asyncData/asyncData.d.ts.map +1 -1
- package/dist/asyncData/asyncData.js +12 -12
- package/dist/calendar/calendarDate.d.ts +15 -15
- package/dist/calendar/calendarDate.d.ts.map +1 -1
- package/dist/calendar/calendarDate.js +14 -14
- package/dist/calendar/comparison.d.ts +2 -2
- package/dist/calendar/comparison.d.ts.map +1 -1
- package/dist/calendar/comparison.js +5 -5
- package/dist/calendar/info.d.ts +2 -2
- package/dist/calendar/info.d.ts.map +1 -1
- package/dist/calendar/info.js +2 -2
- package/dist/calendar/locale.d.ts +7 -7
- package/dist/calendar/locale.d.ts.map +1 -1
- package/dist/calendar/locale.js +23 -23
- package/dist/canvas/shape.d.ts +89 -89
- package/dist/canvas/shape.d.ts.map +1 -1
- package/dist/canvas/shape.js +65 -53
- package/dist/command/index.d.ts +3 -3
- package/dist/customElement/index.d.ts +2 -2
- package/dist/customElement/index.js +2 -2
- package/dist/devTools/protocol.d.ts +278 -278
- package/dist/devTools/protocol.d.ts.map +1 -1
- package/dist/devTools/protocol.js +98 -92
- package/dist/devTools/schemaSummarize.d.ts.map +1 -1
- package/dist/devTools/schemaSummarize.js +24 -24
- package/dist/devTools/serialize.d.ts +1 -1
- package/dist/devTools/serialize.d.ts.map +1 -1
- package/dist/devTools/serialize.js +10 -10
- package/dist/devTools/store.d.ts.map +1 -1
- package/dist/devTools/store.js +52 -28
- package/dist/devTools/submodelPath.d.ts.map +1 -1
- package/dist/devTools/submodelPath.js +3 -3
- package/dist/devTools/summarize.d.ts +6 -6
- package/dist/devTools/summarize.d.ts.map +1 -1
- package/dist/devTools/summarize.js +13 -13
- package/dist/devTools/webSocketBridge.d.ts +3 -3
- package/dist/devTools/webSocketBridge.d.ts.map +1 -1
- package/dist/devTools/webSocketBridge.js +8 -8
- package/dist/dom/dom.d.ts +2 -0
- package/dist/dom/dom.d.ts.map +1 -1
- package/dist/dom/dom.js +47 -13
- package/dist/experimental/machine/machine.d.ts +29 -6
- package/dist/experimental/machine/machine.d.ts.map +1 -1
- package/dist/experimental/machine/machine.js +9 -8
- package/dist/experimental/server/entry.js +2 -2
- package/dist/experimental/server/serialize.js +2 -2
- package/dist/experimental/server/server.js +4 -4
- package/dist/fieldValidation/fieldValidation.d.ts +12 -12
- package/dist/fieldValidation/fieldValidation.d.ts.map +1 -1
- package/dist/fieldValidation/fieldValidation.js +9 -9
- package/dist/fieldValidation/rule.d.ts +2 -2
- package/dist/fieldValidation/rule.d.ts.map +1 -1
- package/dist/fieldValidation/rule.js +6 -6
- package/dist/file/file.d.ts +3 -3
- package/dist/file/file.d.ts.map +1 -1
- package/dist/file/file.js +3 -3
- package/dist/html/boundary.d.ts +93 -36
- package/dist/html/boundary.d.ts.map +1 -1
- package/dist/html/boundary.js +242 -75
- package/dist/html/childAttribute.d.ts +6 -4
- package/dist/html/childAttribute.d.ts.map +1 -1
- package/dist/html/childAttribute.js +7 -1
- package/dist/html/index.d.ts +31 -16
- package/dist/html/index.d.ts.map +1 -1
- package/dist/html/index.js +97 -40
- package/dist/html/lazy.d.ts +6 -6
- package/dist/html/lazy.d.ts.map +1 -1
- package/dist/html/lazy.js +37 -15
- package/dist/html/public.d.ts +1 -1
- package/dist/html/public.d.ts.map +1 -1
- package/dist/html/runtimeSingleton.d.ts +27 -6
- package/dist/html/runtimeSingleton.d.ts.map +1 -1
- package/dist/html/runtimeSingleton.js +46 -29
- package/dist/html/submodel.d.ts.map +1 -1
- package/dist/html/submodel.js +28 -39
- package/dist/http/http.d.ts +1 -1
- package/dist/http/http.js +1 -1
- package/dist/managedResource/managedResource.d.ts +5 -5
- package/dist/managedResource/managedResource.js +3 -3
- package/dist/mount/index.d.ts +92 -39
- package/dist/mount/index.d.ts.map +1 -1
- package/dist/mount/index.js +28 -8
- package/dist/mount/public.d.ts +1 -1
- package/dist/mount/public.d.ts.map +1 -1
- package/dist/mount/public.js +1 -1
- package/dist/navigation/urlRequest.d.ts +9 -9
- package/dist/navigation/urlRequest.d.ts.map +1 -1
- package/dist/navigation/urlRequest.js +2 -2
- package/dist/onUnmountModule.d.ts +19 -0
- package/dist/onUnmountModule.d.ts.map +1 -0
- package/dist/onUnmountModule.js +80 -0
- package/dist/port/port.d.ts +5 -5
- package/dist/port/port.js +5 -5
- package/dist/route/parser.d.ts +2 -2
- package/dist/route/parser.js +2 -2
- package/dist/runtime/hmrProtocol.d.ts +10 -10
- package/dist/runtime/hmrProtocol.d.ts.map +1 -1
- package/dist/runtime/hmrProtocol.js +10 -10
- package/dist/runtime/runtime.d.ts +4 -4
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +168 -51
- package/dist/schema/index.d.ts +41 -29
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +9 -9
- package/dist/snabbdom/init.d.ts +1 -1
- package/dist/snabbdom/init.d.ts.map +1 -1
- package/dist/snabbdom/init.js +5 -1
- package/dist/snabbdom/vnode.d.ts +1 -0
- package/dist/snabbdom/vnode.d.ts.map +1 -1
- package/dist/snabbdom/vnode.js +1 -0
- package/dist/subscription/animationFrame.d.ts +3 -3
- package/dist/subscription/animationFrame.d.ts.map +1 -1
- package/dist/subscription/animationFrame.js +2 -2
- package/dist/subscription/fromEvent.d.ts +2 -2
- package/dist/subscription/fromEvent.js +2 -2
- package/dist/subscription/subscription.d.ts +3 -3
- package/dist/subscription/subscription.js +1 -1
- package/dist/test/apps/bubbling.d.ts +6 -6
- package/dist/test/apps/bubbling.d.ts.map +1 -1
- package/dist/test/apps/bubbling.js +6 -6
- package/dist/test/apps/colorPicker.d.ts +7 -7
- package/dist/test/apps/colorPicker.d.ts.map +1 -1
- package/dist/test/apps/colorPicker.js +5 -5
- package/dist/test/apps/contextMenu.d.ts +5 -5
- package/dist/test/apps/contextMenu.d.ts.map +1 -1
- package/dist/test/apps/contextMenu.js +4 -4
- package/dist/test/apps/counter.d.ts +8 -8
- package/dist/test/apps/counter.d.ts.map +1 -1
- package/dist/test/apps/counter.js +8 -8
- package/dist/test/apps/crashOnRender.d.ts +18 -18
- package/dist/test/apps/crashOnRender.d.ts.map +1 -1
- package/dist/test/apps/crashOnRender.js +11 -11
- package/dist/test/apps/drafts.d.ts +9 -9
- package/dist/test/apps/drafts.d.ts.map +1 -1
- package/dist/test/apps/drafts.js +6 -6
- package/dist/test/apps/feedSocket.d.ts +6 -6
- package/dist/test/apps/feedSocket.d.ts.map +1 -1
- package/dist/test/apps/feedSocket.js +8 -8
- package/dist/test/apps/fileUpload.d.ts +2 -2
- package/dist/test/apps/fileUpload.d.ts.map +1 -1
- package/dist/test/apps/fileUpload.js +2 -2
- package/dist/test/apps/focusBoundary.d.ts +3 -3
- package/dist/test/apps/focusBoundary.d.ts.map +1 -1
- package/dist/test/apps/focusBoundary.js +3 -3
- package/dist/test/apps/formChild.d.ts +11 -11
- package/dist/test/apps/formChild.d.ts.map +1 -1
- package/dist/test/apps/formChild.js +13 -12
- package/dist/test/apps/interactions.d.ts +8 -8
- package/dist/test/apps/interactions.d.ts.map +1 -1
- package/dist/test/apps/interactions.js +8 -8
- package/dist/test/apps/keypress.d.ts +6 -6
- package/dist/test/apps/keypress.d.ts.map +1 -1
- package/dist/test/apps/keypress.js +6 -6
- package/dist/test/apps/login.d.ts +11 -11
- package/dist/test/apps/login.d.ts.map +1 -1
- package/dist/test/apps/login.js +15 -15
- package/dist/test/apps/logoutButton.d.ts +3 -3
- package/dist/test/apps/logoutButton.d.ts.map +1 -1
- package/dist/test/apps/logoutButton.js +2 -2
- package/dist/test/apps/mountPanel.d.ts +9 -9
- package/dist/test/apps/mountPanel.d.ts.map +1 -1
- package/dist/test/apps/mountPanel.js +9 -9
- package/dist/test/apps/multiRole.d.ts +3 -3
- package/dist/test/apps/multiRole.d.ts.map +1 -1
- package/dist/test/apps/multiRole.js +2 -2
- package/dist/test/apps/pointer.d.ts +7 -7
- package/dist/test/apps/pointer.d.ts.map +1 -1
- package/dist/test/apps/pointer.js +7 -7
- package/dist/test/apps/resumeUpload.d.ts +8 -8
- package/dist/test/apps/resumeUpload.d.ts.map +1 -1
- package/dist/test/apps/resumeUpload.js +7 -7
- package/dist/test/apps/scorePanel.d.ts +3 -3
- package/dist/test/apps/scorePanel.d.ts.map +1 -1
- package/dist/test/apps/scorePanel.js +2 -2
- package/dist/test/apps/selectiveKeys.d.ts +3 -3
- package/dist/test/apps/selectiveKeys.d.ts.map +1 -1
- package/dist/test/apps/selectiveKeys.js +3 -3
- package/dist/test/apps/uploads.d.ts +18 -18
- package/dist/test/apps/uploads.d.ts.map +1 -1
- package/dist/test/apps/uploads.js +13 -13
- package/dist/test/matchers.d.ts.map +1 -1
- package/dist/test/matchers.js +4 -4
- package/dist/test/query.d.ts.map +1 -1
- package/dist/test/query.js +28 -28
- package/dist/test/scene.d.ts +37 -8
- package/dist/test/scene.d.ts.map +1 -1
- package/dist/test/scene.js +58 -15
- package/dist/test/story.d.ts +35 -8
- package/dist/test/story.d.ts.map +1 -1
- package/dist/test/story.js +44 -22
- package/dist/update/update.d.ts +17 -20
- package/dist/update/update.d.ts.map +1 -1
- package/dist/url/index.d.ts +8 -8
- package/dist/url/index.d.ts.map +1 -1
- package/dist/url/index.js +19 -19
- package/dist/vdom.d.ts +3 -2
- package/dist/vdom.d.ts.map +1 -1
- package/dist/vdom.js +16 -6
- package/package.json +1 -1
package/dist/canvas/shape.d.ts
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { Schema
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
2
|
/** A 2D point in canvas-local coordinates. */
|
|
3
|
-
export declare const Point:
|
|
4
|
-
readonly x:
|
|
5
|
-
readonly y:
|
|
3
|
+
export declare const Point: Schema.Struct<{
|
|
4
|
+
readonly x: Schema.Number;
|
|
5
|
+
readonly y: Schema.Number;
|
|
6
6
|
}>;
|
|
7
7
|
/** A 2D point in canvas-local coordinates. */
|
|
8
8
|
export type Point = typeof Point.Type;
|
|
9
9
|
/** Move the path cursor to a point without drawing. */
|
|
10
10
|
export declare const MoveTo: import("../schema/index.js").CallableTaggedStruct<"MoveTo", {
|
|
11
|
-
x:
|
|
12
|
-
y:
|
|
11
|
+
x: Schema.Number;
|
|
12
|
+
y: Schema.Number;
|
|
13
13
|
}>;
|
|
14
14
|
/** Move the path cursor to a point without drawing. */
|
|
15
15
|
export type MoveTo = typeof MoveTo.Type;
|
|
16
16
|
/** Draw a straight line from the cursor to a point. */
|
|
17
17
|
export declare const LineTo: import("../schema/index.js").CallableTaggedStruct<"LineTo", {
|
|
18
|
-
x:
|
|
19
|
-
y:
|
|
18
|
+
x: Schema.Number;
|
|
19
|
+
y: Schema.Number;
|
|
20
20
|
}>;
|
|
21
21
|
/** Draw a straight line from the cursor to a point. */
|
|
22
22
|
export type LineTo = typeof LineTo.Type;
|
|
23
23
|
/** Draw a quadratic Bezier curve from the cursor through a control point to an end point. */
|
|
24
24
|
export declare const QuadTo: import("../schema/index.js").CallableTaggedStruct<"QuadTo", {
|
|
25
|
-
cpx:
|
|
26
|
-
cpy:
|
|
27
|
-
x:
|
|
28
|
-
y:
|
|
25
|
+
cpx: Schema.Number;
|
|
26
|
+
cpy: Schema.Number;
|
|
27
|
+
x: Schema.Number;
|
|
28
|
+
y: Schema.Number;
|
|
29
29
|
}>;
|
|
30
30
|
/** Draw a quadratic Bezier curve from the cursor through a control point to an end point. */
|
|
31
31
|
export type QuadTo = typeof QuadTo.Type;
|
|
32
32
|
/** Draw a cubic Bezier curve from the cursor through two control points to an end point. */
|
|
33
33
|
export declare const BezierTo: import("../schema/index.js").CallableTaggedStruct<"BezierTo", {
|
|
34
|
-
cp1x:
|
|
35
|
-
cp1y:
|
|
36
|
-
cp2x:
|
|
37
|
-
cp2y:
|
|
38
|
-
x:
|
|
39
|
-
y:
|
|
34
|
+
cp1x: Schema.Number;
|
|
35
|
+
cp1y: Schema.Number;
|
|
36
|
+
cp2x: Schema.Number;
|
|
37
|
+
cp2y: Schema.Number;
|
|
38
|
+
x: Schema.Number;
|
|
39
|
+
y: Schema.Number;
|
|
40
40
|
}>;
|
|
41
41
|
/** Draw a cubic Bezier curve from the cursor through two control points to an end point. */
|
|
42
42
|
export type BezierTo = typeof BezierTo.Type;
|
|
@@ -45,106 +45,106 @@ export declare const Close: import("../schema/index.js").CallableTaggedStruct<"C
|
|
|
45
45
|
/** Close the current path by drawing a line back to its starting point. */
|
|
46
46
|
export type Close = typeof Close.Type;
|
|
47
47
|
/** A single drawing instruction within a `Path` shape. */
|
|
48
|
-
export declare const PathInstruction:
|
|
49
|
-
x:
|
|
50
|
-
y:
|
|
48
|
+
export declare const PathInstruction: Schema.Union<readonly [import("../schema/index.js").CallableTaggedStruct<"MoveTo", {
|
|
49
|
+
x: Schema.Number;
|
|
50
|
+
y: Schema.Number;
|
|
51
51
|
}>, import("../schema/index.js").CallableTaggedStruct<"LineTo", {
|
|
52
|
-
x:
|
|
53
|
-
y:
|
|
52
|
+
x: Schema.Number;
|
|
53
|
+
y: Schema.Number;
|
|
54
54
|
}>, import("../schema/index.js").CallableTaggedStruct<"QuadTo", {
|
|
55
|
-
cpx:
|
|
56
|
-
cpy:
|
|
57
|
-
x:
|
|
58
|
-
y:
|
|
55
|
+
cpx: Schema.Number;
|
|
56
|
+
cpy: Schema.Number;
|
|
57
|
+
x: Schema.Number;
|
|
58
|
+
y: Schema.Number;
|
|
59
59
|
}>, import("../schema/index.js").CallableTaggedStruct<"BezierTo", {
|
|
60
|
-
cp1x:
|
|
61
|
-
cp1y:
|
|
62
|
-
cp2x:
|
|
63
|
-
cp2y:
|
|
64
|
-
x:
|
|
65
|
-
y:
|
|
60
|
+
cp1x: Schema.Number;
|
|
61
|
+
cp1y: Schema.Number;
|
|
62
|
+
cp2x: Schema.Number;
|
|
63
|
+
cp2y: Schema.Number;
|
|
64
|
+
x: Schema.Number;
|
|
65
|
+
y: Schema.Number;
|
|
66
66
|
}>, import("../schema/index.js").CallableTaggedStruct<"Close", {}>]>;
|
|
67
67
|
/** A single drawing instruction within a `Path` shape. */
|
|
68
68
|
export type PathInstruction = typeof PathInstruction.Type;
|
|
69
69
|
/** Stroke cap style: how the ends of an open stroked subpath are rendered. */
|
|
70
|
-
export declare const LineCap:
|
|
70
|
+
export declare const LineCap: Schema.Literals<readonly ["Butt", "Round", "Square"]>;
|
|
71
71
|
/** Stroke cap style: how the ends of an open stroked subpath are rendered. */
|
|
72
72
|
export type LineCap = typeof LineCap.Type;
|
|
73
73
|
/** Stroke join style: how two connected stroked segments meet. */
|
|
74
|
-
export declare const LineJoin:
|
|
74
|
+
export declare const LineJoin: Schema.Literals<readonly ["Miter", "Round", "Bevel"]>;
|
|
75
75
|
/** Stroke join style: how two connected stroked segments meet. */
|
|
76
76
|
export type LineJoin = typeof LineJoin.Type;
|
|
77
77
|
/** Horizontal alignment of a `Text` shape relative to its anchor x coordinate. */
|
|
78
|
-
export declare const TextAlign:
|
|
78
|
+
export declare const TextAlign: Schema.Literals<readonly ["Left", "Center", "Right", "Start", "End"]>;
|
|
79
79
|
/** Horizontal alignment of a `Text` shape relative to its anchor x coordinate. */
|
|
80
80
|
export type TextAlign = typeof TextAlign.Type;
|
|
81
81
|
/** Vertical alignment of a `Text` shape relative to its anchor y coordinate. */
|
|
82
|
-
export declare const TextBaseline:
|
|
82
|
+
export declare const TextBaseline: Schema.Literals<readonly ["Top", "Middle", "Bottom", "Alphabetic", "Hanging", "Ideographic"]>;
|
|
83
83
|
/** Vertical alignment of a `Text` shape relative to its anchor y coordinate. */
|
|
84
84
|
export type TextBaseline = typeof TextBaseline.Type;
|
|
85
85
|
/** An axis-aligned rectangle. */
|
|
86
86
|
export declare const Rect: import("../schema/index.js").CallableTaggedStruct<"Rect", {
|
|
87
|
-
x:
|
|
88
|
-
y:
|
|
89
|
-
width:
|
|
90
|
-
height:
|
|
91
|
-
fill:
|
|
92
|
-
stroke:
|
|
93
|
-
lineWidth:
|
|
87
|
+
x: Schema.Number;
|
|
88
|
+
y: Schema.Number;
|
|
89
|
+
width: Schema.Number;
|
|
90
|
+
height: Schema.Number;
|
|
91
|
+
fill: Schema.optional<Schema.String>;
|
|
92
|
+
stroke: Schema.optional<Schema.String>;
|
|
93
|
+
lineWidth: Schema.optional<Schema.Number>;
|
|
94
94
|
}>;
|
|
95
95
|
/** An axis-aligned rectangle. */
|
|
96
96
|
export type Rect = typeof Rect.Type;
|
|
97
97
|
/** A filled or stroked circle. */
|
|
98
98
|
export declare const Circle: import("../schema/index.js").CallableTaggedStruct<"Circle", {
|
|
99
|
-
x:
|
|
100
|
-
y:
|
|
101
|
-
radius:
|
|
102
|
-
fill:
|
|
103
|
-
stroke:
|
|
104
|
-
lineWidth:
|
|
99
|
+
x: Schema.Number;
|
|
100
|
+
y: Schema.Number;
|
|
101
|
+
radius: Schema.Number;
|
|
102
|
+
fill: Schema.optional<Schema.String>;
|
|
103
|
+
stroke: Schema.optional<Schema.String>;
|
|
104
|
+
lineWidth: Schema.optional<Schema.Number>;
|
|
105
105
|
}>;
|
|
106
106
|
/** A filled or stroked circle. */
|
|
107
107
|
export type Circle = typeof Circle.Type;
|
|
108
108
|
/** A path built from a sequence of `PathInstruction`s. */
|
|
109
109
|
export declare const Path: import("../schema/index.js").CallableTaggedStruct<"Path", {
|
|
110
|
-
instructions:
|
|
111
|
-
x:
|
|
112
|
-
y:
|
|
110
|
+
instructions: Schema.$Array<Schema.Union<readonly [import("../schema/index.js").CallableTaggedStruct<"MoveTo", {
|
|
111
|
+
x: Schema.Number;
|
|
112
|
+
y: Schema.Number;
|
|
113
113
|
}>, import("../schema/index.js").CallableTaggedStruct<"LineTo", {
|
|
114
|
-
x:
|
|
115
|
-
y:
|
|
114
|
+
x: Schema.Number;
|
|
115
|
+
y: Schema.Number;
|
|
116
116
|
}>, import("../schema/index.js").CallableTaggedStruct<"QuadTo", {
|
|
117
|
-
cpx:
|
|
118
|
-
cpy:
|
|
119
|
-
x:
|
|
120
|
-
y:
|
|
117
|
+
cpx: Schema.Number;
|
|
118
|
+
cpy: Schema.Number;
|
|
119
|
+
x: Schema.Number;
|
|
120
|
+
y: Schema.Number;
|
|
121
121
|
}>, import("../schema/index.js").CallableTaggedStruct<"BezierTo", {
|
|
122
|
-
cp1x:
|
|
123
|
-
cp1y:
|
|
124
|
-
cp2x:
|
|
125
|
-
cp2y:
|
|
126
|
-
x:
|
|
127
|
-
y:
|
|
122
|
+
cp1x: Schema.Number;
|
|
123
|
+
cp1y: Schema.Number;
|
|
124
|
+
cp2x: Schema.Number;
|
|
125
|
+
cp2y: Schema.Number;
|
|
126
|
+
x: Schema.Number;
|
|
127
|
+
y: Schema.Number;
|
|
128
128
|
}>, import("../schema/index.js").CallableTaggedStruct<"Close", {}>]>>;
|
|
129
|
-
fill:
|
|
130
|
-
stroke:
|
|
131
|
-
lineWidth:
|
|
132
|
-
lineCap:
|
|
133
|
-
lineJoin:
|
|
129
|
+
fill: Schema.optional<Schema.String>;
|
|
130
|
+
stroke: Schema.optional<Schema.String>;
|
|
131
|
+
lineWidth: Schema.optional<Schema.Number>;
|
|
132
|
+
lineCap: Schema.optional<Schema.Literals<readonly ["Butt", "Round", "Square"]>>;
|
|
133
|
+
lineJoin: Schema.optional<Schema.Literals<readonly ["Miter", "Round", "Bevel"]>>;
|
|
134
134
|
}>;
|
|
135
135
|
/** A path built from a sequence of `PathInstruction`s. */
|
|
136
136
|
export type Path = typeof Path.Type;
|
|
137
137
|
/** A single line of text drawn with a font, fill, and optional stroke. */
|
|
138
138
|
export declare const Text: import("../schema/index.js").CallableTaggedStruct<"Text", {
|
|
139
|
-
x:
|
|
140
|
-
y:
|
|
141
|
-
content:
|
|
142
|
-
font:
|
|
143
|
-
fill:
|
|
144
|
-
stroke:
|
|
145
|
-
lineWidth:
|
|
146
|
-
align:
|
|
147
|
-
baseline:
|
|
139
|
+
x: Schema.Number;
|
|
140
|
+
y: Schema.Number;
|
|
141
|
+
content: Schema.String;
|
|
142
|
+
font: Schema.optional<Schema.String>;
|
|
143
|
+
fill: Schema.optional<Schema.String>;
|
|
144
|
+
stroke: Schema.optional<Schema.String>;
|
|
145
|
+
lineWidth: Schema.optional<Schema.Number>;
|
|
146
|
+
align: Schema.optional<Schema.Literals<readonly ["Left", "Center", "Right", "Start", "End"]>>;
|
|
147
|
+
baseline: Schema.optional<Schema.Literals<readonly ["Top", "Middle", "Bottom", "Alphabetic", "Hanging", "Ideographic"]>>;
|
|
148
148
|
}>;
|
|
149
149
|
/** A single line of text drawn with a font, fill, and optional stroke. */
|
|
150
150
|
export type Text = typeof Text.Type;
|
|
@@ -154,7 +154,7 @@ export type Text = typeof Text.Type;
|
|
|
154
154
|
*
|
|
155
155
|
* Defined via the `interface` form so the recursion (`shapes: ReadonlyArray<Shape>`
|
|
156
156
|
* where `Shape` includes `Group` itself) resolves under TypeScript's lazy
|
|
157
|
-
* interface evaluation. The matching runtime Schema uses `
|
|
157
|
+
* interface evaluation. The matching runtime Schema uses `Schema.suspend`.
|
|
158
158
|
*/
|
|
159
159
|
export interface Group extends Readonly<{
|
|
160
160
|
readonly _tag: 'Group';
|
|
@@ -173,16 +173,16 @@ export interface Group extends Readonly<{
|
|
|
173
173
|
export type Shape = typeof Rect.Type | typeof Circle.Type | typeof Path.Type | typeof Text.Type | Group;
|
|
174
174
|
/** Construct a `Group` shape that wraps its children in a transformed scope. */
|
|
175
175
|
export declare const Group: import("../schema/index.js").CallableTaggedStruct<"Group", {
|
|
176
|
-
shapes:
|
|
177
|
-
translate:
|
|
178
|
-
readonly x:
|
|
179
|
-
readonly y:
|
|
176
|
+
shapes: Schema.$Array<Schema.Schema<Shape>>;
|
|
177
|
+
translate: Schema.optional<Schema.Struct<{
|
|
178
|
+
readonly x: Schema.Number;
|
|
179
|
+
readonly y: Schema.Number;
|
|
180
180
|
}>>;
|
|
181
|
-
rotate:
|
|
182
|
-
scale:
|
|
183
|
-
readonly x:
|
|
184
|
-
readonly y:
|
|
181
|
+
rotate: Schema.optional<Schema.Number>;
|
|
182
|
+
scale: Schema.optional<Schema.Struct<{
|
|
183
|
+
readonly x: Schema.Number;
|
|
184
|
+
readonly y: Schema.Number;
|
|
185
185
|
}>>;
|
|
186
|
-
opacity:
|
|
186
|
+
opacity: Schema.optional<Schema.Number>;
|
|
187
187
|
}>;
|
|
188
188
|
//# sourceMappingURL=shape.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shape.d.ts","sourceRoot":"","sources":["../../src/canvas/shape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"shape.d.ts","sourceRoot":"","sources":["../../src/canvas/shape.ts"],"names":[],"mappings":"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"}
|
package/dist/canvas/shape.js
CHANGED
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
import { Schema
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
2
|
import { taggedStruct } from '../schema/index.js';
|
|
3
3
|
/** A 2D point in canvas-local coordinates. */
|
|
4
|
-
export const Point =
|
|
4
|
+
export const Point = Schema.Struct({ x: Schema.Number, y: Schema.Number });
|
|
5
5
|
/** Move the path cursor to a point without drawing. */
|
|
6
|
-
export const MoveTo = taggedStruct('MoveTo', {
|
|
6
|
+
export const MoveTo = taggedStruct('MoveTo', {
|
|
7
|
+
x: Schema.Number,
|
|
8
|
+
y: Schema.Number,
|
|
9
|
+
});
|
|
7
10
|
/** Draw a straight line from the cursor to a point. */
|
|
8
|
-
export const LineTo = taggedStruct('LineTo', {
|
|
11
|
+
export const LineTo = taggedStruct('LineTo', {
|
|
12
|
+
x: Schema.Number,
|
|
13
|
+
y: Schema.Number,
|
|
14
|
+
});
|
|
9
15
|
/** Draw a quadratic Bezier curve from the cursor through a control point to an end point. */
|
|
10
16
|
export const QuadTo = taggedStruct('QuadTo', {
|
|
11
|
-
cpx:
|
|
12
|
-
cpy:
|
|
13
|
-
x:
|
|
14
|
-
y:
|
|
17
|
+
cpx: Schema.Number,
|
|
18
|
+
cpy: Schema.Number,
|
|
19
|
+
x: Schema.Number,
|
|
20
|
+
y: Schema.Number,
|
|
15
21
|
});
|
|
16
22
|
/** Draw a cubic Bezier curve from the cursor through two control points to an end point. */
|
|
17
23
|
export const BezierTo = taggedStruct('BezierTo', {
|
|
18
|
-
cp1x:
|
|
19
|
-
cp1y:
|
|
20
|
-
cp2x:
|
|
21
|
-
cp2y:
|
|
22
|
-
x:
|
|
23
|
-
y:
|
|
24
|
+
cp1x: Schema.Number,
|
|
25
|
+
cp1y: Schema.Number,
|
|
26
|
+
cp2x: Schema.Number,
|
|
27
|
+
cp2y: Schema.Number,
|
|
28
|
+
x: Schema.Number,
|
|
29
|
+
y: Schema.Number,
|
|
24
30
|
});
|
|
25
31
|
/** Close the current path by drawing a line back to its starting point. */
|
|
26
32
|
export const Close = taggedStruct('Close');
|
|
27
33
|
/** A single drawing instruction within a `Path` shape. */
|
|
28
|
-
export const PathInstruction =
|
|
34
|
+
export const PathInstruction = Schema.Union([
|
|
29
35
|
MoveTo,
|
|
30
36
|
LineTo,
|
|
31
37
|
QuadTo,
|
|
@@ -33,13 +39,19 @@ export const PathInstruction = S.Union([
|
|
|
33
39
|
Close,
|
|
34
40
|
]);
|
|
35
41
|
/** Stroke cap style: how the ends of an open stroked subpath are rendered. */
|
|
36
|
-
export const LineCap =
|
|
42
|
+
export const LineCap = Schema.Literals(['Butt', 'Round', 'Square']);
|
|
37
43
|
/** Stroke join style: how two connected stroked segments meet. */
|
|
38
|
-
export const LineJoin =
|
|
44
|
+
export const LineJoin = Schema.Literals(['Miter', 'Round', 'Bevel']);
|
|
39
45
|
/** Horizontal alignment of a `Text` shape relative to its anchor x coordinate. */
|
|
40
|
-
export const TextAlign =
|
|
46
|
+
export const TextAlign = Schema.Literals([
|
|
47
|
+
'Left',
|
|
48
|
+
'Center',
|
|
49
|
+
'Right',
|
|
50
|
+
'Start',
|
|
51
|
+
'End',
|
|
52
|
+
]);
|
|
41
53
|
/** Vertical alignment of a `Text` shape relative to its anchor y coordinate. */
|
|
42
|
-
export const TextBaseline =
|
|
54
|
+
export const TextBaseline = Schema.Literals([
|
|
43
55
|
'Top',
|
|
44
56
|
'Middle',
|
|
45
57
|
'Bottom',
|
|
@@ -49,55 +61,55 @@ export const TextBaseline = S.Literals([
|
|
|
49
61
|
]);
|
|
50
62
|
/** An axis-aligned rectangle. */
|
|
51
63
|
export const Rect = taggedStruct('Rect', {
|
|
52
|
-
x:
|
|
53
|
-
y:
|
|
54
|
-
width:
|
|
55
|
-
height:
|
|
56
|
-
fill:
|
|
57
|
-
stroke:
|
|
58
|
-
lineWidth:
|
|
64
|
+
x: Schema.Number,
|
|
65
|
+
y: Schema.Number,
|
|
66
|
+
width: Schema.Number,
|
|
67
|
+
height: Schema.Number,
|
|
68
|
+
fill: Schema.optional(Schema.String),
|
|
69
|
+
stroke: Schema.optional(Schema.String),
|
|
70
|
+
lineWidth: Schema.optional(Schema.Number),
|
|
59
71
|
});
|
|
60
72
|
/** A filled or stroked circle. */
|
|
61
73
|
export const Circle = taggedStruct('Circle', {
|
|
62
|
-
x:
|
|
63
|
-
y:
|
|
64
|
-
radius:
|
|
65
|
-
fill:
|
|
66
|
-
stroke:
|
|
67
|
-
lineWidth:
|
|
74
|
+
x: Schema.Number,
|
|
75
|
+
y: Schema.Number,
|
|
76
|
+
radius: Schema.Number,
|
|
77
|
+
fill: Schema.optional(Schema.String),
|
|
78
|
+
stroke: Schema.optional(Schema.String),
|
|
79
|
+
lineWidth: Schema.optional(Schema.Number),
|
|
68
80
|
});
|
|
69
81
|
/** A path built from a sequence of `PathInstruction`s. */
|
|
70
82
|
export const Path = taggedStruct('Path', {
|
|
71
|
-
instructions:
|
|
72
|
-
fill:
|
|
73
|
-
stroke:
|
|
74
|
-
lineWidth:
|
|
75
|
-
lineCap:
|
|
76
|
-
lineJoin:
|
|
83
|
+
instructions: Schema.Array(PathInstruction),
|
|
84
|
+
fill: Schema.optional(Schema.String),
|
|
85
|
+
stroke: Schema.optional(Schema.String),
|
|
86
|
+
lineWidth: Schema.optional(Schema.Number),
|
|
87
|
+
lineCap: Schema.optional(LineCap),
|
|
88
|
+
lineJoin: Schema.optional(LineJoin),
|
|
77
89
|
});
|
|
78
90
|
/** A single line of text drawn with a font, fill, and optional stroke. */
|
|
79
91
|
export const Text = taggedStruct('Text', {
|
|
80
|
-
x:
|
|
81
|
-
y:
|
|
82
|
-
content:
|
|
83
|
-
font:
|
|
84
|
-
fill:
|
|
85
|
-
stroke:
|
|
86
|
-
lineWidth:
|
|
87
|
-
align:
|
|
88
|
-
baseline:
|
|
92
|
+
x: Schema.Number,
|
|
93
|
+
y: Schema.Number,
|
|
94
|
+
content: Schema.String,
|
|
95
|
+
font: Schema.optional(Schema.String),
|
|
96
|
+
fill: Schema.optional(Schema.String),
|
|
97
|
+
stroke: Schema.optional(Schema.String),
|
|
98
|
+
lineWidth: Schema.optional(Schema.Number),
|
|
99
|
+
align: Schema.optional(TextAlign),
|
|
100
|
+
baseline: Schema.optional(TextBaseline),
|
|
89
101
|
});
|
|
90
102
|
/**
|
|
91
103
|
* Lazy reference to the full `Shape` union. Used inside `Group`'s `shapes`
|
|
92
104
|
* field so the schema can describe its own children without a forward
|
|
93
105
|
* declaration cycle.
|
|
94
106
|
*/
|
|
95
|
-
const Shape =
|
|
107
|
+
const Shape = Schema.suspend(() => Schema.Union([Rect, Circle, Path, Text, Group]));
|
|
96
108
|
/** Construct a `Group` shape that wraps its children in a transformed scope. */
|
|
97
109
|
export const Group = taggedStruct('Group', {
|
|
98
|
-
shapes:
|
|
99
|
-
translate:
|
|
100
|
-
rotate:
|
|
101
|
-
scale:
|
|
102
|
-
opacity:
|
|
110
|
+
shapes: Schema.Array(Shape),
|
|
111
|
+
translate: Schema.optional(Point),
|
|
112
|
+
rotate: Schema.optional(Schema.Number),
|
|
113
|
+
scale: Schema.optional(Point),
|
|
114
|
+
opacity: Schema.optional(Schema.Number),
|
|
103
115
|
});
|
package/dist/command/index.d.ts
CHANGED
|
@@ -102,7 +102,7 @@ export type InterruptOption<Args, KeyField extends keyof Args & string = keyof A
|
|
|
102
102
|
* @example With args
|
|
103
103
|
* ```ts
|
|
104
104
|
* const FetchWeather = Command.define('FetchWeather', {
|
|
105
|
-
* args: { zipCode:
|
|
105
|
+
* args: { zipCode: Schema.String },
|
|
106
106
|
* messages: [SucceededFetchWeather, FailedFetchWeather],
|
|
107
107
|
* execute: ({ zipCode }) => Effect.gen(function* () { ... }),
|
|
108
108
|
* })
|
|
@@ -113,7 +113,7 @@ export type InterruptOption<Args, KeyField extends keyof Args & string = keyof A
|
|
|
113
113
|
* @example Interruptible, keyed by the Command name
|
|
114
114
|
* ```ts
|
|
115
115
|
* const SaveDraft = Command.define('SaveDraft', {
|
|
116
|
-
* args: { draftId:
|
|
116
|
+
* args: { draftId: Schema.String, body: Schema.String },
|
|
117
117
|
* messages: [SucceededSaveDraft, FailedSaveDraft],
|
|
118
118
|
* interrupt: true,
|
|
119
119
|
* execute: ({ draftId, body }) => Effect.gen(function* () { ... }),
|
|
@@ -126,7 +126,7 @@ export type InterruptOption<Args, KeyField extends keyof Args & string = keyof A
|
|
|
126
126
|
* @example Interruptible, keyed by args
|
|
127
127
|
* ```ts
|
|
128
128
|
* const UploadFile = Command.define('UploadFile', {
|
|
129
|
-
* args: { uploadId:
|
|
129
|
+
* args: { uploadId: Schema.Number, file: Schema.instanceOf(File) },
|
|
130
130
|
* messages: [SucceededUploadFile, FailedUploadFile],
|
|
131
131
|
* interrupt: {
|
|
132
132
|
* keyFields: ['uploadId'],
|
|
@@ -63,10 +63,10 @@ export declare const kebabToPascal: (input: string) => string;
|
|
|
63
63
|
* const hexColorPicker = CustomElement.define({
|
|
64
64
|
* tag: 'hex-color-picker',
|
|
65
65
|
* properties: {
|
|
66
|
-
* color:
|
|
66
|
+
* color: Schema.String,
|
|
67
67
|
* },
|
|
68
68
|
* events: {
|
|
69
|
-
* 'color-changed':
|
|
69
|
+
* 'color-changed': Schema.Struct({ value: Schema.String }),
|
|
70
70
|
* },
|
|
71
71
|
* })
|
|
72
72
|
*
|
|
@@ -50,10 +50,10 @@ const eventFactoryName = (eventName) => `On${kebabToPascal(eventName)}`;
|
|
|
50
50
|
* const hexColorPicker = CustomElement.define({
|
|
51
51
|
* tag: 'hex-color-picker',
|
|
52
52
|
* properties: {
|
|
53
|
-
* color:
|
|
53
|
+
* color: Schema.String,
|
|
54
54
|
* },
|
|
55
55
|
* events: {
|
|
56
|
-
* 'color-changed':
|
|
56
|
+
* 'color-changed': Schema.Struct({ value: Schema.String }),
|
|
57
57
|
* },
|
|
58
58
|
* })
|
|
59
59
|
*
|