@fluidframework/tree 2.90.0 → 2.91.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/CHANGELOG.md +247 -0
- package/alpha.d.ts +2 -2
- package/api-extractor/api-extractor-lint-alpha.cjs.json +1 -1
- package/api-extractor/api-extractor-lint-alpha.esm.json +1 -1
- package/api-extractor/api-extractor-lint-beta.cjs.json +1 -1
- package/api-extractor/api-extractor-lint-beta.esm.json +1 -1
- package/api-extractor/api-extractor-lint-bundle.json +1 -1
- package/api-extractor/api-extractor-lint-legacy.cjs.json +1 -1
- package/api-extractor/api-extractor-lint-legacy.esm.json +1 -1
- package/api-extractor/api-extractor-lint-public.cjs.json +1 -1
- package/api-extractor/api-extractor-lint-public.esm.json +1 -1
- package/api-extractor/api-extractor.current.json +1 -1
- package/api-extractor/api-extractor.legacy.json +2 -1
- package/api-extractor.json +1 -0
- package/api-report/tree.alpha.api.md +81 -15
- package/beta.d.ts +2 -2
- package/dist/entrypoints/alpha.d.ts +6 -0
- package/dist/entrypoints/alpha.d.ts.map +1 -0
- package/dist/entrypoints/alpha.js +92 -0
- package/dist/entrypoints/alpha.js.map +1 -0
- package/dist/entrypoints/beta.d.ts +6 -0
- package/dist/entrypoints/beta.d.ts.map +1 -0
- package/dist/entrypoints/beta.js +43 -0
- package/dist/entrypoints/beta.js.map +1 -0
- package/dist/entrypoints/internal.d.ts +6 -0
- package/dist/entrypoints/internal.d.ts.map +1 -0
- package/dist/entrypoints/internal.js +28 -0
- package/dist/entrypoints/internal.js.map +1 -0
- package/dist/entrypoints/legacy.d.ts +6 -0
- package/dist/entrypoints/legacy.d.ts.map +1 -0
- package/dist/entrypoints/legacy.js +49 -0
- package/dist/entrypoints/legacy.js.map +1 -0
- package/dist/entrypoints/public.d.ts +6 -0
- package/dist/entrypoints/public.d.ts.map +1 -0
- package/dist/entrypoints/public.js +27 -0
- package/dist/entrypoints/public.js.map +1 -0
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +3 -3
- package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +1 -0
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -6
- package/dist/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +7 -3
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +2 -1
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/simple-tree/api/eraseSchemaDetails.d.ts +43 -0
- package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
- package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +3 -2
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +125 -28
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +72 -7
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/dist/simple-tree/api/schemaStatics.d.ts +10 -11
- package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaStatics.js +13 -7
- package/dist/simple-tree/api/schemaStatics.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +23 -2
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts +3 -2
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js +3 -4
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +2 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/index.d.ts +1 -1
- package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/index.d.ts +2 -2
- package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts +43 -7
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +26 -2
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
- package/dist/text/textDomainFormatted.d.ts +2 -4
- package/dist/text/textDomainFormatted.d.ts.map +1 -1
- package/dist/util/rangeMap.d.ts +25 -18
- package/dist/util/rangeMap.d.ts.map +1 -1
- package/dist/util/rangeMap.js +24 -30
- package/dist/util/rangeMap.js.map +1 -1
- package/dist/util/typeCheck.d.ts.map +1 -1
- package/dist/util/typeCheck.js.map +1 -1
- package/dist/util/typeUtils.d.ts.map +1 -1
- package/dist/util/typeUtils.js.map +1 -1
- package/eslint.config.mts +10 -2
- package/internal.d.ts +2 -2
- package/legacy.d.ts +4 -3
- package/lib/entrypoints/alpha.d.ts +6 -0
- package/lib/entrypoints/alpha.d.ts.map +1 -0
- package/lib/entrypoints/alpha.js +12 -0
- package/lib/entrypoints/alpha.js.map +1 -0
- package/lib/entrypoints/beta.d.ts +6 -0
- package/lib/entrypoints/beta.d.ts.map +1 -0
- package/lib/entrypoints/beta.js +12 -0
- package/lib/entrypoints/beta.js.map +1 -0
- package/lib/entrypoints/internal.d.ts +6 -0
- package/lib/entrypoints/internal.d.ts.map +1 -0
- package/lib/entrypoints/internal.js +12 -0
- package/lib/entrypoints/internal.js.map +1 -0
- package/lib/entrypoints/legacy.d.ts +6 -0
- package/lib/entrypoints/legacy.d.ts.map +1 -0
- package/lib/entrypoints/legacy.js +15 -0
- package/lib/entrypoints/legacy.js.map +1 -0
- package/lib/entrypoints/public.d.ts +6 -0
- package/lib/entrypoints/public.d.ts.map +1 -0
- package/lib/entrypoints/public.js +10 -0
- package/lib/entrypoints/public.js.map +1 -0
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +3 -3
- package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts +1 -0
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js +14 -6
- package/lib/feature-libraries/modular-schema/defaultRevisionReplacer.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +7 -3
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
- package/lib/index.d.ts +7 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +2 -1
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/simple-tree/api/eraseSchemaDetails.d.ts +43 -0
- package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -1
- package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +3 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +125 -28
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +66 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/lib/simple-tree/api/schemaStatics.d.ts +10 -11
- package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaStatics.js +14 -8
- package/lib/simple-tree/api/schemaStatics.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +23 -2
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts +3 -2
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js +3 -4
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +2 -2
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/index.d.ts +1 -1
- package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/index.d.ts +2 -2
- package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts +43 -7
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +26 -2
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
- package/lib/text/textDomainFormatted.d.ts +2 -4
- package/lib/text/textDomainFormatted.d.ts.map +1 -1
- package/lib/util/rangeMap.d.ts +25 -18
- package/lib/util/rangeMap.d.ts.map +1 -1
- package/lib/util/rangeMap.js +25 -31
- package/lib/util/rangeMap.js.map +1 -1
- package/lib/util/typeCheck.d.ts.map +1 -1
- package/lib/util/typeCheck.js.map +1 -1
- package/lib/util/typeUtils.d.ts.map +1 -1
- package/lib/util/typeUtils.js.map +1 -1
- package/package.json +46 -46
- package/scripts/generate-entrypoint-sources.sh +29 -0
- package/{dist/alpha.d.ts → src/entrypoints/alpha.ts} +12 -5
- package/{lib/beta.d.ts → src/entrypoints/beta.ts} +2 -5
- package/src/entrypoints/internal.ts +13 -0
- package/{dist/legacy.d.ts → src/entrypoints/legacy.ts} +2 -5
- package/{lib/public.d.ts → src/entrypoints/public.ts} +2 -5
- package/src/feature-libraries/modular-schema/crossFieldQueries.ts +3 -8
- package/src/feature-libraries/modular-schema/defaultRevisionReplacer.ts +16 -8
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +9 -4
- package/src/feature-libraries/sequence-field/moveEffectTable.ts +1 -1
- package/src/index.ts +19 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/treeCheckout.ts +2 -1
- package/src/simple-tree/api/eraseSchemaDetails.ts +60 -0
- package/src/simple-tree/api/index.ts +12 -1
- package/src/simple-tree/api/schemaFactory.ts +8 -1
- package/src/simple-tree/api/schemaFactoryAlpha.ts +262 -25
- package/src/simple-tree/api/schemaFactoryBeta.ts +10 -1
- package/src/simple-tree/api/schemaStatics.ts +79 -21
- package/src/simple-tree/api/typesUnsafe.ts +49 -1
- package/src/simple-tree/fieldSchema.ts +29 -5
- package/src/simple-tree/index.ts +10 -0
- package/src/simple-tree/node-kinds/index.ts +3 -0
- package/src/simple-tree/node-kinds/object/index.ts +3 -0
- package/src/simple-tree/node-kinds/object/objectNode.ts +69 -11
- package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +33 -2
- package/src/util/rangeMap.ts +54 -50
- package/src/util/typeCheck.ts +1 -0
- package/src/util/typeUtils.ts +4 -7
- package/dist/beta.d.ts +0 -152
- package/dist/public.d.ts +0 -94
- package/lib/alpha.d.ts +0 -304
- package/lib/legacy.d.ts +0 -159
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,252 @@
|
|
|
1
1
|
# @fluidframework/tree
|
|
2
2
|
|
|
3
|
+
## 2.91.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Adds withDefault API to allow defining default values for required and optional fields ([#26502](https://github.com/microsoft/FluidFramework/pull/26502)) [44fdd9421e4](https://github.com/microsoft/FluidFramework/commit/44fdd9421e4d0bfa3cdfa9ab3672ebf3c0ad20a6)
|
|
8
|
+
|
|
9
|
+
The `withDefault` API is now available on `SchemaFactoryAlpha`. It allows you to specify default values for fields,
|
|
10
|
+
making them optional in constructors even when the field is marked as required in the schema.
|
|
11
|
+
This provides a better developer experience by reducing boilerplate when creating objects.
|
|
12
|
+
|
|
13
|
+
The `withDefault` API wraps a field schema and defines a default value to use when the field is not provided during
|
|
14
|
+
construction. The default value must be of an allowed type of the field. You can provide defaults in two ways:
|
|
15
|
+
- **A value**: When a value is provided directly, the data is copied for each use to ensure independence between instances
|
|
16
|
+
- **A generator function**: A function that is called each time to produce a fresh value
|
|
17
|
+
|
|
18
|
+
Defaults are evaluated eagerly during node construction.
|
|
19
|
+
|
|
20
|
+
#### Required fields with defaults
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { SchemaFactoryAlpha, TreeAlpha } from "@fluidframework/tree/alpha";
|
|
24
|
+
|
|
25
|
+
const sf = new SchemaFactoryAlpha("example");
|
|
26
|
+
|
|
27
|
+
class Person extends sf.objectAlpha("Person", {
|
|
28
|
+
name: sf.required(sf.string),
|
|
29
|
+
age: sf.withDefault(sf.required(sf.number), -1),
|
|
30
|
+
role: sf.withDefault(sf.required(sf.string), "guest"),
|
|
31
|
+
}) {}
|
|
32
|
+
|
|
33
|
+
// Before: all fields were required
|
|
34
|
+
// const person = new Person({ name: "Alice", age: -1, role: "guest" });
|
|
35
|
+
|
|
36
|
+
// After: fields with defaults are optional
|
|
37
|
+
const person = new Person({ name: "Alice" });
|
|
38
|
+
// person.age === -1
|
|
39
|
+
// person.role === "guest"
|
|
40
|
+
|
|
41
|
+
// You can still provide values to override the defaults
|
|
42
|
+
const admin = new Person({ name: "Bob", age: 30, role: "admin" });
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### Optional fields with custom defaults
|
|
46
|
+
|
|
47
|
+
Optional fields (`sf.optional`) already default to `undefined`, but `withDefault` allows you to specify a different
|
|
48
|
+
default value:
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
class Config extends sf.object("Config", {
|
|
52
|
+
timeout: sf.withDefault(sf.optional(sf.number), 5000),
|
|
53
|
+
retries: sf.withDefault(sf.optional(sf.number), 3),
|
|
54
|
+
}) {}
|
|
55
|
+
|
|
56
|
+
// All fields are optional, using custom defaults when not provided
|
|
57
|
+
const config = new Config({});
|
|
58
|
+
// config.timeout === 5000
|
|
59
|
+
// config.retries === 3
|
|
60
|
+
|
|
61
|
+
const customConfig = new Config({ timeout: 10000 });
|
|
62
|
+
// customConfig.timeout === 10000
|
|
63
|
+
// customConfig.retries === 3
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### Value defaults vs function defaults
|
|
67
|
+
|
|
68
|
+
When you provide a value directly, the data is copied for each use, ensuring each instance is independent:
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
class Metadata extends sf.object("Metadata", {
|
|
72
|
+
tags: sf.array(sf.string),
|
|
73
|
+
version: sf.number,
|
|
74
|
+
}) {}
|
|
75
|
+
|
|
76
|
+
class Article extends sf.object("Article", {
|
|
77
|
+
title: sf.required(sf.string),
|
|
78
|
+
|
|
79
|
+
// a node is provided directly, it is copied for each use
|
|
80
|
+
metadata: sf.withDefault(
|
|
81
|
+
sf.optional(Metadata),
|
|
82
|
+
new Metadata({ tags: [], version: 1 }),
|
|
83
|
+
),
|
|
84
|
+
|
|
85
|
+
// also works with arrays
|
|
86
|
+
authors: sf.withDefault(sf.optional(sf.array(sf.string)), []),
|
|
87
|
+
}) {}
|
|
88
|
+
|
|
89
|
+
const article1 = new Article({ title: "First" });
|
|
90
|
+
const article2 = new Article({ title: "Second" });
|
|
91
|
+
|
|
92
|
+
// each article gets its own independent copy
|
|
93
|
+
assert(article1.metadata !== article2.metadata);
|
|
94
|
+
article1.metadata.version = 2; // Doesn't affect article2
|
|
95
|
+
assert(article2.metadata.version === 1);
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Alternatively, you can use generator functions to explicitly create new instances:
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
class Article extends sf.object("Article", {
|
|
102
|
+
title: sf.required(sf.string),
|
|
103
|
+
|
|
104
|
+
// generators are called each time to create a new instance
|
|
105
|
+
metadata: sf.withDefault(
|
|
106
|
+
sf.optional(Metadata),
|
|
107
|
+
() => new Metadata({ tags: [], version: 1 }),
|
|
108
|
+
),
|
|
109
|
+
authors: sf.withDefault(sf.optional(sf.array(sf.string)), () => []),
|
|
110
|
+
}) {}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Insertable object literals, arrays, and map objects can be used in place of node instances in both static defaults
|
|
114
|
+
and generator functions:
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
class Article extends sf.object("Article", {
|
|
118
|
+
title: sf.required(sf.string),
|
|
119
|
+
|
|
120
|
+
// plain object literal instead of new Metadata(...)
|
|
121
|
+
metadata: sf.withDefault(sf.optional(Metadata), () => ({
|
|
122
|
+
tags: [],
|
|
123
|
+
version: 1,
|
|
124
|
+
})),
|
|
125
|
+
|
|
126
|
+
// plain array instead of new ArrayNode(...)
|
|
127
|
+
authors: sf.withDefault(sf.optional(sf.array(sf.string)), () => [
|
|
128
|
+
"anonymous",
|
|
129
|
+
]),
|
|
130
|
+
}) {}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
##### Dynamic defaults
|
|
134
|
+
|
|
135
|
+
Generator functions are called each time a new node is created, enabling dynamic defaults:
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
class Document extends sf.object("Document", {
|
|
139
|
+
id: sf.withDefault(sf.required(sf.string), () => crypto.randomUUID()),
|
|
140
|
+
title: sf.required(sf.string),
|
|
141
|
+
}) {}
|
|
142
|
+
|
|
143
|
+
const doc1 = new Document({ title: "First Document" });
|
|
144
|
+
const doc2 = new Document({ title: "Second Document" });
|
|
145
|
+
// doc1.id !== doc2.id (each gets a unique UUID)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Generator functions also work with primitive types:
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
let counter = 0;
|
|
152
|
+
|
|
153
|
+
class GameState extends sf.object("GameState", {
|
|
154
|
+
playerId: sf.withDefault(
|
|
155
|
+
sf.required(sf.string),
|
|
156
|
+
() => `player-${counter++}`,
|
|
157
|
+
),
|
|
158
|
+
score: sf.withDefault(sf.required(sf.number), () =>
|
|
159
|
+
Math.floor(Math.random() * 100),
|
|
160
|
+
),
|
|
161
|
+
isActive: sf.withDefault(sf.required(sf.boolean), () => counter % 2 === 0),
|
|
162
|
+
}) {}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
#### Recursive types
|
|
166
|
+
|
|
167
|
+
`withDefaultRecursive` is available for use inside recursive schemas. Use `objectRecursiveAlpha` (rather than
|
|
168
|
+
`objectRecursive`) when defining recursive schemas with defaults, as it correctly makes defaulted fields optional in
|
|
169
|
+
the constructor for all field kinds including `requiredRecursive`. It works the same as `withDefault` but is
|
|
170
|
+
necessary to avoid TypeScript's circular reference limitations.
|
|
171
|
+
|
|
172
|
+
```typescript
|
|
173
|
+
class TreeNode extends sf.objectRecursiveAlpha("TreeNode", {
|
|
174
|
+
value: sf.number,
|
|
175
|
+
label: SchemaFactoryAlpha.withDefaultRecursive(
|
|
176
|
+
sf.optional(sf.string),
|
|
177
|
+
"untitled",
|
|
178
|
+
),
|
|
179
|
+
child: sf.optionalRecursive([() => TreeNode]),
|
|
180
|
+
}) {}
|
|
181
|
+
|
|
182
|
+
// `label` is optional in the constructor — the default is used when omitted
|
|
183
|
+
const leaf = new TreeNode({ value: 1 });
|
|
184
|
+
// leaf.label === "untitled"
|
|
185
|
+
|
|
186
|
+
const root = new TreeNode({ value: 0, label: "root", child: leaf });
|
|
187
|
+
// root.label === "root"
|
|
188
|
+
// root.child.label === "untitled"
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
> **Warning:** Be careful about using the recursive type itself as a default value — this is likely to cause
|
|
192
|
+
> infinite recursion at construction time, since creating the default value would trigger the same default again.
|
|
193
|
+
> Instead, use a primitive or a separate node type as the default:
|
|
194
|
+
>
|
|
195
|
+
> ```typescript
|
|
196
|
+
> const DefaultTag = sf.objectRecursiveAlpha("Tag", {
|
|
197
|
+
> id: sf.number,
|
|
198
|
+
> child: sf.optionalRecursive([() => TreeNode]),
|
|
199
|
+
> });
|
|
200
|
+
>
|
|
201
|
+
> class TreeNode extends sf.objectRecursiveAlpha("TreeNode", {
|
|
202
|
+
> value: sf.number,
|
|
203
|
+
> // ✅ Safe: default is a non-recursive node
|
|
204
|
+
> tag: SchemaFactoryAlpha.withDefaultRecursive(
|
|
205
|
+
> sf.optional(DefaultTag),
|
|
206
|
+
> () => new DefaultTag({ id: 0, child: new DefaultTag({ id: 1 }) }),
|
|
207
|
+
> ),
|
|
208
|
+
> child: sf.optionalRecursive([() => TreeNode]),
|
|
209
|
+
> }) {}
|
|
210
|
+
> ```
|
|
211
|
+
>
|
|
212
|
+
> The following definition for child would cause infinite recursion at construction time:
|
|
213
|
+
>
|
|
214
|
+
> ```typescript
|
|
215
|
+
> child: SchemaFactoryAlpha.withDefaultRecursive(
|
|
216
|
+
> sf.optionalRecursive([() => TreeNode]),
|
|
217
|
+
> () => new TreeNode({ value: 0 }),
|
|
218
|
+
> );
|
|
219
|
+
> ```
|
|
220
|
+
|
|
221
|
+
> The infinite recursion can be solved by passing in undefined explicitly but it is
|
|
222
|
+
> recommended to not use defaults in this case:
|
|
223
|
+
>
|
|
224
|
+
> ```typescript
|
|
225
|
+
> child: SchemaFactoryAlpha.withDefaultRecursive(
|
|
226
|
+
> sf.optionalRecursive([() => TreeNode]),
|
|
227
|
+
> () => new TreeNode({ value: 0, child: undefined }),
|
|
228
|
+
> );
|
|
229
|
+
> ```
|
|
230
|
+
|
|
231
|
+
#### Type safety
|
|
232
|
+
|
|
233
|
+
The default value (or the value returned by a generator function) must be of an allowed type for the field. TypeScript
|
|
234
|
+
enforces this at compile time:
|
|
235
|
+
|
|
236
|
+
```typescript
|
|
237
|
+
// ✅ Valid: number default for number field
|
|
238
|
+
sf.withDefault(sf.optional(sf.number), 8080);
|
|
239
|
+
|
|
240
|
+
// ✅ Valid: generator returns string for string field
|
|
241
|
+
sf.withDefault(sf.optional(sf.string), () => "localhost");
|
|
242
|
+
|
|
243
|
+
// ❌ TypeScript error: string default for number field
|
|
244
|
+
sf.withDefault(sf.optional(sf.number), "8080");
|
|
245
|
+
|
|
246
|
+
// ❌ TypeScript error: generator returns number for string field
|
|
247
|
+
sf.withDefault(sf.optional(sf.string), () => 8080);
|
|
248
|
+
```
|
|
249
|
+
|
|
3
250
|
## 2.90.0
|
|
4
251
|
|
|
5
252
|
### Minor Changes
|
package/alpha.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate
|
|
8
|
+
* Generated by "flub generate node10Entrypoints" in @fluid-tools/build-cli.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
export * from "./lib/alpha.js";
|
|
11
|
+
export * from "./lib/entrypoints/alpha.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
3
|
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
-
"mainEntryPointFilePath": "<projectFolder>/dist/alpha.d.ts"
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/dist/entrypoints/alpha.d.ts"
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
3
|
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
-
"mainEntryPointFilePath": "<projectFolder>/lib/alpha.d.ts"
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/entrypoints/alpha.d.ts"
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
3
|
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
-
"mainEntryPointFilePath": "<projectFolder>/dist/beta.d.ts"
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/dist/entrypoints/beta.d.ts"
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
3
|
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
-
"mainEntryPointFilePath": "<projectFolder>/lib/beta.d.ts"
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/entrypoints/beta.d.ts"
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
3
|
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.json",
|
|
4
|
-
"mainEntryPointFilePath": "<projectFolder>/lib/
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/entrypoints/internal.d.ts"
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
3
|
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
-
"mainEntryPointFilePath": "<projectFolder>/dist/legacy.d.ts"
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/dist/entrypoints/legacy.d.ts"
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
3
|
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
-
"mainEntryPointFilePath": "<projectFolder>/lib/legacy.d.ts"
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/entrypoints/legacy.d.ts"
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
3
|
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
-
"mainEntryPointFilePath": "<projectFolder>/dist/public.d.ts"
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/dist/entrypoints/public.d.ts"
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
3
|
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json",
|
|
4
|
-
"mainEntryPointFilePath": "<projectFolder>/lib/public.d.ts"
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/entrypoints/public.d.ts"
|
|
5
5
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
3
|
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-report.esm.current.json",
|
|
4
|
-
"mainEntryPointFilePath": "<projectFolder>/lib/alpha.d.ts",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/entrypoints/alpha.d.ts",
|
|
5
5
|
"apiReport": {
|
|
6
6
|
// The base config omits alpha. Explicitly opt into alpha reports (in addition to public/beta) for this package.
|
|
7
7
|
"reportVariants": ["public", "beta", "alpha"]
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-report.esm.legacy.json"
|
|
3
|
+
"extends": "<projectFolder>/../../../common/build/build-common/api-extractor-report.esm.legacy.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/entrypoints/legacy.d.ts"
|
|
4
5
|
}
|
package/api-extractor.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
3
|
"extends": "../../../common/build/build-common/api-extractor-model.esm.json",
|
|
4
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/entrypoints/internal.d.ts",
|
|
4
5
|
"compiler": {
|
|
5
6
|
// api-extractor has trouble with Node16 moduleResolution, but Bundler looks okay.
|
|
6
7
|
"overrideTsconfig": {
|
|
@@ -259,6 +259,15 @@ export function enumFromStrings<TScope extends string, const Members extends rea
|
|
|
259
259
|
}, Record<string, never>, true, Record<string, never>, undefined>; }[Members[number]] : never>;
|
|
260
260
|
};
|
|
261
261
|
|
|
262
|
+
// @alpha
|
|
263
|
+
export type ErasedNode<TExtra, Identifier extends string> = TExtra & TreeNode & WithType<Identifier>;
|
|
264
|
+
|
|
265
|
+
// @alpha
|
|
266
|
+
export type ErasedSchema<NodeType extends TreeNode> = TreeNodeSchema<NodeType extends WithType<infer Identifier> ? Identifier : string, NodeKind, NodeType, never, false>;
|
|
267
|
+
|
|
268
|
+
// @alpha
|
|
269
|
+
export type ErasedSchemaSubclassable<TExtra, Identifier extends string> = TreeNodeSchemaClass<Identifier, NodeKind, ErasedNode<TExtra, Identifier>, never, false>;
|
|
270
|
+
|
|
262
271
|
// @alpha
|
|
263
272
|
export function eraseSchemaDetails<TNode, ExtraSchemaProperties = unknown>(): <T extends ExtraSchemaProperties & TreeNodeSchema<string, NodeKind, TNode & TreeNode>>(schema: T) => ExtraSchemaProperties & TreeNodeSchema<T["identifier"], NodeKind, TNode & TreeNode & WithType<T["identifier"]>, never, false>;
|
|
264
273
|
|
|
@@ -302,6 +311,18 @@ type FieldHasDefault<T extends ImplicitFieldSchema> = [T] extends [
|
|
|
302
311
|
FieldSchema<FieldKind.Optional | FieldKind.Identifier>
|
|
303
312
|
] ? true : false;
|
|
304
313
|
|
|
314
|
+
// @alpha @system
|
|
315
|
+
export type FieldHasDefaultAlpha<T extends ImplicitFieldSchema> = [
|
|
316
|
+
T
|
|
317
|
+
] extends [FieldSchemaAlpha<infer Kind, infer _Types, infer _Meta, infer TProps>] ? Kind extends FieldKind.Optional | FieldKind.Identifier ? true : TProps extends {
|
|
318
|
+
defaultProvider: DefaultProvider;
|
|
319
|
+
} ? true : false : FieldHasDefault<T>;
|
|
320
|
+
|
|
321
|
+
// @alpha @sealed @system
|
|
322
|
+
export type FieldHasDefaultAlphaUnsafe<T extends System_Unsafe.ImplicitFieldSchemaUnsafe> = T extends FieldSchemaAlphaUnsafe<infer Kind, System_Unsafe.ImplicitAllowedTypesUnsafe, unknown, infer TProps> ? Kind extends FieldKind.Optional | FieldKind.Identifier ? true : TProps extends {
|
|
323
|
+
defaultProvider: DefaultProvider;
|
|
324
|
+
} ? true : false : System_Unsafe.FieldHasDefaultUnsafe<T>;
|
|
325
|
+
|
|
305
326
|
// @public
|
|
306
327
|
export enum FieldKind {
|
|
307
328
|
Identifier = 2,
|
|
@@ -337,7 +358,7 @@ export class FieldSchema<out Kind extends FieldKind = FieldKind, out Types exten
|
|
|
337
358
|
}
|
|
338
359
|
|
|
339
360
|
// @alpha @sealed
|
|
340
|
-
export class FieldSchemaAlpha<Kind extends FieldKind = FieldKind, Types extends ImplicitAllowedTypes = ImplicitAllowedTypes, TCustomMetadata = unknown> extends FieldSchema<Kind, Types, TCustomMetadata> implements SimpleFieldSchema<SchemaType.View> {
|
|
361
|
+
export class FieldSchemaAlpha<Kind extends FieldKind = FieldKind, Types extends ImplicitAllowedTypes = ImplicitAllowedTypes, TCustomMetadata = unknown, TProps extends FieldPropsAlpha<TCustomMetadata> | undefined = FieldPropsAlpha<TCustomMetadata> | undefined> extends FieldSchema<Kind, Types, TCustomMetadata> implements SimpleFieldSchema<SchemaType.View> {
|
|
341
362
|
protected constructor(kind: Kind, types: Types, props?: FieldPropsAlpha<TCustomMetadata>);
|
|
342
363
|
readonly allowedTypesFull: AllowedTypesFull;
|
|
343
364
|
// (undocumented)
|
|
@@ -349,7 +370,7 @@ export class FieldSchemaAlpha<Kind extends FieldKind = FieldKind, Types extends
|
|
|
349
370
|
}
|
|
350
371
|
|
|
351
372
|
// @alpha @sealed @system
|
|
352
|
-
export interface FieldSchemaAlphaUnsafe<out Kind extends FieldKind, out Types extends System_Unsafe.ImplicitAllowedTypesUnsafe, out TCustomMetadata = unknown> extends FieldSchemaAlpha<Kind, any, TCustomMetadata>, System_Unsafe.FieldSchemaUnsafe<Kind, Types, TCustomMetadata> {
|
|
373
|
+
export interface FieldSchemaAlphaUnsafe<out Kind extends FieldKind, out Types extends System_Unsafe.ImplicitAllowedTypesUnsafe, out TCustomMetadata = unknown, out TProps extends FieldPropsAlpha<TCustomMetadata> | undefined = undefined> extends FieldSchemaAlpha<Kind, any, TCustomMetadata, TProps>, System_Unsafe.FieldSchemaUnsafe<Kind, Types, TCustomMetadata> {
|
|
353
374
|
readonly allowedTypes: Types;
|
|
354
375
|
}
|
|
355
376
|
|
|
@@ -519,6 +540,22 @@ type InsertableObjectFromSchemaRecord<T extends RestrictiveStringRecord<Implicit
|
|
|
519
540
|
readonly [Property in keyof T as FieldHasDefault<T[Property & string]> extends false ? Property : never]: InsertableTreeFieldFromImplicitField<T[Property & string]>;
|
|
520
541
|
}>;
|
|
521
542
|
|
|
543
|
+
// @alpha @system
|
|
544
|
+
export type InsertableObjectFromSchemaRecordAlpha<T extends RestrictiveStringRecord<ImplicitFieldSchema>> = RestrictiveStringRecord<ImplicitFieldSchema> extends T ? {
|
|
545
|
+
arbitraryKey: "arbitraryValue";
|
|
546
|
+
} extends T ? Record<string, never> : never : FlattenKeys<{
|
|
547
|
+
readonly [Property in keyof T]?: InsertableTreeFieldFromImplicitField<T[Property & string]>;
|
|
548
|
+
} & {
|
|
549
|
+
readonly [Property in keyof T as FieldHasDefaultAlpha<T[Property & string]> extends false ? Property : never]: InsertableTreeFieldFromImplicitField<T[Property & string]>;
|
|
550
|
+
}>;
|
|
551
|
+
|
|
552
|
+
// @alpha @system
|
|
553
|
+
export type InsertableObjectFromSchemaRecordAlphaUnsafe<T extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>> = {
|
|
554
|
+
readonly [Property in keyof T as FieldHasDefaultAlphaUnsafe<T[Property & string]> extends false ? Property : never]: System_Unsafe.InsertableTreeFieldFromImplicitFieldUnsafe<T[Property & string]>;
|
|
555
|
+
} & {
|
|
556
|
+
readonly [Property in keyof T as FieldHasDefaultAlphaUnsafe<T[Property & string]> extends true ? Property : never]?: System_Unsafe.InsertableTreeFieldFromImplicitFieldUnsafe<T[Property & string]>;
|
|
557
|
+
};
|
|
558
|
+
|
|
522
559
|
// @public
|
|
523
560
|
export type InsertableTreeFieldFromImplicitField<TSchemaInput extends ImplicitFieldSchema, TSchema = UnionToIntersection<TSchemaInput>> = [TSchema] extends [FieldSchema<infer Kind, infer Types>] ? ApplyKindInput<InsertableTreeNodeFromImplicitAllowedTypes<Types>, Kind, true> : [TSchema] extends [ImplicitAllowedTypes] ? InsertableTreeNodeFromImplicitAllowedTypes<TSchema> : never;
|
|
524
561
|
|
|
@@ -807,6 +844,9 @@ export enum NodeKind {
|
|
|
807
844
|
Record = 4
|
|
808
845
|
}
|
|
809
846
|
|
|
847
|
+
// @alpha @sealed
|
|
848
|
+
export type NodeProvider<T> = T | (() => T);
|
|
849
|
+
|
|
810
850
|
// @public @sealed
|
|
811
851
|
export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
|
|
812
852
|
readonly custom?: TCustomMetadata | undefined;
|
|
@@ -837,7 +877,7 @@ export type ObjectFromSchemaRecord<T extends RestrictiveStringRecord<ImplicitFie
|
|
|
837
877
|
};
|
|
838
878
|
|
|
839
879
|
// @alpha @sealed
|
|
840
|
-
export interface ObjectNodeSchema<out TName extends string = string, in out T extends RestrictiveStringRecord<ImplicitFieldSchema> = RestrictiveStringRecord<ImplicitFieldSchema>, ImplicitlyConstructable extends boolean = boolean, out TCustomMetadata = unknown> extends TreeNodeSchemaClass<TName, NodeKind.Object, TreeObjectNode<T, TName>,
|
|
880
|
+
export interface ObjectNodeSchema<out TName extends string = string, in out T extends RestrictiveStringRecord<ImplicitFieldSchema> = RestrictiveStringRecord<ImplicitFieldSchema>, ImplicitlyConstructable extends boolean = boolean, out TCustomMetadata = unknown> extends TreeNodeSchemaClass<TName, NodeKind.Object, TreeObjectNode<T, TName>, object & InsertableObjectFromSchemaRecordAlpha<T>, ImplicitlyConstructable, T, never, TCustomMetadata>, SimpleObjectNodeSchema<SchemaType.View, TCustomMetadata> {
|
|
841
881
|
readonly fields: ReadonlyMap<string, FieldSchemaAlpha & SimpleObjectFieldSchema>;
|
|
842
882
|
}
|
|
843
883
|
|
|
@@ -846,6 +886,11 @@ export const ObjectNodeSchema: {
|
|
|
846
886
|
readonly [Symbol.hasInstance]: (value: TreeNodeSchema) => value is ObjectNodeSchema<string, RestrictiveStringRecord<ImplicitFieldSchema>, boolean, unknown>;
|
|
847
887
|
};
|
|
848
888
|
|
|
889
|
+
// @alpha @sealed
|
|
890
|
+
export type ObjectNodeSchemaWorkaround<TName extends string = string, T extends RestrictiveStringRecord<ImplicitFieldSchema> = RestrictiveStringRecord<ImplicitFieldSchema>, ImplicitlyConstructable extends boolean = boolean, TCustomMetadata = unknown> = ObjectNodeSchema<TName, T, ImplicitlyConstructable, TCustomMetadata> & {
|
|
891
|
+
readonly createFromInsertable: unknown;
|
|
892
|
+
};
|
|
893
|
+
|
|
849
894
|
// @beta @input
|
|
850
895
|
export interface ObjectSchemaOptions<TCustomMetadata = unknown> extends NodeSchemaOptions<TCustomMetadata> {
|
|
851
896
|
readonly allowUnknownOptionalFields?: boolean;
|
|
@@ -1023,28 +1068,39 @@ export const SchemaFactory_base: SchemaStatics & (new () => SchemaStatics);
|
|
|
1023
1068
|
export class SchemaFactoryAlpha<out TScope extends string | undefined = string | undefined, TName extends number | string = string> extends SchemaFactoryBeta<TScope, TName> {
|
|
1024
1069
|
arrayAlpha<const Name extends TName, const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): ArrayNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
|
|
1025
1070
|
arrayRecursive<const Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): ArrayNodeCustomizableSchemaUnsafe<ScopedSchemaName<TScope, Name>, T, TCustomMetadata>;
|
|
1026
|
-
static readonly identifier: <const TCustomMetadata = unknown>(props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Identifier, LeafSchema<"string", string> & SimpleLeafNodeSchema<SchemaType>, TCustomMetadata
|
|
1071
|
+
static readonly identifier: <const TCustomMetadata = unknown>(props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Identifier, LeafSchema<"string", string> & SimpleLeafNodeSchema<SchemaType>, TCustomMetadata, FieldPropsAlpha<TCustomMetadata>>;
|
|
1027
1072
|
static readonly leaves: readonly [LeafSchema<"string", string> & SimpleLeafNodeSchema<SchemaType>, LeafSchema<"number", number> & SimpleLeafNodeSchema<SchemaType>, LeafSchema<"boolean", boolean> & SimpleLeafNodeSchema<SchemaType>, LeafSchema<"null", null> & SimpleLeafNodeSchema<SchemaType>, LeafSchema<"handle", IFluidHandle_2<unknown>> & SimpleLeafNodeSchema<SchemaType>];
|
|
1028
1073
|
readonly leaves: readonly [LeafSchema<"string", string> & SimpleLeafNodeSchema<SchemaType>, LeafSchema<"number", number> & SimpleLeafNodeSchema<SchemaType>, LeafSchema<"boolean", boolean> & SimpleLeafNodeSchema<SchemaType>, LeafSchema<"null", null> & SimpleLeafNodeSchema<SchemaType>, LeafSchema<"handle", IFluidHandle_2<unknown>> & SimpleLeafNodeSchema<SchemaType>];
|
|
1029
1074
|
mapAlpha<Name extends TName, const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): MapNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
|
|
1030
1075
|
mapRecursive<Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): MapNodeCustomizableSchemaUnsafe<ScopedSchemaName<TScope, Name>, T, TCustomMetadata>;
|
|
1031
|
-
objectAlpha<const Name extends TName, const T extends RestrictiveStringRecord<ImplicitFieldSchema>, const TCustomMetadata = unknown>(name: Name, fields: T, options?: ObjectSchemaOptionsAlpha<TCustomMetadata>):
|
|
1032
|
-
readonly createFromInsertable: unknown;
|
|
1033
|
-
};
|
|
1076
|
+
objectAlpha<const Name extends TName, const T extends RestrictiveStringRecord<ImplicitFieldSchema>, const TCustomMetadata = unknown>(name: Name, fields: T, options?: ObjectSchemaOptionsAlpha<TCustomMetadata>): ObjectNodeSchemaWorkaround<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
|
|
1034
1077
|
objectRecursive<const Name extends TName, const T extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>, const TCustomMetadata = unknown>(name: Name, t: T, options?: ObjectSchemaOptionsAlpha<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, System_Unsafe.TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & System_Unsafe.InsertableObjectFromSchemaRecordUnsafe<T>, false, T, never, TCustomMetadata> & SimpleObjectNodeSchema<SchemaType.View, TCustomMetadata> & Pick<ObjectNodeSchema, "fields">;
|
|
1035
|
-
|
|
1036
|
-
readonly optional: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Optional, T, TCustomMetadata
|
|
1037
|
-
|
|
1038
|
-
readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Optional, T, TCustomMetadata
|
|
1078
|
+
objectRecursiveAlpha<const Name extends TName, const T extends RestrictiveStringRecord<System_Unsafe.ImplicitFieldSchemaUnsafe>, const TCustomMetadata = unknown>(name: Name, t: T, options?: ObjectSchemaOptionsAlpha<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Object, System_Unsafe.TreeObjectNodeUnsafe<T, ScopedSchemaName<TScope, Name>>, object & InsertableObjectFromSchemaRecordAlphaUnsafe<T>, false, T, never, TCustomMetadata> & SimpleObjectNodeSchema<SchemaType.View, TCustomMetadata> & Pick<ObjectNodeSchema, "fields">;
|
|
1079
|
+
static readonly optional: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Optional, T, TCustomMetadata, FieldPropsAlpha<TCustomMetadata>>;
|
|
1080
|
+
readonly optional: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Optional, T, TCustomMetadata, FieldPropsAlpha<TCustomMetadata>>;
|
|
1081
|
+
static readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Optional, T, TCustomMetadata, FieldPropsAlpha<TCustomMetadata>>;
|
|
1082
|
+
readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Optional, T, TCustomMetadata, FieldPropsAlpha<TCustomMetadata>>;
|
|
1039
1083
|
recordAlpha<const Name extends TName, const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): RecordNodeCustomizableSchema<ScopedSchemaName<TScope, Name>, T, true, TCustomMetadata>;
|
|
1040
1084
|
recordRecursive<Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(name: Name, allowedTypes: T, options?: NodeSchemaOptionsAlpha<TCustomMetadata>): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Record, TreeRecordNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Record, unknown>, {
|
|
1041
1085
|
readonly [x: string]: System_Unsafe.InsertableTreeNodeFromImplicitAllowedTypesUnsafe<T>;
|
|
1042
1086
|
}, false, T, undefined, TCustomMetadata>;
|
|
1043
|
-
static readonly required: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Required, T, TCustomMetadata
|
|
1044
|
-
readonly required: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Required, T, TCustomMetadata
|
|
1045
|
-
static readonly requiredRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T, TCustomMetadata
|
|
1046
|
-
readonly requiredRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T, TCustomMetadata
|
|
1087
|
+
static readonly required: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Required, T, TCustomMetadata, FieldPropsAlpha<TCustomMetadata>>;
|
|
1088
|
+
readonly required: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Required, T, TCustomMetadata, FieldPropsAlpha<TCustomMetadata>>;
|
|
1089
|
+
static readonly requiredRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T, TCustomMetadata, FieldPropsAlpha<TCustomMetadata>>;
|
|
1090
|
+
readonly requiredRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T, TCustomMetadata, FieldPropsAlpha<TCustomMetadata>>;
|
|
1047
1091
|
scopedFactoryAlpha<const T extends TName, TNameInner extends number | string = string>(name: T): SchemaFactoryAlpha<ScopedSchemaName<TScope, T>, TNameInner>;
|
|
1092
|
+
readonly withDefault: <Kind extends FieldKind, Types extends ImplicitAllowedTypes, TCustomMetadata = unknown>(fieldSchema: FieldSchema<Kind, Types, TCustomMetadata>, defaultValue: NodeProvider<ApplyKindInput_2<InsertableTreeNodeFromImplicitAllowedTypes_2<Types>, Kind, true>>) => FieldSchemaAlpha<Kind, Types, TCustomMetadata, FieldPropsAlpha<TCustomMetadata> & {
|
|
1093
|
+
defaultProvider: DefaultProvider;
|
|
1094
|
+
}>;
|
|
1095
|
+
static readonly withDefault: <Kind extends FieldKind, Types extends ImplicitAllowedTypes, TCustomMetadata = unknown>(fieldSchema: FieldSchema<Kind, Types, TCustomMetadata>, defaultValue: NodeProvider<ApplyKindInput_2<InsertableTreeNodeFromImplicitAllowedTypes_2<Types>, Kind, true>>) => FieldSchemaAlpha<Kind, Types, TCustomMetadata, FieldPropsAlpha<TCustomMetadata> & {
|
|
1096
|
+
defaultProvider: DefaultProvider;
|
|
1097
|
+
}>;
|
|
1098
|
+
readonly withDefaultRecursive: <Kind extends FieldKind, Types extends System_Unsafe.ImplicitAllowedTypesUnsafe, TCustomMetadata = unknown>(fieldSchema: System_Unsafe.FieldSchemaUnsafe<Kind, Types, TCustomMetadata>, defaultValue: unknown) => FieldSchemaAlphaUnsafe<Kind, Types, TCustomMetadata, FieldPropsAlpha<TCustomMetadata> & {
|
|
1099
|
+
defaultProvider: DefaultProvider;
|
|
1100
|
+
}>;
|
|
1101
|
+
static readonly withDefaultRecursive: <Kind extends FieldKind, Types extends System_Unsafe.ImplicitAllowedTypesUnsafe, TCustomMetadata = unknown>(fieldSchema: System_Unsafe.FieldSchemaUnsafe<Kind, Types, TCustomMetadata>, defaultValue: unknown) => FieldSchemaAlphaUnsafe<Kind, Types, TCustomMetadata, FieldPropsAlpha<TCustomMetadata> & {
|
|
1102
|
+
defaultProvider: DefaultProvider;
|
|
1103
|
+
}>;
|
|
1048
1104
|
}
|
|
1049
1105
|
|
|
1050
1106
|
// @beta
|
|
@@ -1088,6 +1144,16 @@ export interface SchemaStatics {
|
|
|
1088
1144
|
readonly string: LeafSchema<"string", string>;
|
|
1089
1145
|
}
|
|
1090
1146
|
|
|
1147
|
+
// @alpha @sealed @system
|
|
1148
|
+
export interface SchemaStaticsAlpha {
|
|
1149
|
+
readonly withDefault: <Kind extends FieldKind, Types extends ImplicitAllowedTypes, TCustomMetadata = unknown>(fieldSchema: FieldSchema<Kind, Types, TCustomMetadata>, defaultValue: NodeProvider<InsertableTreeFieldFromImplicitField<FieldSchema<Kind, Types>>>) => FieldSchemaAlpha<Kind, Types, TCustomMetadata, FieldPropsAlpha<TCustomMetadata> & {
|
|
1150
|
+
defaultProvider: DefaultProvider;
|
|
1151
|
+
}>;
|
|
1152
|
+
withDefaultRecursive: <Kind extends FieldKind, Types extends System_Unsafe.ImplicitAllowedTypesUnsafe, TCustomMetadata = unknown>(fieldSchema: System_Unsafe.FieldSchemaUnsafe<Kind, Types, TCustomMetadata>, defaultValue: Unenforced<NodeProvider<System_Unsafe.InsertableTreeFieldFromImplicitFieldUnsafe<System_Unsafe.FieldSchemaUnsafe<Kind, Types>>>>) => FieldSchemaAlphaUnsafe<Kind, Types, TCustomMetadata, FieldPropsAlpha<TCustomMetadata> & {
|
|
1153
|
+
defaultProvider: DefaultProvider;
|
|
1154
|
+
}>;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1091
1157
|
// @beta @sealed @system
|
|
1092
1158
|
export interface SchemaStaticsBeta {
|
|
1093
1159
|
readonly staged: <const T extends LazyItem<TreeNodeSchema>>(t: T | AnnotatedAllowedType<T>) => AnnotatedAllowedType<T>;
|
package/beta.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate
|
|
8
|
+
* Generated by "flub generate node10Entrypoints" in @fluid-tools/build-cli.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
export * from "./lib/beta.js";
|
|
11
|
+
export * from "./lib/entrypoints/beta.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
export { AllowedTypes, CommitKind, CommitMetadata, FieldKind, FieldProps, FieldSchema, FieldSchemaMetadata, ITree, ITreeConfigurationOptions, ITreeViewConfiguration, ImplicitAllowedTypes, ImplicitFieldSchema, Input, InsertableTreeFieldFromImplicitField, InsertableTreeNodeFromAllowedTypes, InsertableTreeNodeFromImplicitAllowedTypes, InsertableTypedNode, InternalTreeNode, InternalTypes, IsListener, IsUnion, IterableTreeArrayContent, LazyItem, LeafSchema, Listenable, Listeners, MakeNominal, MapNodeInsertableData, NodeFromSchema, NodeInDocumentConstraint, NodeKind, NodeSchemaMetadata, NodeSchemaOptions, NumberKeys, ObjectFromSchemaRecord, Off, ReadonlyArrayNode, RestrictiveReadonlyRecord, RestrictiveStringRecord, Revertible, RevertibleFactory, RevertibleStatus, RunTransaction, SchemaCompatibilityStatus, SchemaFactory, SchemaFactory_base, SchemaStatics, SimpleNodeSchemaBase, System_Unsafe, TransactionConstraint, Tree, TreeArrayNode, TreeChangeEvents, TreeFieldFromImplicitField, TreeLeafValue, TreeMapNode, TreeNode, TreeNodeApi, TreeNodeFromImplicitAllowedTypes, TreeNodeSchema, TreeNodeSchemaClass, TreeNodeSchemaCore, TreeNodeSchemaNonClass, TreeObjectNode, TreeStatus, TreeView, TreeViewConfiguration, TreeViewEvents, Unenforced, Unhydrated, UnionToIntersection, ValidateRecursiveSchema, ValidateRecursiveSchemaTemplate, ViewableTree, WithType, rollback, typeSchemaSymbol, AllowedTypeMetadata, AllowedTypesFull, AllowedTypesFullEvaluated, AllowedTypesFullFromMixed, AllowedTypesFullFromMixedUnsafe, AllowedTypesMetadata, AnnotateAllowedTypesList, AnnotateAllowedTypesListUnsafe, AnnotatedAllowedType, AnnotatedAllowedTypeUnsafe, AnnotatedAllowedTypes, AnnotatedAllowedTypesUnsafe, CodecWriteOptionsBeta, ConciseTree, ExtensibleUnionNode, FixRecursiveArraySchema, FluidSerializableAsTree, ForestOptions, ForestType, ForestTypeExpensiveDebug, ForestTypeOptimized, ForestTypeReference, JsonCompatible, JsonCompatibleObject, KeyEncodingOptions, NodeChangedData, ObjectSchemaOptions, PopUnion, RecordNodeInsertableData, SchemaFactoryBeta, SchemaStaticsBeta, SchemaUpgrade, SharedTreeOptionsBeta, SnapshotFileSystem, SnapshotSchemaCompatibilityOptions, System_TableSchema, TableSchema, TreeBeta, TreeBranch, TreeChangeEventsBeta, TreeEncodingOptions, TreeRecordNode, TreeRecordNodeUnsafe, TreeViewBeta, UnannotateAllowedTypeUnsafe, UnannotateAllowedTypesList, UnannotateAllowedTypesListUnsafe, UnionToTuple, adaptEnum, asBeta, configuredSharedTreeBeta, createIndependentTreeBeta, enumFromStrings, singletonSchema, snapshotSchemaCompatibility, AllowedTypesFullUnsafe, ArrayNodeCustomizableSchema, ArrayNodeCustomizableSchemaUnsafe, ArrayNodePojoEmulationSchema, ArrayNodeSchema, ArrayPlaceAnchor, BranchableTree, ChangeMetadata, CodecName, CodecWriteOptions, CreateIndependentTreeAlphaOptions, DirtyTreeMap, DirtyTreeStatus, ErasedNode, ErasedSchema, ErasedSchemaSubclassable, FactoryContent, FactoryContentObject, FieldHasDefaultAlpha, FieldHasDefaultAlphaUnsafe, FieldPropsAlpha, FieldSchemaAlpha, FieldSchemaAlphaUnsafe, FluidClientVersion, FormatValidator, FormatValidatorBasic, FormatValidatorNoOp, FormatVersion, HandleConverter, ICodecOptions, ITreeAlpha, IdentifierIndex, IncrementalEncodingPolicy, IndependentViewOptions, Insertable, InsertableContent, InsertableField, InsertableObjectFromSchemaRecordAlpha, InsertableObjectFromSchemaRecordAlphaUnsafe, JsonArrayNodeSchema, JsonAsTree, JsonCompatibleReadOnly, JsonCompatibleReadOnlyObject, JsonFieldSchema, JsonLeafNodeSchema, JsonLeafSchemaType, JsonMapNodeSchema, JsonNodeSchema, JsonNodeSchemaBase, JsonObjectNodeSchema, JsonRecordNodeSchema, JsonRefPath, JsonSchemaId, JsonSchemaRef, JsonSchemaType, JsonStringKeyPatternProperties, JsonTreeSchema, LabelTree, LocalChangeMetadata, MapNodeCustomizableSchema, MapNodeCustomizableSchemaUnsafe, MapNodePojoEmulationSchema, MapNodeSchema, NoChangeConstraint, NodeProvider, NodeSchemaOptionsAlpha, ObjectNodeSchema, ObjectNodeSchemaWorkaround, ObjectSchemaOptionsAlpha, ObservationResults, ReadSchema, ReadableField, RecordNodeCustomizableSchema, RecordNodePojoEmulationSchema, RecordNodeSchema, RemoteChangeMetadata, RevertibleAlpha, RevertibleAlphaFactory, RunTransactionParams, SchemaFactoryAlpha, SchemaStaticsAlpha, SchemaType, SharedTreeFormatOptions, SharedTreeOptions, SimpleAllowedTypeAttributes, SimpleArrayNodeSchema, SimpleFieldSchema, SimpleLeafNodeSchema, SimpleMapNodeSchema, SimpleNodeSchema, SimpleNodeSchemaBaseAlpha, SimpleObjectFieldSchema, SimpleObjectNodeSchema, SimpleRecordNodeSchema, SimpleTreeSchema, TextAsTree, TransactionCallbackStatus, TransactionConstraintAlpha, TransactionLabels, TransactionResult, TransactionResultExt, TransactionResultFailed, TransactionResultSuccess, TreeAlpha, TreeBranchAlpha, TreeBranchEvents, TreeBranchFork, TreeCompressionStrategy, TreeContextAlpha, TreeIdentifierUtils, TreeIndex, TreeIndexKey, TreeIndexNodes, TreeParsingOptions, TreeSchema, TreeSchemaEncodingOptions, TreeViewAlpha, TreeViewConfigurationAlpha, UnsafeUnknownSchema, ValueSchema, VerboseTree, VerboseTreeNode, ViewContent, VoidTransactionCallbackStatus, WithValue, allowUnused, asAlpha, asTreeViewAlpha, checkCompatibility, cloneWithReplacements, comparePersistedSchema, configuredSharedTreeAlpha, contentSchemaSymbol, createArrayInsertionAnchor, createIdentifierIndex, createIndependentTreeAlpha, createTreeIndex, decodeSchemaCompatibilitySnapshot, encodeSchemaCompatibilitySnapshot, eraseSchemaDetails, eraseSchemaDetailsSubclassable, evaluateLazySchema, exportCompatibilitySchemaSnapshot, extractPersistedSchema, generateSchemaFromSimpleSchema, getBranch, getJsonSchema, getSimpleSchema, importCompatibilitySchemaSnapshot, incrementalEncodingPolicyForAllowedTypes, incrementalSummaryHint, independentInitializedView, independentView, normalizeAllowedTypes, persistedToSimpleSchema, replaceConciseTreeHandles, replaceHandles, replaceVerboseTreeHandles, trackDirtyNodes } from "../index.js";
|
|
6
|
+
//# sourceMappingURL=alpha.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpha.d.ts","sourceRoot":"","sources":["../../src/entrypoints/alpha.ts"],"names":[],"mappings":"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"}
|