@colyseus/schema 4.0.1 → 4.0.3
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/{lib → build}/Metadata.d.ts +2 -2
- package/{lib → build}/Reflection.d.ts +13 -13
- package/{lib → build}/Schema.d.ts +10 -10
- package/{lib → build}/annotations.d.ts +10 -10
- package/build/codegen/languages/cpp.d.ts +3 -0
- package/build/codegen/languages/csharp.d.ts +4 -0
- package/build/codegen/languages/haxe.d.ts +3 -0
- package/{lib → build}/codegen/languages/java.d.ts +2 -2
- package/build/codegen/languages/js.d.ts +3 -0
- package/build/codegen/languages/lua.d.ts +3 -0
- package/build/codegen/languages/ts.d.ts +3 -0
- package/{lib → build}/codegen/parser.d.ts +1 -1
- package/{lib → build}/decoder/DecodeOperation.d.ts +5 -5
- package/{lib → build}/decoder/Decoder.d.ts +7 -7
- package/{lib → build}/decoder/ReferenceTracker.d.ts +1 -1
- package/{lib → build}/decoder/strategy/Callbacks.d.ts +11 -11
- package/{lib → build}/decoder/strategy/RawChanges.d.ts +2 -2
- package/{lib → build}/decoder/strategy/getDecoderStateCallbacks.d.ts +3 -3
- package/{lib → build}/encoder/ChangeTree.d.ts +11 -11
- package/{lib → build}/encoder/EncodeOperation.d.ts +5 -5
- package/{lib → build}/encoder/Encoder.d.ts +6 -6
- package/{lib → build}/encoder/Root.d.ts +2 -2
- package/{lib → build}/encoder/StateView.d.ts +1 -1
- package/{lib → build}/encoding/assert.d.ts +6 -6
- package/{lib → build}/encoding/decode.d.ts +1 -1
- package/{lib → build}/encoding/encode.d.ts +1 -1
- package/build/{cjs/index.js → index.cjs} +1 -1
- package/build/index.cjs.map +1 -0
- package/build/index.d.ts +32 -0
- package/build/index.mjs.map +1 -0
- package/{lib → build}/types/HelperTypes.d.ts +6 -6
- package/{lib → build}/types/TypeContext.d.ts +1 -1
- package/{lib → build}/types/custom/ArraySchema.d.ts +8 -8
- package/{lib → build}/types/custom/CollectionSchema.d.ts +7 -7
- package/{lib → build}/types/custom/MapSchema.d.ts +7 -7
- package/{lib → build}/types/custom/SetSchema.d.ts +7 -7
- package/{lib → build}/types/registry.d.ts +2 -2
- package/{lib → build}/utils.d.ts +1 -1
- package/package.json +15 -14
- package/src/Metadata.ts +5 -5
- package/src/Reflection.ts +7 -7
- package/src/Schema.ts +11 -11
- package/src/annotations.ts +13 -13
- package/src/codegen/api.ts +10 -3
- package/src/codegen/cli.ts +2 -2
- package/src/codegen/languages/cpp.ts +2 -2
- package/src/codegen/languages/csharp.ts +3 -3
- package/src/codegen/languages/haxe.ts +2 -2
- package/src/codegen/languages/java.ts +2 -2
- package/src/codegen/languages/js.ts +2 -2
- package/src/codegen/languages/lua.ts +2 -2
- package/src/codegen/languages/ts.ts +2 -2
- package/src/codegen/parser.ts +7 -2
- package/src/codegen/types.ts +5 -0
- package/src/decoder/DecodeOperation.ts +14 -14
- package/src/decoder/Decoder.ts +11 -11
- package/src/decoder/ReferenceTracker.ts +8 -8
- package/src/decoder/strategy/Callbacks.ts +12 -12
- package/src/decoder/strategy/RawChanges.ts +2 -2
- package/src/decoder/strategy/getDecoderStateCallbacks.ts +10 -10
- package/src/encoder/ChangeTree.ts +13 -13
- package/src/encoder/EncodeOperation.ts +9 -9
- package/src/encoder/Encoder.ts +10 -10
- package/src/encoder/Root.ts +4 -4
- package/src/encoder/StateView.ts +7 -7
- package/src/encoding/assert.ts +6 -6
- package/src/encoding/decode.ts +1 -1
- package/src/encoding/encode.ts +1 -1
- package/src/index.ts +27 -27
- package/src/types/HelperTypes.ts +6 -6
- package/src/types/TypeContext.ts +3 -3
- package/src/types/custom/ArraySchema.ts +11 -11
- package/src/types/custom/CollectionSchema.ts +9 -9
- package/src/types/custom/MapSchema.ts +10 -10
- package/src/types/custom/SetSchema.ts +9 -9
- package/src/types/registry.ts +3 -3
- package/src/utils.ts +3 -3
- package/src/v3_bench.ts +1 -1
- package/build/cjs/index.js.map +0 -1
- package/build/esm/index.mjs.map +0 -1
- package/lib/Metadata.js +0 -260
- package/lib/Metadata.js.map +0 -1
- package/lib/Reflection.js +0 -182
- package/lib/Reflection.js.map +0 -1
- package/lib/Schema.js +0 -356
- package/lib/Schema.js.map +0 -1
- package/lib/annotations.js +0 -484
- package/lib/annotations.js.map +0 -1
- package/lib/bench_encode.d.ts +0 -1
- package/lib/bench_encode.js +0 -126
- package/lib/bench_encode.js.map +0 -1
- package/lib/codegen/api.js +0 -87
- package/lib/codegen/api.js.map +0 -1
- package/lib/codegen/argv.js +0 -41
- package/lib/codegen/argv.js.map +0 -1
- package/lib/codegen/cli.js +0 -63
- package/lib/codegen/cli.js.map +0 -1
- package/lib/codegen/languages/cpp.d.ts +0 -3
- package/lib/codegen/languages/cpp.js +0 -261
- package/lib/codegen/languages/cpp.js.map +0 -1
- package/lib/codegen/languages/csharp.d.ts +0 -4
- package/lib/codegen/languages/csharp.js +0 -157
- package/lib/codegen/languages/csharp.js.map +0 -1
- package/lib/codegen/languages/haxe.d.ts +0 -3
- package/lib/codegen/languages/haxe.js +0 -103
- package/lib/codegen/languages/haxe.js.map +0 -1
- package/lib/codegen/languages/java.js +0 -103
- package/lib/codegen/languages/java.js.map +0 -1
- package/lib/codegen/languages/js.d.ts +0 -3
- package/lib/codegen/languages/js.js +0 -104
- package/lib/codegen/languages/js.js.map +0 -1
- package/lib/codegen/languages/lua.d.ts +0 -3
- package/lib/codegen/languages/lua.js +0 -106
- package/lib/codegen/languages/lua.js.map +0 -1
- package/lib/codegen/languages/ts.d.ts +0 -3
- package/lib/codegen/languages/ts.js +0 -119
- package/lib/codegen/languages/ts.js.map +0 -1
- package/lib/codegen/parser.js +0 -364
- package/lib/codegen/parser.js.map +0 -1
- package/lib/codegen/types.js +0 -181
- package/lib/codegen/types.js.map +0 -1
- package/lib/decoder/DecodeOperation.js +0 -255
- package/lib/decoder/DecodeOperation.js.map +0 -1
- package/lib/decoder/Decoder.js +0 -118
- package/lib/decoder/Decoder.js.map +0 -1
- package/lib/decoder/ReferenceTracker.js +0 -139
- package/lib/decoder/ReferenceTracker.js.map +0 -1
- package/lib/decoder/strategy/Callbacks.js +0 -340
- package/lib/decoder/strategy/Callbacks.js.map +0 -1
- package/lib/decoder/strategy/RawChanges.js +0 -7
- package/lib/decoder/strategy/RawChanges.js.map +0 -1
- package/lib/decoder/strategy/getDecoderStateCallbacks.js +0 -277
- package/lib/decoder/strategy/getDecoderStateCallbacks.js.map +0 -1
- package/lib/encoder/ChangeTree.js +0 -542
- package/lib/encoder/ChangeTree.js.map +0 -1
- package/lib/encoder/EncodeOperation.js +0 -139
- package/lib/encoder/EncodeOperation.js.map +0 -1
- package/lib/encoder/Encoder.js +0 -208
- package/lib/encoder/Encoder.js.map +0 -1
- package/lib/encoder/Root.js +0 -233
- package/lib/encoder/Root.js.map +0 -1
- package/lib/encoder/StateView.js +0 -284
- package/lib/encoder/StateView.js.map +0 -1
- package/lib/encoding/assert.js +0 -55
- package/lib/encoding/assert.js.map +0 -1
- package/lib/encoding/decode.js +0 -221
- package/lib/encoding/decode.js.map +0 -1
- package/lib/encoding/encode.js +0 -282
- package/lib/encoding/encode.js.map +0 -1
- package/lib/encoding/spec.js +0 -29
- package/lib/encoding/spec.js.map +0 -1
- package/lib/index.d.ts +0 -32
- package/lib/index.js +0 -81
- package/lib/index.js.map +0 -1
- package/lib/symbol.shim.js +0 -4
- package/lib/symbol.shim.js.map +0 -1
- package/lib/types/HelperTypes.js +0 -3
- package/lib/types/HelperTypes.js.map +0 -1
- package/lib/types/TypeContext.js +0 -147
- package/lib/types/TypeContext.js.map +0 -1
- package/lib/types/custom/ArraySchema.js +0 -737
- package/lib/types/custom/ArraySchema.js.map +0 -1
- package/lib/types/custom/CollectionSchema.js +0 -174
- package/lib/types/custom/CollectionSchema.js.map +0 -1
- package/lib/types/custom/MapSchema.js +0 -226
- package/lib/types/custom/MapSchema.js.map +0 -1
- package/lib/types/custom/SetSchema.js +0 -182
- package/lib/types/custom/SetSchema.js.map +0 -1
- package/lib/types/registry.js +0 -37
- package/lib/types/registry.js.map +0 -1
- package/lib/types/symbols.js +0 -37
- package/lib/types/symbols.js.map +0 -1
- package/lib/types/utils.js +0 -16
- package/lib/types/utils.js.map +0 -1
- package/lib/utils.js +0 -54
- package/lib/utils.js.map +0 -1
- package/lib/v3_bench.js +0 -130
- package/lib/v3_bench.js.map +0 -1
- package/src/bench_encode.ts +0 -64
- /package/{lib → build}/codegen/api.d.ts +0 -0
- /package/{lib → build}/codegen/argv.d.ts +0 -0
- /package/{lib → build}/codegen/cli.d.ts +0 -0
- /package/{lib → build}/codegen/types.d.ts +0 -0
- /package/{lib → build}/encoding/spec.d.ts +0 -0
- /package/build/{umd/index.js → index.js} +0 -0
- /package/build/{esm/index.mjs → index.mjs} +0 -0
- /package/{lib → build}/symbol.shim.d.ts +0 -0
- /package/{lib → build}/types/symbols.d.ts +0 -0
- /package/{lib → build}/types/utils.d.ts +0 -0
- /package/{lib → build}/v3_bench.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DefinitionType } from "./annotations";
|
|
2
|
-
import { $descriptors, $fieldIndexesByViewTag, $numFields, $refTypeFieldIndexes, $viewFieldIndexes } from "./types/symbols";
|
|
1
|
+
import { DefinitionType } from "./annotations.js";
|
|
2
|
+
import { $descriptors, $fieldIndexesByViewTag, $numFields, $refTypeFieldIndexes, $viewFieldIndexes } from "./types/symbols.js";
|
|
3
3
|
export type MetadataField = {
|
|
4
4
|
type: DefinitionType;
|
|
5
5
|
name: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { schema, SchemaType } from "./annotations";
|
|
2
|
-
import { Iterator } from "./encoding/decode";
|
|
3
|
-
import { Encoder } from "./encoder/Encoder";
|
|
4
|
-
import { Decoder } from "./decoder/Decoder";
|
|
5
|
-
import { Schema } from "./Schema";
|
|
1
|
+
import { schema, SchemaType } from "./annotations.js";
|
|
2
|
+
import { Iterator } from "./encoding/decode.js";
|
|
3
|
+
import { Encoder } from "./encoder/Encoder.js";
|
|
4
|
+
import { Decoder } from "./decoder/Decoder.js";
|
|
5
|
+
import { Schema } from "./Schema.js";
|
|
6
6
|
/**
|
|
7
7
|
* Static methods available on Reflection
|
|
8
8
|
*/
|
|
@@ -27,36 +27,36 @@ interface ReflectionStatic {
|
|
|
27
27
|
/**
|
|
28
28
|
* Reflection
|
|
29
29
|
*/
|
|
30
|
-
export declare const ReflectionField: import("./annotations").SchemaWithExtendsConstructor<{
|
|
30
|
+
export declare const ReflectionField: import("./annotations.js").SchemaWithExtendsConstructor<{
|
|
31
31
|
name: "string";
|
|
32
32
|
type: "string";
|
|
33
33
|
referencedType: "number";
|
|
34
|
-
}, import(".").AssignableProps<import(".").InferSchemaInstanceType<{
|
|
34
|
+
}, import("./index.js").AssignableProps<import("./index.js").InferSchemaInstanceType<{
|
|
35
35
|
name: "string";
|
|
36
36
|
type: "string";
|
|
37
37
|
referencedType: "number";
|
|
38
38
|
}>>, typeof Schema>;
|
|
39
39
|
export type ReflectionField = SchemaType<typeof ReflectionField>;
|
|
40
|
-
export declare const ReflectionType: import("./annotations").SchemaWithExtendsConstructor<{
|
|
40
|
+
export declare const ReflectionType: import("./annotations.js").SchemaWithExtendsConstructor<{
|
|
41
41
|
id: "number";
|
|
42
42
|
extendsId: "number";
|
|
43
|
-
fields: import("./annotations").SchemaWithExtendsConstructor<{
|
|
43
|
+
fields: import("./annotations.js").SchemaWithExtendsConstructor<{
|
|
44
44
|
name: "string";
|
|
45
45
|
type: "string";
|
|
46
46
|
referencedType: "number";
|
|
47
|
-
}, import(".").AssignableProps<import(".").InferSchemaInstanceType<{
|
|
47
|
+
}, import("./index.js").AssignableProps<import("./index.js").InferSchemaInstanceType<{
|
|
48
48
|
name: "string";
|
|
49
49
|
type: "string";
|
|
50
50
|
referencedType: "number";
|
|
51
51
|
}>>, typeof Schema>[];
|
|
52
|
-
}, import(".").AssignableProps<import(".").InferSchemaInstanceType<{
|
|
52
|
+
}, import("./index.js").AssignableProps<import("./index.js").InferSchemaInstanceType<{
|
|
53
53
|
id: "number";
|
|
54
54
|
extendsId: "number";
|
|
55
|
-
fields: import("./annotations").SchemaWithExtendsConstructor<{
|
|
55
|
+
fields: import("./annotations.js").SchemaWithExtendsConstructor<{
|
|
56
56
|
name: "string";
|
|
57
57
|
type: "string";
|
|
58
58
|
referencedType: "number";
|
|
59
|
-
}, import(".").AssignableProps<import(".").InferSchemaInstanceType<{
|
|
59
|
+
}, import("./index.js").AssignableProps<import("./index.js").InferSchemaInstanceType<{
|
|
60
60
|
name: "string";
|
|
61
61
|
type: "string";
|
|
62
62
|
referencedType: "number";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { OPERATION } from './encoding/spec';
|
|
2
|
-
import { type DefinitionType } from "./annotations";
|
|
3
|
-
import { AssignableProps, NonFunctionPropNames, ToJSON } from './types/HelperTypes';
|
|
4
|
-
import { ChangeSetName, ChangeTree, IRef, Ref } from './encoder/ChangeTree';
|
|
5
|
-
import { $decoder, $deleteByIndex, $encoder, $filter, $getByIndex, $refId, $track } from './types/symbols';
|
|
6
|
-
import { StateView } from './encoder/StateView';
|
|
7
|
-
import type { Decoder } from './decoder/Decoder';
|
|
8
|
-
import type { Metadata } from './Metadata';
|
|
1
|
+
import { OPERATION } from './encoding/spec.js';
|
|
2
|
+
import { type DefinitionType } from "./annotations.js";
|
|
3
|
+
import { AssignableProps, NonFunctionPropNames, ToJSON } from './types/HelperTypes.js';
|
|
4
|
+
import { ChangeSetName, ChangeTree, IRef, Ref } from './encoder/ChangeTree.js';
|
|
5
|
+
import { $decoder, $deleteByIndex, $encoder, $filter, $getByIndex, $refId, $track } from './types/symbols.js';
|
|
6
|
+
import { StateView } from './encoder/StateView.js';
|
|
7
|
+
import type { Decoder } from './decoder/Decoder.js';
|
|
8
|
+
import type { Metadata } from './Metadata.js';
|
|
9
9
|
/**
|
|
10
10
|
* Schema encoder / decoder
|
|
11
11
|
*/
|
|
12
12
|
export declare class Schema<C = any> implements IRef {
|
|
13
13
|
static [Symbol.metadata]: Metadata;
|
|
14
|
-
static [$encoder]: import("./encoder/EncodeOperation").EncodeOperation<any>;
|
|
15
|
-
static [$decoder]: import("./decoder/DecodeOperation").DecodeOperation<any>;
|
|
14
|
+
static [$encoder]: import("./encoder/EncodeOperation.js").EncodeOperation<any>;
|
|
15
|
+
static [$decoder]: import("./decoder/DecodeOperation.js").DecodeOperation<any>;
|
|
16
16
|
[$refId]?: number;
|
|
17
17
|
/**
|
|
18
18
|
* Assign the property descriptors required to track changes on this instance.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./symbol.shim";
|
|
2
|
-
import { Schema } from './Schema';
|
|
3
|
-
import { ArraySchema } from './types/custom/ArraySchema';
|
|
4
|
-
import { MapSchema } from './types/custom/MapSchema';
|
|
5
|
-
import { TypeDefinition } from "./types/registry";
|
|
6
|
-
import { OPERATION } from "./encoding/spec";
|
|
7
|
-
import type { InferValueType, InferSchemaInstanceType, AssignableProps } from "./types/HelperTypes";
|
|
8
|
-
import { CollectionSchema } from "./types/custom/CollectionSchema";
|
|
9
|
-
import { SetSchema } from "./types/custom/SetSchema";
|
|
1
|
+
import "./symbol.shim.js";
|
|
2
|
+
import { Schema } from './Schema.js';
|
|
3
|
+
import { ArraySchema } from './types/custom/ArraySchema.js';
|
|
4
|
+
import { MapSchema } from './types/custom/MapSchema.js';
|
|
5
|
+
import { TypeDefinition } from "./types/registry.js";
|
|
6
|
+
import { OPERATION } from "./encoding/spec.js";
|
|
7
|
+
import type { InferValueType, InferSchemaInstanceType, AssignableProps } from "./types/HelperTypes.js";
|
|
8
|
+
import { CollectionSchema } from "./types/custom/CollectionSchema.js";
|
|
9
|
+
import { SetSchema } from "./types/custom/SetSchema.js";
|
|
10
10
|
export type RawPrimitiveType = "string" | "number" | "boolean" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32" | "int64" | "uint64" | "float32" | "float64" | "bigint64" | "biguint64";
|
|
11
11
|
export type PrimitiveType = RawPrimitiveType | typeof Schema | object;
|
|
12
12
|
export type DefinitionType<T extends PrimitiveType = PrimitiveType> = T | T[] | {
|
|
@@ -63,7 +63,7 @@ export declare function view<T>(tag?: number): (target: T, fieldName: string) =>
|
|
|
63
63
|
export declare function unreliable<T>(target: T, field: string): void;
|
|
64
64
|
export declare function type(type: DefinitionType, options?: TypeOptions): PropertyDecorator;
|
|
65
65
|
export declare function getPropertyDescriptor(fieldCached: string, fieldIndex: number, type: DefinitionType, complexTypeKlass: TypeDefinition): {
|
|
66
|
-
get: (this: Schema) => number | ((index: number) => any) | ((index: number) => void) | (() => Schema<any>) | (<T extends Partial<Schema<any>>>(props: AssignableProps<T>) => Schema<any>) | ((jsonData: import("./
|
|
66
|
+
get: (this: Schema) => number | ((index: number) => any) | ((index: number) => void) | (() => Schema<any>) | (<T extends Partial<Schema<any>>>(props: AssignableProps<T>) => Schema<any>) | ((jsonData: import("./index.js").ToJSON<Schema<any>>) => Schema<any>) | (<K extends "~refId">(property: number | K, operation?: OPERATION) => void) | ((this: any) => import("./index.js").ToJSON<Schema<any>>) | (() => void);
|
|
67
67
|
set: (this: Schema, value: any) => void;
|
|
68
68
|
enumerable: boolean;
|
|
69
69
|
configurable: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ts from "typescript";
|
|
2
|
-
import { Class, Interface, Context, Enum } from "./types";
|
|
2
|
+
import { Class, Interface, Context, Enum } from "./types.js";
|
|
3
3
|
export declare function parseFiles(fileNames: string[], decoratorName?: string, context?: Context): {
|
|
4
4
|
classes: Class[];
|
|
5
5
|
interfaces: Interface[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { OPERATION } from "../encoding/spec";
|
|
2
|
-
import { Schema } from "../Schema";
|
|
3
|
-
import type { Ref } from "../encoder/ChangeTree";
|
|
4
|
-
import type { Decoder } from "./Decoder";
|
|
5
|
-
import { Iterator } from "../encoding/decode";
|
|
1
|
+
import { OPERATION } from "../encoding/spec.js";
|
|
2
|
+
import { Schema } from "../Schema.js";
|
|
3
|
+
import type { Ref } from "../encoder/ChangeTree.js";
|
|
4
|
+
import type { Decoder } from "./Decoder.js";
|
|
5
|
+
import { Iterator } from "../encoding/decode.js";
|
|
6
6
|
export interface DataChange<T = any, F = string> {
|
|
7
7
|
ref: Ref;
|
|
8
8
|
refId: number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { TypeContext } from "../types/TypeContext";
|
|
2
|
-
import { Schema } from "../Schema";
|
|
3
|
-
import type { Ref } from "../encoder/ChangeTree";
|
|
4
|
-
import type { Iterator } from "../encoding/decode";
|
|
5
|
-
import { ReferenceTracker } from "./ReferenceTracker";
|
|
6
|
-
import { type DataChange } from "./DecodeOperation";
|
|
7
|
-
import { Collection } from "../types/HelperTypes";
|
|
1
|
+
import { TypeContext } from "../types/TypeContext.js";
|
|
2
|
+
import { Schema } from "../Schema.js";
|
|
3
|
+
import type { Ref } from "../encoder/ChangeTree.js";
|
|
4
|
+
import type { Iterator } from "../encoding/decode.js";
|
|
5
|
+
import { ReferenceTracker } from "./ReferenceTracker.js";
|
|
6
|
+
import { type DataChange } from "./DecodeOperation.js";
|
|
7
|
+
import { Collection } from "../types/HelperTypes.js";
|
|
8
8
|
export declare class Decoder<T extends Schema = any> {
|
|
9
9
|
context: TypeContext;
|
|
10
10
|
state: T;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Collection, NonFunctionPropNames } from "../../types/HelperTypes";
|
|
2
|
-
import { Ref } from "../../encoder/ChangeTree";
|
|
3
|
-
import { Decoder } from "../Decoder";
|
|
4
|
-
import { DataChange } from "../DecodeOperation";
|
|
5
|
-
import { OPERATION } from "../../encoding/spec";
|
|
6
|
-
import { Schema } from "../../Schema";
|
|
7
|
-
import { $refId } from "../../types/symbols";
|
|
8
|
-
import { MapSchema } from "../../types/custom/MapSchema";
|
|
9
|
-
import { ArraySchema } from "../../types/custom/ArraySchema";
|
|
10
|
-
import { type SchemaCallbackProxy } from "./getDecoderStateCallbacks";
|
|
1
|
+
import { Collection, NonFunctionPropNames } from "../../types/HelperTypes.js";
|
|
2
|
+
import { Ref } from "../../encoder/ChangeTree.js";
|
|
3
|
+
import { Decoder } from "../Decoder.js";
|
|
4
|
+
import { DataChange } from "../DecodeOperation.js";
|
|
5
|
+
import { OPERATION } from "../../encoding/spec.js";
|
|
6
|
+
import { Schema } from "../../Schema.js";
|
|
7
|
+
import { $refId } from "../../types/symbols.js";
|
|
8
|
+
import { MapSchema } from "../../types/custom/MapSchema.js";
|
|
9
|
+
import { ArraySchema } from "../../types/custom/ArraySchema.js";
|
|
10
|
+
import { type SchemaCallbackProxy } from "./getDecoderStateCallbacks.js";
|
|
11
11
|
type PropertyChangeCallback<K> = (currentValue: K, previousValue: K) => void;
|
|
12
12
|
type KeyValueCallback<K, V> = (key: K, value: V) => void;
|
|
13
13
|
type InstanceChangeCallback = () => void;
|
|
@@ -49,7 +49,7 @@ export declare class StateCallbackStrategy<TState extends Schema> {
|
|
|
49
49
|
protected isTriggering: boolean;
|
|
50
50
|
constructor(decoder: Decoder<TState>);
|
|
51
51
|
protected get callbacks(): {
|
|
52
|
-
[refId: number]: import("../ReferenceTracker").SchemaCallbacks;
|
|
52
|
+
[refId: number]: import("../ReferenceTracker.js").SchemaCallbacks;
|
|
53
53
|
};
|
|
54
54
|
protected get state(): TState;
|
|
55
55
|
protected addCallback(refId: number, operationOrProperty: OPERATION | string, handler: Function): () => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DataChange } from "../DecodeOperation";
|
|
2
|
-
import { Decoder } from "../Decoder";
|
|
1
|
+
import { DataChange } from "../DecodeOperation.js";
|
|
2
|
+
import { Decoder } from "../Decoder.js";
|
|
3
3
|
export declare function getRawChangesCallback(decoder: Decoder, callback: (changes: DataChange[]) => void): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Collection, NonFunctionNonPrimitivePropNames, NonFunctionPropNames } from "../../types/HelperTypes";
|
|
2
|
-
import { Decoder } from "../Decoder";
|
|
3
|
-
import { Schema } from "../../Schema";
|
|
1
|
+
import { Collection, NonFunctionNonPrimitivePropNames, NonFunctionPropNames } from "../../types/HelperTypes.js";
|
|
2
|
+
import { Decoder } from "../Decoder.js";
|
|
3
|
+
import { Schema } from "../../Schema.js";
|
|
4
4
|
/**
|
|
5
5
|
* TODO: define a schema interface, which even having duplicate definitions, it could be used to get the callback proxy.
|
|
6
6
|
*
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { OPERATION } from "../encoding/spec";
|
|
2
|
-
import { Schema } from "../Schema";
|
|
3
|
-
import { $changes, $decoder, $encoder, $getByIndex, $refId, type $deleteByIndex } from "../types/symbols";
|
|
4
|
-
import type { MapSchema } from "../types/custom/MapSchema";
|
|
5
|
-
import type { ArraySchema } from "../types/custom/ArraySchema";
|
|
6
|
-
import type { CollectionSchema } from "../types/custom/CollectionSchema";
|
|
7
|
-
import type { SetSchema } from "../types/custom/SetSchema";
|
|
8
|
-
import { Root } from "./Root";
|
|
9
|
-
import { Metadata } from "../Metadata";
|
|
10
|
-
import type { EncodeOperation } from "./EncodeOperation";
|
|
11
|
-
import type { DecodeOperation } from "../decoder/DecodeOperation";
|
|
1
|
+
import { OPERATION } from "../encoding/spec.js";
|
|
2
|
+
import { Schema } from "../Schema.js";
|
|
3
|
+
import { $changes, $decoder, $encoder, $getByIndex, $refId, type $deleteByIndex } from "../types/symbols.js";
|
|
4
|
+
import type { MapSchema } from "../types/custom/MapSchema.js";
|
|
5
|
+
import type { ArraySchema } from "../types/custom/ArraySchema.js";
|
|
6
|
+
import type { CollectionSchema } from "../types/custom/CollectionSchema.js";
|
|
7
|
+
import type { SetSchema } from "../types/custom/SetSchema.js";
|
|
8
|
+
import { Root } from "./Root.js";
|
|
9
|
+
import { Metadata } from "../Metadata.js";
|
|
10
|
+
import type { EncodeOperation } from "./EncodeOperation.js";
|
|
11
|
+
import type { DecodeOperation } from "../decoder/DecodeOperation.js";
|
|
12
12
|
declare global {
|
|
13
13
|
interface Object {
|
|
14
14
|
[$changes]?: ChangeTree;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { OPERATION } from "../encoding/spec";
|
|
2
|
-
import type { ChangeTree, Ref } from "./ChangeTree";
|
|
3
|
-
import type { Encoder } from "./Encoder";
|
|
4
|
-
import type { Iterator } from "../encoding/decode";
|
|
5
|
-
import type { Metadata } from "../Metadata";
|
|
1
|
+
import { OPERATION } from "../encoding/spec.js";
|
|
2
|
+
import type { ChangeTree, Ref } from "./ChangeTree.js";
|
|
3
|
+
import type { Encoder } from "./Encoder.js";
|
|
4
|
+
import type { Iterator } from "../encoding/decode.js";
|
|
5
|
+
import type { Metadata } from "../Metadata.js";
|
|
6
6
|
export type EncodeOperation<T extends Ref = any> = (encoder: Encoder, bytes: Uint8Array, changeTree: ChangeTree<T>, index: number, operation: OPERATION, it: Iterator, isEncodeAll: boolean, hasView: boolean, metadata?: Metadata) => void;
|
|
7
7
|
export declare function encodeValue(encoder: Encoder, bytes: Uint8Array, type: any, value: any, operation: OPERATION, it: Iterator): void;
|
|
8
8
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Schema } from "../Schema";
|
|
2
|
-
import { TypeContext } from "../types/TypeContext";
|
|
3
|
-
import type { Iterator } from "../encoding/decode";
|
|
4
|
-
import { Root } from "./Root";
|
|
5
|
-
import type { StateView } from "./StateView";
|
|
6
|
-
import type { ChangeSetName } from "./ChangeTree";
|
|
1
|
+
import type { Schema } from "../Schema.js";
|
|
2
|
+
import { TypeContext } from "../types/TypeContext.js";
|
|
3
|
+
import type { Iterator } from "../encoding/decode.js";
|
|
4
|
+
import { Root } from "./Root.js";
|
|
5
|
+
import type { StateView } from "./StateView.js";
|
|
6
|
+
import type { ChangeSetName } from "./ChangeTree.js";
|
|
7
7
|
export declare class Encoder<T extends Schema = any> {
|
|
8
8
|
static BUFFER_SIZE: number;
|
|
9
9
|
sharedBuffer: Uint8Array;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TypeContext } from "../types/TypeContext";
|
|
2
|
-
import { ChangeTree, ChangeTreeList, ChangeSetName, type ChangeTreeNode } from "./ChangeTree";
|
|
1
|
+
import { TypeContext } from "../types/TypeContext.js";
|
|
2
|
+
import { ChangeTree, ChangeTreeList, ChangeSetName, type ChangeTreeNode } from "./ChangeTree.js";
|
|
3
3
|
export declare class Root {
|
|
4
4
|
types: TypeContext;
|
|
5
5
|
protected nextUniqueId: number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Schema } from "../Schema";
|
|
2
|
-
import type { CollectionSchema } from "../types/custom/CollectionSchema";
|
|
3
|
-
import type { MapSchema } from "../types/custom/MapSchema";
|
|
4
|
-
import type { SetSchema } from "../types/custom/SetSchema";
|
|
5
|
-
import type { ArraySchema } from "../types/custom/ArraySchema";
|
|
6
|
-
import type { Ref } from "../encoder/ChangeTree";
|
|
1
|
+
import type { Schema } from "../Schema.js";
|
|
2
|
+
import type { CollectionSchema } from "../types/custom/CollectionSchema.js";
|
|
3
|
+
import type { MapSchema } from "../types/custom/MapSchema.js";
|
|
4
|
+
import type { SetSchema } from "../types/custom/SetSchema.js";
|
|
5
|
+
import type { ArraySchema } from "../types/custom/ArraySchema.js";
|
|
6
|
+
import type { Ref } from "../encoder/ChangeTree.js";
|
|
7
7
|
export declare class EncodeSchemaError extends Error {
|
|
8
8
|
}
|
|
9
9
|
export declare function assertType(value: any, type: string, klass: Schema, field: string | number): void;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
* SOFTWARE
|
|
22
22
|
*/
|
|
23
|
-
import type { BufferLike } from "./encode";
|
|
23
|
+
import type { BufferLike } from "./encode.js";
|
|
24
24
|
/**
|
|
25
25
|
* msgpack implementation highly based on notepack.io
|
|
26
26
|
* https://github.com/darrachequesne/notepack
|