You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add schema-derived types for editable tree 2 proxies (#17736)
## Description
This creates adaptations of the editable-tree-2 schema-derived types
which:
1. Produce the "proxy" API objects
2. "Unbox" unconditionally
It also renames "List" to "SharedTreeList".
* Helper for implementing {@link InternalEditableTreeTypes#ProxyField}.
197
+
* @alpha
198
+
*/
199
+
exporttypeProxyFieldInner<
200
+
KindextendsFieldKind,
201
+
TTypesextendsAllowedTypes,
202
+
Emptinessextends"maybeEmpty"|"notEmpty",
203
+
>=KindextendstypeofFieldKinds.sequence
204
+
? SharedTreeList<TTypes>
205
+
: KindextendstypeofFieldKinds.required
206
+
? ProxyNodeUnion<TTypes>
207
+
: KindextendstypeofFieldKinds.optional
208
+
? ProxyNodeUnion<TTypes>|(Emptinessextends"notEmpty" ? never : undefined)
209
+
: // Since struct already provides a short-hand accessor for the local field key, and the field provides a nicer general API than the node under it in this case, do not unbox nodeKey fields.
210
+
KindextendstypeofFieldKinds.nodeKey
211
+
? NodeKeyField
212
+
: // TODO: forbidden
213
+
unknown;
214
+
215
+
/**
216
+
* Given multiple node schema types, return the corresponding object type union in the proxy-based API.
0 commit comments