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/schema/index.d.ts
CHANGED
|
@@ -1,20 +1,30 @@
|
|
|
1
|
-
import { Schema
|
|
1
|
+
import { Schema, Types } from 'effect';
|
|
2
2
|
/** A `TaggedStruct` schema that can be called directly as a constructor: `Foo({ count: 1 })` instead of `Foo.make({ count: 1 })`. */
|
|
3
|
-
export type CallableTaggedStruct<Tag extends string, Fields extends
|
|
4
|
-
readonly _tag:
|
|
5
|
-
} & Fields>> : (value: Parameters<
|
|
6
|
-
readonly _tag:
|
|
3
|
+
export type CallableTaggedStruct<Tag extends string, Fields extends Schema.Struct.Fields> = Schema.TaggedStruct<Tag, Fields> & (keyof Fields extends never ? (value?: Parameters<Schema.TaggedStruct<Tag, Fields>['make']>[0] | void) => Types.Simplify<Schema.Struct.Type<{
|
|
4
|
+
readonly _tag: Schema.tag<Tag>;
|
|
5
|
+
} & Fields>> : (value: Parameters<Schema.TaggedStruct<Tag, Fields>['make']>[0]) => Types.Simplify<Schema.Struct.Type<{
|
|
6
|
+
readonly _tag: Schema.tag<Tag>;
|
|
7
7
|
} & Fields>>);
|
|
8
|
-
type TaggedUnionProperty = keyof
|
|
8
|
+
type TaggedUnionProperty = keyof Schema.TaggedUnion<{}>;
|
|
9
9
|
type UnionProperty = TaggedUnionProperty | 'members' | 'subset';
|
|
10
10
|
type VariantNameCollision<Name extends PropertyKey> = Readonly<{
|
|
11
11
|
'Variant names must not conflict with union properties': Name;
|
|
12
12
|
}>;
|
|
13
|
-
type ValidateVariantNames<CasesByTag extends Record<string,
|
|
14
|
-
type BaseTaggedUnion<CasesByTag extends Record<string,
|
|
15
|
-
readonly [Tag in keyof CasesByTag & string]:
|
|
13
|
+
type ValidateVariantNames<CasesByTag extends Record<string, Schema.Struct.Fields>> = Extract<keyof CasesByTag, UnionProperty> extends infer Name ? [Name] extends [never] ? unknown : VariantNameCollision<Name & PropertyKey> : never;
|
|
14
|
+
type BaseTaggedUnion<CasesByTag extends Record<string, Schema.Struct.Fields>> = Schema.TaggedUnion<{
|
|
15
|
+
readonly [Tag in keyof CasesByTag & string]: Schema.TaggedStruct<Tag, CasesByTag[Tag]>;
|
|
16
16
|
}>;
|
|
17
|
-
|
|
17
|
+
type TaggedUnionType<CasesByTag extends Record<string, Schema.Struct.Fields>> = BaseTaggedUnion<CasesByTag>['Type'];
|
|
18
|
+
type TaggedUnionMatchCases<CasesByTag extends Record<string, Schema.Struct.Fields>, Input extends TaggedUnionType<CasesByTag>, Output> = {
|
|
19
|
+
readonly [Tag in keyof CasesByTag & string]: (value: Extract<Input, {
|
|
20
|
+
readonly _tag: Tag;
|
|
21
|
+
}>) => Output;
|
|
22
|
+
};
|
|
23
|
+
type TaggedUnionMatch<CasesByTag extends Record<string, Schema.Struct.Fields>> = {
|
|
24
|
+
<Output, Input extends TaggedUnionType<CasesByTag> = TaggedUnionType<CasesByTag>>(cases: TaggedUnionMatchCases<CasesByTag, Input, Output>): (value: Input) => Output;
|
|
25
|
+
<Output, Input extends TaggedUnionType<CasesByTag> = TaggedUnionType<CasesByTag>>(value: Input, cases: TaggedUnionMatchCases<CasesByTag, Input, Output>): Output;
|
|
26
|
+
};
|
|
27
|
+
interface UnionSchema<CasesByTag extends Record<string, Schema.Struct.Fields>> extends Schema.BottomLazy<BaseTaggedUnion<CasesByTag>['ast'], UnionSchema<CasesByTag>> {
|
|
18
28
|
readonly Type: BaseTaggedUnion<CasesByTag>['Type'];
|
|
19
29
|
readonly Encoded: BaseTaggedUnion<CasesByTag>['Encoded'];
|
|
20
30
|
readonly DecodingServices: BaseTaggedUnion<CasesByTag>['DecodingServices'];
|
|
@@ -22,36 +32,38 @@ interface UnionSchema<CasesByTag extends Record<string, S.Struct.Fields>> extend
|
|
|
22
32
|
readonly '~type.make.in': BaseTaggedUnion<CasesByTag>['~type.make.in'];
|
|
23
33
|
readonly '~type.make': BaseTaggedUnion<CasesByTag>['~type.make'];
|
|
24
34
|
readonly Iso: BaseTaggedUnion<CasesByTag>['Iso'];
|
|
25
|
-
readonly match:
|
|
35
|
+
readonly match: TaggedUnionMatch<CasesByTag>;
|
|
26
36
|
}
|
|
27
|
-
type TaggedUnionMemberFor<CasesByTag extends Record<string,
|
|
28
|
-
type TaggedUnionMember<CasesByTag extends Record<string,
|
|
37
|
+
type TaggedUnionMemberFor<CasesByTag extends Record<string, Schema.Struct.Fields>, Tag extends keyof CasesByTag & string> = CallableTaggedStruct<Tag, CasesByTag[Tag]>;
|
|
38
|
+
type TaggedUnionMember<CasesByTag extends Record<string, Schema.Struct.Fields>> = {
|
|
29
39
|
readonly [Tag in keyof CasesByTag & string]: TaggedUnionMemberFor<CasesByTag, Tag>;
|
|
30
40
|
}[keyof CasesByTag & string];
|
|
31
|
-
type TaggedUnionSubsetMembers<CasesByTag extends Record<string,
|
|
41
|
+
type TaggedUnionSubsetMembers<CasesByTag extends Record<string, Schema.Struct.Fields>, Tags extends ReadonlyArray<keyof CasesByTag & string>> = {
|
|
32
42
|
readonly [Index in keyof Tags]: Tags[Index] extends keyof CasesByTag & string ? TaggedUnionMemberFor<CasesByTag, Tags[Index]> : never;
|
|
33
43
|
};
|
|
34
|
-
interface RichUnionSchema<CasesByTag extends Record<string,
|
|
44
|
+
interface RichUnionSchema<CasesByTag extends Record<string, Schema.Struct.Fields>> extends UnionSchema<CasesByTag> {
|
|
35
45
|
readonly guards: BaseTaggedUnion<CasesByTag>['guards'];
|
|
36
46
|
readonly isAnyOf: BaseTaggedUnion<CasesByTag>['isAnyOf'];
|
|
37
47
|
readonly members: ReadonlyArray<TaggedUnionMember<CasesByTag>>;
|
|
38
48
|
/** Returns a Schema that accepts only the named variants. */
|
|
39
|
-
readonly subset: <const Tags extends ReadonlyArray<keyof CasesByTag & string>>(tags: Tags) =>
|
|
49
|
+
readonly subset: <const Tags extends ReadonlyArray<keyof CasesByTag & string>>(tags: Tags) => Schema.Union<TaggedUnionSubsetMembers<CasesByTag, Tags>>;
|
|
40
50
|
}
|
|
41
51
|
/** The Schema returned by `defineTaggedUnion`. It includes callable variant
|
|
42
52
|
* constructors, exhaustive `match`, `guards`, `isAnyOf`, `subset`, and
|
|
43
53
|
* `members`. */
|
|
44
|
-
export type TaggedUnion<CasesByTag extends Record<string,
|
|
54
|
+
export type TaggedUnion<CasesByTag extends Record<string, Schema.Struct.Fields>> = RichUnionSchema<CasesByTag> & {
|
|
45
55
|
readonly [Tag in keyof CasesByTag & string]: CallableTaggedStruct<Tag, CasesByTag[Tag]>;
|
|
46
56
|
};
|
|
47
57
|
/** The Schema returned by `defineMessageUnion`. Each variant is a callable
|
|
48
|
-
* property on the union, and `match` handles the union exhaustively.
|
|
49
|
-
|
|
58
|
+
* property on the union, and `match` handles the union exhaustively. Pass a
|
|
59
|
+
* structurally refined union as `match`'s optional second type argument to
|
|
60
|
+
* preserve narrower payload fields in each handler. */
|
|
61
|
+
export type MessageUnion<CasesByTag extends Record<string, Schema.Struct.Fields>> = UnionSchema<CasesByTag> & {
|
|
50
62
|
readonly [Tag in keyof CasesByTag & string]: CallableTaggedStruct<Tag, CasesByTag[Tag]>;
|
|
51
63
|
};
|
|
52
64
|
/** The Schema returned by `defineRouteUnion`. It has the same constructors and
|
|
53
65
|
* helpers as `TaggedUnion`, with a Route-specific name for public signatures. */
|
|
54
|
-
export type RouteUnion<CasesByTag extends Record<string,
|
|
66
|
+
export type RouteUnion<CasesByTag extends Record<string, Schema.Struct.Fields>> = TaggedUnion<CasesByTag>;
|
|
55
67
|
/**
|
|
56
68
|
* Declares every Message variant in one object. Each key is a tag, and its
|
|
57
69
|
* value lists that Message's fields.
|
|
@@ -78,7 +90,7 @@ export type RouteUnion<CasesByTag extends Record<string, S.Struct.Fields>> = Tag
|
|
|
78
90
|
* ```typescript
|
|
79
91
|
* export const Message = defineMessageUnion({
|
|
80
92
|
* ClickedReset: {},
|
|
81
|
-
* ChangedCount: { count:
|
|
93
|
+
* ChangedCount: { count: Schema.Number },
|
|
82
94
|
* })
|
|
83
95
|
* export type Message = typeof Message.Type
|
|
84
96
|
*
|
|
@@ -86,7 +98,7 @@ export type RouteUnion<CasesByTag extends Record<string, S.Struct.Fields>> = Tag
|
|
|
86
98
|
* Message.ChangedCount({ count: 1 }) // { _tag: 'ChangedCount', count: 1 }
|
|
87
99
|
* ```
|
|
88
100
|
*/
|
|
89
|
-
export declare function defineMessageUnion<const CasesByTag extends Record<string,
|
|
101
|
+
export declare function defineMessageUnion<const CasesByTag extends Record<string, Schema.Struct.Fields>>(casesByTag: CasesByTag & ValidateVariantNames<CasesByTag>): MessageUnion<CasesByTag>;
|
|
90
102
|
/**
|
|
91
103
|
* Declares every variant of a domain union in one object. Use it for Model
|
|
92
104
|
* states, submission results, filter modes, and other unions that are not
|
|
@@ -113,7 +125,7 @@ export declare function defineMessageUnion<const CasesByTag extends Record<strin
|
|
|
113
125
|
* NotSubmitted: {},
|
|
114
126
|
* Submitting: {},
|
|
115
127
|
* Succeeded: {},
|
|
116
|
-
* Failed: { error:
|
|
128
|
+
* Failed: { error: Schema.String },
|
|
117
129
|
* })
|
|
118
130
|
* export type Submission = typeof Submission.Type
|
|
119
131
|
*
|
|
@@ -121,7 +133,7 @@ export declare function defineMessageUnion<const CasesByTag extends Record<strin
|
|
|
121
133
|
* Submission.Failed({ error: 'timeout' })
|
|
122
134
|
* ```
|
|
123
135
|
*/
|
|
124
|
-
export declare function defineTaggedUnion<const CasesByTag extends Record<string,
|
|
136
|
+
export declare function defineTaggedUnion<const CasesByTag extends Record<string, Schema.Struct.Fields>>(casesByTag: CasesByTag & ValidateVariantNames<CasesByTag>): TaggedUnion<CasesByTag>;
|
|
125
137
|
/**
|
|
126
138
|
* Declares every application Route in one object. Each key is a tag, and its
|
|
127
139
|
* value lists the fields parsed from the URL.
|
|
@@ -147,8 +159,8 @@ export declare function defineTaggedUnion<const CasesByTag extends Record<string
|
|
|
147
159
|
* ```typescript
|
|
148
160
|
* export const AppRoute = defineRouteUnion({
|
|
149
161
|
* Home: {},
|
|
150
|
-
* Person: { personId:
|
|
151
|
-
* NotFound: { path:
|
|
162
|
+
* Person: { personId: Schema.Number },
|
|
163
|
+
* NotFound: { path: Schema.String },
|
|
152
164
|
* })
|
|
153
165
|
* export type AppRoute = typeof AppRoute.Type
|
|
154
166
|
*
|
|
@@ -165,7 +177,7 @@ export declare function defineTaggedUnion<const CasesByTag extends Record<string
|
|
|
165
177
|
* )
|
|
166
178
|
* ```
|
|
167
179
|
*/
|
|
168
|
-
export declare function defineRouteUnion<const CasesByTag extends Record<string,
|
|
180
|
+
export declare function defineRouteUnion<const CasesByTag extends Record<string, Schema.Struct.Fields>>(casesByTag: CasesByTag & ValidateVariantNames<CasesByTag>): RouteUnion<CasesByTag>;
|
|
169
181
|
/**
|
|
170
182
|
* Declares one tagged struct as a callable Schema. Call `Loading()` instead of
|
|
171
183
|
* `Loading.make()`.
|
|
@@ -180,11 +192,11 @@ export declare function defineRouteUnion<const CasesByTag extends Record<string,
|
|
|
180
192
|
* const Loading = taggedStruct('Loading')
|
|
181
193
|
* Loading() // { _tag: 'Loading' }
|
|
182
194
|
*
|
|
183
|
-
* const Ok = taggedStruct('Ok', { data:
|
|
195
|
+
* const Ok = taggedStruct('Ok', { data: Schema.String })
|
|
184
196
|
* Ok({ data: 'hello' }) // { _tag: 'Ok', data: 'hello' }
|
|
185
197
|
* ```
|
|
186
198
|
*/
|
|
187
199
|
export declare function taggedStruct<Tag extends string>(tag: Tag): CallableTaggedStruct<Tag, {}>;
|
|
188
|
-
export declare function taggedStruct<Tag extends string, Fields extends
|
|
200
|
+
export declare function taggedStruct<Tag extends string, Fields extends Schema.Struct.Fields>(tag: Tag, fields: Fields): CallableTaggedStruct<Tag, Fields>;
|
|
189
201
|
export {};
|
|
190
202
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAa,KAAK,EAAE,MAAM,QAAQ,CAAA;AAE/D,qIAAqI;AACrI,MAAM,MAAM,oBAAoB,CAC9B,GAAG,SAAS,MAAM,EAClB,MAAM,SAAS,MAAM,CAAC,MAAM,CAAC,MAAM,IACjC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,GAClC,CAAC,MAAM,MAAM,SAAS,KAAK,GACvB,CACE,KAAK,CAAC,EAAE,UAAU,CAAC,MA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,UAAU,CAAC,UAAU,CAAC,CAExB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,GAAG,SAAS,MAAM,EAC7C,GAAG,EAAE,GAAG,GACP,oBAAoB,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AAChC,wBAAgB,YAAY,CAC1B,GAAG,SAAS,MAAM,EAClB,MAAM,SAAS,MAAM,CAAC,MAAM,CAAC,MAAM,EACnC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAG,oBAAoB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA"}
|
package/dist/schema/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Array, Match
|
|
1
|
+
import { Array, Match, Schema, SchemaAST } from 'effect';
|
|
2
2
|
const assignPlainProperty = (output, name, value) => {
|
|
3
3
|
if (name === '__proto__') {
|
|
4
4
|
Object.defineProperty(output, name, {
|
|
@@ -19,7 +19,7 @@ const isDirectlyCopyable = (ast) => {
|
|
|
19
19
|
ast.annotations?.['parseOptions'] !== undefined) {
|
|
20
20
|
return false;
|
|
21
21
|
}
|
|
22
|
-
return
|
|
22
|
+
return Match.value(ast).pipe(Match.withReturnType(), Match.tagsExhaustive({
|
|
23
23
|
Declaration: () => false,
|
|
24
24
|
Null: () => true,
|
|
25
25
|
Undefined: () => true,
|
|
@@ -54,7 +54,7 @@ const getDirectPropertyNames = (propertySignatures) => {
|
|
|
54
54
|
return names;
|
|
55
55
|
};
|
|
56
56
|
const makeCallable = (tag, fields) => {
|
|
57
|
-
const schema =
|
|
57
|
+
const schema = Schema.TaggedStruct(tag, fields);
|
|
58
58
|
const propertyNames = Object.hasOwn(fields, '_tag')
|
|
59
59
|
? undefined
|
|
60
60
|
: getDirectPropertyNames(schema.ast.propertySignatures);
|
|
@@ -127,7 +127,7 @@ const taggedUnionTypeOnlyPropertyNames = new Set([
|
|
|
127
127
|
'~encoded.optionality',
|
|
128
128
|
]);
|
|
129
129
|
const defineUnion = (variantLabel, casesByTag) => {
|
|
130
|
-
const union =
|
|
130
|
+
const union = Schema.TaggedUnion(casesByTag);
|
|
131
131
|
const conflictingNames = Array.filter(Object.keys(casesByTag), name => Reflect.has(union, name) ||
|
|
132
132
|
taggedUnionTypeOnlyPropertyNames.has(name) ||
|
|
133
133
|
reservedUnionPropertyNames.has(name));
|
|
@@ -147,7 +147,7 @@ const defineUnion = (variantLabel, casesByTag) => {
|
|
|
147
147
|
}
|
|
148
148
|
members.push(member);
|
|
149
149
|
}
|
|
150
|
-
return
|
|
150
|
+
return Schema.Union(members);
|
|
151
151
|
};
|
|
152
152
|
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
153
153
|
return Object.assign(union, callables, {
|
|
@@ -183,7 +183,7 @@ const defineUnion = (variantLabel, casesByTag) => {
|
|
|
183
183
|
* ```typescript
|
|
184
184
|
* export const Message = defineMessageUnion({
|
|
185
185
|
* ClickedReset: {},
|
|
186
|
-
* ChangedCount: { count:
|
|
186
|
+
* ChangedCount: { count: Schema.Number },
|
|
187
187
|
* })
|
|
188
188
|
* export type Message = typeof Message.Type
|
|
189
189
|
*
|
|
@@ -220,7 +220,7 @@ export function defineMessageUnion(casesByTag) {
|
|
|
220
220
|
* NotSubmitted: {},
|
|
221
221
|
* Submitting: {},
|
|
222
222
|
* Succeeded: {},
|
|
223
|
-
* Failed: { error:
|
|
223
|
+
* Failed: { error: Schema.String },
|
|
224
224
|
* })
|
|
225
225
|
* export type Submission = typeof Submission.Type
|
|
226
226
|
*
|
|
@@ -256,8 +256,8 @@ export function defineTaggedUnion(casesByTag) {
|
|
|
256
256
|
* ```typescript
|
|
257
257
|
* export const AppRoute = defineRouteUnion({
|
|
258
258
|
* Home: {},
|
|
259
|
-
* Person: { personId:
|
|
260
|
-
* NotFound: { path:
|
|
259
|
+
* Person: { personId: Schema.Number },
|
|
260
|
+
* NotFound: { path: Schema.String },
|
|
261
261
|
* })
|
|
262
262
|
* export type AppRoute = typeof AppRoute.Type
|
|
263
263
|
*
|
package/dist/snabbdom/init.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ export type Options = {
|
|
|
10
10
|
* warning so unit tests can force it on or off. Pass `undefined` to restore
|
|
11
11
|
* the gate. Internal, test-only. */
|
|
12
12
|
export declare const __overrideDuplicateKeyWarning: (isActive: boolean | undefined) => void;
|
|
13
|
-
export declare function init(modules: Array<Partial<Module>>, domApi?: DOMAPI, options?: Options): (oldVnode: VNode | Element | DocumentFragment, vnode: VNode) => VNode;
|
|
13
|
+
export declare function init(modules: Array<Partial<Module>>, domApi?: DOMAPI, options?: Options): (oldVnode: VNode | Element | DocumentFragment, vnode: VNode, onRootPatched?: (vnode: VNode) => void) => VNode;
|
|
14
14
|
//# sourceMappingURL=init.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/snabbdom/init.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAc,MAAM,iBAAiB,CAAA;AAEzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAY,KAAK,KAAK,EAA2B,MAAM,YAAY,CAAA;AAmF1E,MAAM,MAAM,OAAO,GAAG;IACpB,YAAY,CAAC,EAAE;QACb,SAAS,CAAC,EAAE,OAAO,CAAA;KACpB,CAAA;CACF,CAAA;AAID;;qCAEqC;AACrC,eAAO,MAAM,6BAA6B,aAC9B,OAAO,GAAG,SAAS,KAC5B,IAEF,CAAA;AASD,wBAAgB,IAAI,CAClB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAC/B,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,OAAO,cAskBL,KAAK,GAAG,OAAO,GAAG,gBAAgB,SACrC,KAAK,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/snabbdom/init.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAc,MAAM,iBAAiB,CAAA;AAEzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAY,KAAK,KAAK,EAA2B,MAAM,YAAY,CAAA;AAmF1E,MAAM,MAAM,OAAO,GAAG;IACpB,YAAY,CAAC,EAAE;QACb,SAAS,CAAC,EAAE,OAAO,CAAA;KACpB,CAAA;CACF,CAAA;AAID;;qCAEqC;AACrC,eAAO,MAAM,6BAA6B,aAC9B,OAAO,GAAG,SAAS,KAC5B,IAEF,CAAA;AASD,wBAAgB,IAAI,CAClB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAC/B,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,OAAO,cAskBL,KAAK,GAAG,OAAO,GAAG,gBAAgB,SACrC,KAAK,kBACI,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,KACrC,KAAK,CAsDT"}
|
package/dist/snabbdom/init.js
CHANGED
|
@@ -471,7 +471,7 @@ export function init(modules, domApi, options) {
|
|
|
471
471
|
}
|
|
472
472
|
hook?.postpatch?.(oldVnode, vnode);
|
|
473
473
|
}
|
|
474
|
-
return function patch(oldVnode, vnode) {
|
|
474
|
+
return function patch(oldVnode, vnode, onRootPatched) {
|
|
475
475
|
const insertedVnodeQueue = [];
|
|
476
476
|
isDuplicateKeyWarningIssued = false;
|
|
477
477
|
for (let moduleIndex = 0; moduleIndex < moduleHooks.pre.length; ++moduleIndex) {
|
|
@@ -495,6 +495,10 @@ export function init(modules, domApi, options) {
|
|
|
495
495
|
removeVnodes(parent, [oldVnode], 0, 0);
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
+
// NOTE: insert hooks run after the root has been installed and the old
|
|
499
|
+
// root may already be detached. Callers recovering from an insert-hook
|
|
500
|
+
// defect need the VNode that owns the DOM before those hooks can throw.
|
|
501
|
+
onRootPatched?.(vnode);
|
|
498
502
|
for (let insertedVnodeIndex = 0; insertedVnodeIndex < insertedVnodeQueue.length; ++insertedVnodeIndex) {
|
|
499
503
|
insertedVnodeQueue[insertedVnodeIndex].data.hook.insert(insertedVnodeQueue[insertedVnodeIndex]);
|
|
500
504
|
}
|
package/dist/snabbdom/vnode.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vnode.d.ts","sourceRoot":"","sources":["../../src/snabbdom/vnode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,MAAM,MAAM,GAAG,GAAG,WAAW,CAAA;AAE7B,eAAO,MAAM,gBAAgB,eAAoC,CAAA;AAEjE,eAAO,MAAM,aAAa;IACxB,KAAK;IACL,KAAK;IACL,OAAO;IACP,EAAE;IACF,KAAK;IACL,KAAK;
|
|
1
|
+
{"version":3,"file":"vnode.d.ts","sourceRoot":"","sources":["../../src/snabbdom/vnode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO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,IAAI,EAAE,GAAG,GAAG,SAAS,EACrB,QAAQ,EAAE,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,SAAS,EAC3C,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,GAAG,EAAE,OAAO,GAAG,gBAAgB,GAAG,IAAI,GAAG,SAAS,GACjD,KAAK,CAGP"}
|
package/dist/snabbdom/vnode.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Schema
|
|
1
|
+
import { Schema, Stream } from 'effect';
|
|
2
2
|
/**
|
|
3
3
|
* Configuration for the `animationFrame` Subscription helper.
|
|
4
4
|
*
|
|
@@ -37,8 +37,8 @@ export type AnimationFrameConfig<Model, Message> = Readonly<{
|
|
|
37
37
|
* `Subscription.make` as an entry value.
|
|
38
38
|
*/
|
|
39
39
|
export declare const animationFrame: <Model, Message>(config: AnimationFrameConfig<Model, Message>) => {
|
|
40
|
-
dependenciesSchema:
|
|
41
|
-
readonly isActive:
|
|
40
|
+
dependenciesSchema: Schema.Struct<{
|
|
41
|
+
readonly isActive: Schema.Boolean;
|
|
42
42
|
}>;
|
|
43
43
|
modelToDependencies: (model: Model) => {
|
|
44
44
|
isActive: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animationFrame.d.ts","sourceRoot":"","sources":["../../src/subscription/animationFrame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,
|
|
1
|
+
{"version":3,"file":"animationFrame.d.ts","sourceRoot":"","sources":["../../src/subscription/animationFrame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEtD;;;;;;;;GAQG;AACH,MAAM,MAAM,oBAAoB,CAAC,KAAK,EAAE,OAAO,IAAI,QAAQ,CAAC;IAC1D,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAA;IACnC,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAA;CAC1C,CAAC,CAAA;AA2BF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,cAAc,GAAI,KAAK,EAAE,OAAO,UACnC,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC;IAE5C,kBAAkB;;;IAClB,mBAAmB,UAAU,KAAK;QAChC,QAAQ;;IAEV,oBAAoB,iBAAiB;QAAE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;KAAE;CAKnE,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Effect, Queue, Schema
|
|
1
|
+
import { Effect, Queue, Schema, Stream } from 'effect';
|
|
2
2
|
const makeAnimationFrameStream = (toMessage) => Stream.callback(queue => Effect.acquireRelease(Effect.sync(() => {
|
|
3
3
|
const state = {
|
|
4
4
|
frameId: 0,
|
|
@@ -38,7 +38,7 @@ const makeAnimationFrameStream = (toMessage) => Stream.callback(queue => Effect.
|
|
|
38
38
|
* `Subscription.make` as an entry value.
|
|
39
39
|
*/
|
|
40
40
|
export const animationFrame = (config) => ({
|
|
41
|
-
dependenciesSchema:
|
|
41
|
+
dependenciesSchema: Schema.Struct({ isActive: Schema.Boolean }),
|
|
42
42
|
modelToDependencies: (model) => ({
|
|
43
43
|
isActive: config.isActive(model),
|
|
44
44
|
}),
|
|
@@ -68,7 +68,7 @@ export type FromEventFilterMapConfig<EventType extends Event, Message> = Readonl
|
|
|
68
68
|
* ```typescript
|
|
69
69
|
* const subscriptions = Subscription.make<Model, Message>()(entry => ({
|
|
70
70
|
* searchShortcut: entry(
|
|
71
|
-
* { isListening:
|
|
71
|
+
* { isListening: Schema.Boolean },
|
|
72
72
|
* {
|
|
73
73
|
* modelToDependencies: model => ({ isListening: model.isListening }),
|
|
74
74
|
* dependenciesToStream: ({ isListening }) =>
|
|
@@ -115,7 +115,7 @@ export declare const fromEventFilterMap: <EventType extends Event, Message>(conf
|
|
|
115
115
|
* ```typescript
|
|
116
116
|
* const subscriptions = Subscription.make<Model, Message>()(entry => ({
|
|
117
117
|
* shortcut: entry(
|
|
118
|
-
* { isListening:
|
|
118
|
+
* { isListening: Schema.Boolean },
|
|
119
119
|
* {
|
|
120
120
|
* modelToDependencies: model => ({ isListening: model.isListening }),
|
|
121
121
|
* dependenciesToStream: ({ isListening }) =>
|
|
@@ -30,7 +30,7 @@ const resolveTarget = (target) => (typeof target === 'function' ? target() : tar
|
|
|
30
30
|
* ```typescript
|
|
31
31
|
* const subscriptions = Subscription.make<Model, Message>()(entry => ({
|
|
32
32
|
* searchShortcut: entry(
|
|
33
|
-
* { isListening:
|
|
33
|
+
* { isListening: Schema.Boolean },
|
|
34
34
|
* {
|
|
35
35
|
* modelToDependencies: model => ({ isListening: model.isListening }),
|
|
36
36
|
* dependenciesToStream: ({ isListening }) =>
|
|
@@ -90,7 +90,7 @@ export const fromEventFilterMap = (config) => Stream.callback(queue => Effect.ac
|
|
|
90
90
|
* ```typescript
|
|
91
91
|
* const subscriptions = Subscription.make<Model, Message>()(entry => ({
|
|
92
92
|
* shortcut: entry(
|
|
93
|
-
* { isListening:
|
|
93
|
+
* { isListening: Schema.Boolean },
|
|
94
94
|
* {
|
|
95
95
|
* modelToDependencies: model => ({ isListening: model.isListening }),
|
|
96
96
|
* dependenciesToStream: ({ isListening }) =>
|
|
@@ -72,12 +72,12 @@ type EntryCallbacksWithKeepAlive<Model, Message, Dependencies, Services> = {
|
|
|
72
72
|
/**
|
|
73
73
|
* Builds a single subscription entry from a field map and callbacks.
|
|
74
74
|
*
|
|
75
|
-
* The field map is the same shape you would pass to `
|
|
75
|
+
* The field map is the same shape you would pass to `Schema.Struct`. Reading the
|
|
76
76
|
* schema as a positional argument (rather than a property on the entry
|
|
77
77
|
* literal) lets TypeScript fully resolve the `Dependencies` type before
|
|
78
78
|
* contextually typing `modelToDependencies` and `dependenciesToStream`, so
|
|
79
79
|
* destructuring patterns like `({ maybeMapHostId })` are inferred correctly
|
|
80
|
-
* even when the field schemas use transforms (e.g. `
|
|
80
|
+
* even when the field schemas use transforms (e.g. `Schema.Option`).
|
|
81
81
|
*
|
|
82
82
|
* Two overloads, one per `keepAliveEquivalence` presence:
|
|
83
83
|
*
|
|
@@ -103,7 +103,7 @@ export type EntryBuilder<Model, Message, Services> = <const Fields extends Schem
|
|
|
103
103
|
* ```ts
|
|
104
104
|
* Subscription.make<Model, Message>()(entry => ({
|
|
105
105
|
* tick: entry(
|
|
106
|
-
* { isRunning:
|
|
106
|
+
* { isRunning: Schema.Boolean },
|
|
107
107
|
* {
|
|
108
108
|
* modelToDependencies: model => ({ isRunning: model.isRunning }),
|
|
109
109
|
* dependenciesToStream: ({ isRunning }) =>
|
|
@@ -12,7 +12,7 @@ import { Option, Record, Schema, Stream, pipe } from 'effect';
|
|
|
12
12
|
* ```ts
|
|
13
13
|
* Subscription.make<Model, Message>()(entry => ({
|
|
14
14
|
* tick: entry(
|
|
15
|
-
* { isRunning:
|
|
15
|
+
* { isRunning: Schema.Boolean },
|
|
16
16
|
* {
|
|
17
17
|
* modelToDependencies: model => ({ isRunning: model.isRunning }),
|
|
18
18
|
* dependenciesToStream: ({ isRunning }) =>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Schema
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
2
|
import type { Html, HtmlBuilder } from '../../html/index.js';
|
|
3
3
|
import type * as Update from '../../update/index.js';
|
|
4
|
-
export declare const Model:
|
|
5
|
-
readonly clicks:
|
|
6
|
-
readonly childClicks:
|
|
7
|
-
readonly doubleClicks:
|
|
8
|
-
readonly submissions:
|
|
4
|
+
export declare const Model: Schema.Struct<{
|
|
5
|
+
readonly clicks: Schema.Number;
|
|
6
|
+
readonly childClicks: Schema.Number;
|
|
7
|
+
readonly doubleClicks: Schema.Number;
|
|
8
|
+
readonly submissions: Schema.Number;
|
|
9
9
|
}>;
|
|
10
10
|
export type Model = typeof Model.Type;
|
|
11
11
|
declare const Message: import("../../schema/index.js").MessageUnion<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bubbling.d.ts","sourceRoot":"","sources":["../../../src/test/apps/bubbling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"bubbling.d.ts","sourceRoot":"","sources":["../../../src/test/apps/bubbling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEvC,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAG5D,OAAO,KAAK,KAAK,MAAM,MAAM,uBAAuB,CAAA;AAIpD,eAAO,MAAM,KAAK;;;;;EAKhB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,QAAA,MAAM,OAAO;;;;;EAKX,CAAA;AACF,KAAK,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIlC,eAAO,MAAM,YAAY,EAAE,KAK1B,CAAA;AAID,eAAO,MAAM,MAAM,UAAW,KAAK,WAAW,OAAO;;;;;;;;;;;;;;;;;EAcjD,CAAA;AAIJ,eAAO,MAAM,IAAI,UAAW,KAAK,KAAK,WAAW,CAAC,OAAO,CAAC,KAAG,IA0E5D,CAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Number, Schema
|
|
1
|
+
import { Number, Schema } from 'effect';
|
|
2
2
|
import { defineMessageUnion } from '../../message/index.js';
|
|
3
3
|
import { evo } from '../../struct/index.js';
|
|
4
4
|
// MODEL
|
|
5
|
-
export const Model =
|
|
6
|
-
clicks:
|
|
7
|
-
childClicks:
|
|
8
|
-
doubleClicks:
|
|
9
|
-
submissions:
|
|
5
|
+
export const Model = Schema.Struct({
|
|
6
|
+
clicks: Schema.Number,
|
|
7
|
+
childClicks: Schema.Number,
|
|
8
|
+
doubleClicks: Schema.Number,
|
|
9
|
+
submissions: Schema.Number,
|
|
10
10
|
});
|
|
11
11
|
// MESSAGE
|
|
12
12
|
const Message = defineMessageUnion({
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Schema
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
2
|
import * as CustomElement from '../../customElement/index.js';
|
|
3
3
|
import type { Html, HtmlBuilder } from '../../html/index.js';
|
|
4
4
|
import type * as Update from '../../update/index.js';
|
|
5
5
|
export declare const hexColorPicker: CustomElement.CustomElementSpec<"hex-color-picker", {
|
|
6
|
-
color:
|
|
6
|
+
color: Schema.String;
|
|
7
7
|
}, {
|
|
8
|
-
'color-changed':
|
|
9
|
-
readonly value:
|
|
8
|
+
'color-changed': Schema.Struct<{
|
|
9
|
+
readonly value: Schema.String;
|
|
10
10
|
}>;
|
|
11
11
|
}>;
|
|
12
|
-
export declare const Model:
|
|
13
|
-
readonly color:
|
|
12
|
+
export declare const Model: Schema.Struct<{
|
|
13
|
+
readonly color: Schema.String;
|
|
14
14
|
}>;
|
|
15
15
|
export type Model = typeof Model.Type;
|
|
16
16
|
export declare const Message: import("../../schema/index.js").MessageUnion<{
|
|
17
17
|
readonly ChangedColor: {
|
|
18
|
-
value:
|
|
18
|
+
value: Schema.String;
|
|
19
19
|
};
|
|
20
20
|
}>;
|
|
21
21
|
export type Message = typeof Message.Type;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorPicker.d.ts","sourceRoot":"","sources":["../../../src/test/apps/colorPicker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"colorPicker.d.ts","sourceRoot":"","sources":["../../../src/test/apps/colorPicker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,KAAK,aAAa,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAG5D,OAAO,KAAK,KAAK,MAAM,MAAM,uBAAuB,CAAA;AAIpD,eAAO,MAAM,cAAc;;;;;;EAQzB,CAAA;AAIF,eAAO,MAAM,KAAK;;EAA0C,CAAA;AAC5D,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,eAAO,MAAM,OAAO;;QACF,KAAK;;EACrB,CAAA;AAEF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,eAAO,MAAM,YAAY;;CAAmC,CAAA;AAI5D,eAAO,MAAM,MAAM,UAAW,KAAK,WAAW,OAAO;;;;;;;;;EAKjD,CAAA;AAIJ,eAAO,MAAM,IAAI,UAAW,KAAK,KAAK,WAAW,CAAC,OAAO,CAAC,KAAG,IAkB5D,CAAA;AAED,eAAO,MAAM,kBAAkB,UACtB,KAAK,KACT,WAAW,CAAC,OAAO,CAAC,KACtB,IAUF,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Schema
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
2
|
import * as CustomElement from '../../customElement/index.js';
|
|
3
3
|
import { defineMessageUnion } from '../../message/index.js';
|
|
4
4
|
import { evo } from '../../struct/index.js';
|
|
@@ -6,17 +6,17 @@ import { evo } from '../../struct/index.js';
|
|
|
6
6
|
export const hexColorPicker = CustomElement.define({
|
|
7
7
|
tag: 'hex-color-picker',
|
|
8
8
|
properties: {
|
|
9
|
-
color:
|
|
9
|
+
color: Schema.String,
|
|
10
10
|
},
|
|
11
11
|
events: {
|
|
12
|
-
'color-changed':
|
|
12
|
+
'color-changed': Schema.Struct({ value: Schema.String }),
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
15
|
// MODEL
|
|
16
|
-
export const Model =
|
|
16
|
+
export const Model = Schema.Struct({ color: Schema.String });
|
|
17
17
|
// MESSAGE
|
|
18
18
|
export const Message = defineMessageUnion({
|
|
19
|
-
ChangedColor: { value:
|
|
19
|
+
ChangedColor: { value: Schema.String },
|
|
20
20
|
});
|
|
21
21
|
// INIT
|
|
22
22
|
export const initialModel = Model.make({ color: '#000000' });
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Schema
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
2
|
import type { Html, HtmlBuilder } from '../../html/index.js';
|
|
3
3
|
import type * as Update from '../../update/index.js';
|
|
4
|
-
export declare const Model:
|
|
4
|
+
export declare const Model: Schema.Struct<{
|
|
5
5
|
readonly contextMenu: import("../../schema/index.js").TaggedUnion<{
|
|
6
6
|
readonly Closed: {};
|
|
7
7
|
readonly Open: {
|
|
8
|
-
source:
|
|
8
|
+
source: Schema.Literals<readonly ["Direct", "Inner", "Outer"]>;
|
|
9
9
|
};
|
|
10
10
|
}>;
|
|
11
|
-
readonly openCount:
|
|
11
|
+
readonly openCount: Schema.Number;
|
|
12
12
|
}>;
|
|
13
13
|
export type Model = typeof Model.Type;
|
|
14
14
|
declare const Message: import("../../schema/index.js").MessageUnion<{
|
|
15
15
|
readonly OpenedContextMenu: {
|
|
16
|
-
source:
|
|
16
|
+
source: Schema.Literals<readonly ["Direct", "Inner", "Outer"]>;
|
|
17
17
|
};
|
|
18
18
|
}>;
|
|
19
19
|
type Message = typeof Message.Type;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextMenu.d.ts","sourceRoot":"","sources":["../../../src/test/apps/contextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"contextMenu.d.ts","sourceRoot":"","sources":["../../../src/test/apps/contextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEvC,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAI5D,OAAO,KAAK,KAAK,MAAM,MAAM,uBAAuB,CAAA;AAYpD,eAAO,MAAM,KAAK;;;;YAJR,MAAM;;;;EAOd,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,QAAA,MAAM,OAAO;;QACU,MAAM;;EAC3B,CAAA;AACF,KAAK,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIlC,eAAO,MAAM,YAAY;;;;;;;;CAGvB,CAAA;AAIF,eAAO,MAAM,MAAM,UAAW,KAAK,WAAW,OAAO;;;;;;;;;;;;;;;EAQjD,CAAA;AAIJ,eAAO,MAAM,IAAI,UAAW,KAAK,KAAK,WAAW,CAAC,OAAO,CAAC,KAAG,IA4C5D,CAAA"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Number, Schema
|
|
1
|
+
import { Number, Schema } from 'effect';
|
|
2
2
|
import { defineMessageUnion } from '../../message/index.js';
|
|
3
3
|
import { defineTaggedUnion } from '../../schema/index.js';
|
|
4
4
|
import { evo } from '../../struct/index.js';
|
|
5
5
|
// MODEL
|
|
6
|
-
const ContextMenuSource =
|
|
6
|
+
const ContextMenuSource = Schema.Literals(['Direct', 'Inner', 'Outer']);
|
|
7
7
|
const ContextMenuState = defineTaggedUnion({
|
|
8
8
|
Closed: {},
|
|
9
9
|
Open: { source: ContextMenuSource },
|
|
10
10
|
});
|
|
11
|
-
export const Model =
|
|
11
|
+
export const Model = Schema.Struct({
|
|
12
12
|
contextMenu: ContextMenuState,
|
|
13
|
-
openCount:
|
|
13
|
+
openCount: Schema.Number,
|
|
14
14
|
});
|
|
15
15
|
// MESSAGE
|
|
16
16
|
const Message = defineMessageUnion({
|