@colyseus/schema 5.0.13 → 5.0.14

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.
@@ -71,12 +71,12 @@ export declare const ReflectionField: import("./annotations.js").SchemaWithExten
71
71
  childPrimitive: FieldBuilder<string, false, false>;
72
72
  /** Set only on `t.quantized()` fields (`.optional()` — no auto-instantiated
73
73
  * default; its absence is the "not quantized" signal on decode). */
74
- quantized: FieldBuilder<{} & {
75
- min?: number;
76
- max?: number;
77
- bits?: number;
78
- mode?: number;
79
- } & Schema<any> & Schema<unknown>, false, true>;
74
+ quantized: FieldBuilder<{
75
+ min: number;
76
+ max: number;
77
+ bits: number;
78
+ mode: number;
79
+ } & {} & Schema<any> & Schema<unknown>, false, true>;
80
80
  }, import("./index.js").BuilderInitProps<{
81
81
  name: FieldBuilder<string, false, false>;
82
82
  type: FieldBuilder<string, false, false>;
@@ -86,43 +86,45 @@ export declare const ReflectionField: import("./annotations.js").SchemaWithExten
86
86
  childPrimitive: FieldBuilder<string, false, false>;
87
87
  /** Set only on `t.quantized()` fields (`.optional()` — no auto-instantiated
88
88
  * default; its absence is the "not quantized" signal on decode). */
89
- quantized: FieldBuilder<{} & {
90
- min?: number;
91
- max?: number;
92
- bits?: number;
93
- mode?: number;
94
- } & Schema<any> & Schema<unknown>, false, true>;
89
+ quantized: FieldBuilder<{
90
+ min: number;
91
+ max: number;
92
+ bits: number;
93
+ mode: number;
94
+ } & {} & Schema<any> & Schema<unknown>, false, true>;
95
95
  }>, typeof Schema>;
96
96
  export type ReflectionField = SchemaType<typeof ReflectionField>;
97
97
  export declare const ReflectionType: import("./annotations.js").SchemaWithExtendsConstructor<{
98
98
  id: FieldBuilder<number, false, false>;
99
99
  extendsId: FieldBuilder<number, false, false>;
100
- fields: FieldBuilder<ArraySchema<{} & {
101
- name?: string;
102
- type?: string;
103
- quantized?: {} & {
104
- min?: number;
105
- max?: number;
106
- bits?: number;
107
- mode?: number;
108
- } & Schema<any> & Schema<unknown>;
109
- referencedType?: number;
110
- childPrimitive?: string;
100
+ fields: FieldBuilder<ArraySchema<{
101
+ name: string;
102
+ type: string;
103
+ referencedType: number;
104
+ childPrimitive: string;
105
+ } & {
106
+ quantized?: {
107
+ min: number;
108
+ max: number;
109
+ bits: number;
110
+ mode: number;
111
+ } & {} & Schema<any> & Schema<unknown>;
111
112
  } & Schema<any> & Schema<unknown>>, true, false>;
112
113
  }, import("./index.js").BuilderInitProps<{
113
114
  id: FieldBuilder<number, false, false>;
114
115
  extendsId: FieldBuilder<number, false, false>;
115
- fields: FieldBuilder<ArraySchema<{} & {
116
- name?: string;
117
- type?: string;
118
- quantized?: {} & {
119
- min?: number;
120
- max?: number;
121
- bits?: number;
122
- mode?: number;
123
- } & Schema<any> & Schema<unknown>;
124
- referencedType?: number;
125
- childPrimitive?: string;
116
+ fields: FieldBuilder<ArraySchema<{
117
+ name: string;
118
+ type: string;
119
+ referencedType: number;
120
+ childPrimitive: string;
121
+ } & {
122
+ quantized?: {
123
+ min: number;
124
+ max: number;
125
+ bits: number;
126
+ mode: number;
127
+ } & {} & Schema<any> & Schema<unknown>;
126
128
  } & Schema<any> & Schema<unknown>>, true, false>;
127
129
  }>, typeof Schema>;
128
130
  export type ReflectionType = SchemaType<typeof ReflectionType>;
package/build/index.cjs CHANGED
@@ -6222,10 +6222,11 @@ registerType("stream", { constructor: StreamSchema });
6222
6222
  * Schema ref whose `initialize` takes zero args.
6223
6223
  * - `IsOptional` is a compile-time brand for `.optional()`. Both
6224
6224
  * `HasDefault` and `IsOptional` make the field omittable in
6225
- * `BuilderInitProps<T>`. A separate brand (rather than reading
6226
- * `undefined extends V`) sidesteps a TypeScript quirk where
6227
- * class-generic-inferred `V` resolves `undefined extends V` as `true`
6228
- * even for non-undefined types.
6225
+ * `BuilderInitProps<T>`; `IsOptional` alone marks the instance property
6226
+ * `?:`. A separate brand (rather than reading `undefined extends V`)
6227
+ * keeps both correct for consumers compiling with
6228
+ * `strictNullChecks: false`, where `undefined extends V` is true for
6229
+ * every V.
6229
6230
  *
6230
6231
  * schema() reads the internal configuration via `toDefinition()` and wires
6231
6232
  * up metadata through the existing pipeline.