spacetimedb 0.0.1
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/package.json +61 -0
- package/src/algebraic_type.ts +460 -0
- package/src/algebraic_value.ts +10 -0
- package/src/autogen/algebraic_type_type.ts +176 -0
- package/src/autogen/algebraic_type_variants.ts +47 -0
- package/src/autogen/index_type_type.ts +65 -0
- package/src/autogen/index_type_variants.ts +20 -0
- package/src/autogen/lifecycle_type.ts +73 -0
- package/src/autogen/lifecycle_variants.ts +21 -0
- package/src/autogen/misc_module_export_type.ts +67 -0
- package/src/autogen/misc_module_export_variants.ts +22 -0
- package/src/autogen/product_type_element_type.ts +67 -0
- package/src/autogen/product_type_type.ts +62 -0
- package/src/autogen/raw_column_def_v_8_type.ts +62 -0
- package/src/autogen/raw_column_default_value_v_9_type.ts +61 -0
- package/src/autogen/raw_constraint_data_v_9_type.ts +67 -0
- package/src/autogen/raw_constraint_data_v_9_variants.ts +23 -0
- package/src/autogen/raw_constraint_def_v_8_type.ts +61 -0
- package/src/autogen/raw_constraint_def_v_9_type.ts +67 -0
- package/src/autogen/raw_index_algorithm_type.ts +70 -0
- package/src/autogen/raw_index_algorithm_variants.ts +21 -0
- package/src/autogen/raw_index_def_v_8_type.ts +69 -0
- package/src/autogen/raw_index_def_v_9_type.ts +74 -0
- package/src/autogen/raw_misc_module_export_v_9_type.ts +67 -0
- package/src/autogen/raw_misc_module_export_v_9_variants.ts +25 -0
- package/src/autogen/raw_module_def_type.ts +77 -0
- package/src/autogen/raw_module_def_v_8_type.ts +90 -0
- package/src/autogen/raw_module_def_v_9_type.ts +110 -0
- package/src/autogen/raw_module_def_variants.ts +26 -0
- package/src/autogen/raw_reducer_def_v_9_type.ts +72 -0
- package/src/autogen/raw_row_level_security_def_v_9_type.ts +52 -0
- package/src/autogen/raw_schedule_def_v_9_type.ts +63 -0
- package/src/autogen/raw_scoped_type_name_v_9_type.ts +61 -0
- package/src/autogen/raw_sequence_def_v_8_type.ts +81 -0
- package/src/autogen/raw_sequence_def_v_9_type.ts +84 -0
- package/src/autogen/raw_table_def_v_8_type.ts +105 -0
- package/src/autogen/raw_table_def_v_9_type.ts +117 -0
- package/src/autogen/raw_type_def_v_9_type.ts +64 -0
- package/src/autogen/raw_unique_constraint_data_v_9_type.ts +57 -0
- package/src/autogen/reducer_def_type.ts +64 -0
- package/src/autogen/sum_type_type.ts +62 -0
- package/src/autogen/sum_type_variant_type.ts +67 -0
- package/src/autogen/table_access_type.ts +67 -0
- package/src/autogen/table_access_variants.ts +20 -0
- package/src/autogen/table_desc_type.ts +62 -0
- package/src/autogen/table_type_type.ts +65 -0
- package/src/autogen/table_type_variants.ts +20 -0
- package/src/autogen/type_alias_type.ts +56 -0
- package/src/autogen/typespace_type.ts +62 -0
- package/src/binary_reader.ts +167 -0
- package/src/binary_writer.ts +169 -0
- package/src/connection_id.ts +88 -0
- package/src/identity.ts +58 -0
- package/src/index.ts +11 -0
- package/src/schedule_at.ts +43 -0
- package/src/server/type_builders.test-d.ts +112 -0
- package/src/server/type_builders.ts +1851 -0
- package/src/server/type_util.ts +24 -0
- package/src/time_duration.ts +41 -0
- package/src/timestamp.ts +74 -0
- package/src/utils.ts +103 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
|
2
|
+
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
|
3
|
+
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/* tslint:disable */
|
|
6
|
+
import {
|
|
7
|
+
AlgebraicType as __AlgebraicTypeValue,
|
|
8
|
+
BinaryReader as __BinaryReader,
|
|
9
|
+
BinaryWriter as __BinaryWriter,
|
|
10
|
+
ConnectionId as __ConnectionId,
|
|
11
|
+
Identity as __Identity,
|
|
12
|
+
TimeDuration as __TimeDuration,
|
|
13
|
+
Timestamp as __Timestamp,
|
|
14
|
+
deepEqual as __deepEqual,
|
|
15
|
+
type AlgebraicType as __AlgebraicTypeType,
|
|
16
|
+
type AlgebraicTypeVariants as __AlgebraicTypeVariants,
|
|
17
|
+
} from '../index';
|
|
18
|
+
import { RawIndexDefV9 } from './raw_index_def_v_9_type';
|
|
19
|
+
// Mark import as potentially unused
|
|
20
|
+
declare type __keep_RawIndexDefV9 = RawIndexDefV9;
|
|
21
|
+
import { RawConstraintDefV9 } from './raw_constraint_def_v_9_type';
|
|
22
|
+
// Mark import as potentially unused
|
|
23
|
+
declare type __keep_RawConstraintDefV9 = RawConstraintDefV9;
|
|
24
|
+
import { RawSequenceDefV9 } from './raw_sequence_def_v_9_type';
|
|
25
|
+
// Mark import as potentially unused
|
|
26
|
+
declare type __keep_RawSequenceDefV9 = RawSequenceDefV9;
|
|
27
|
+
import { RawScheduleDefV9 } from './raw_schedule_def_v_9_type';
|
|
28
|
+
// Mark import as potentially unused
|
|
29
|
+
declare type __keep_RawScheduleDefV9 = RawScheduleDefV9;
|
|
30
|
+
import { TableType } from './table_type_type';
|
|
31
|
+
// Mark import as potentially unused
|
|
32
|
+
declare type __keep_TableType = TableType;
|
|
33
|
+
import { TableAccess } from './table_access_type';
|
|
34
|
+
// Mark import as potentially unused
|
|
35
|
+
declare type __keep_TableAccess = TableAccess;
|
|
36
|
+
|
|
37
|
+
export type RawTableDefV9 = {
|
|
38
|
+
name: string;
|
|
39
|
+
productTypeRef: number;
|
|
40
|
+
primaryKey: number[];
|
|
41
|
+
indexes: RawIndexDefV9[];
|
|
42
|
+
constraints: RawConstraintDefV9[];
|
|
43
|
+
sequences: RawSequenceDefV9[];
|
|
44
|
+
schedule: RawScheduleDefV9 | undefined;
|
|
45
|
+
tableType: TableType;
|
|
46
|
+
tableAccess: TableAccess;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* An object for generated helper functions.
|
|
50
|
+
*/
|
|
51
|
+
export const RawTableDefV9 = {
|
|
52
|
+
/**
|
|
53
|
+
* A function which returns this type represented as an AlgebraicType.
|
|
54
|
+
* This function is derived from the AlgebraicType used to generate this type.
|
|
55
|
+
*/
|
|
56
|
+
getTypeScriptAlgebraicType(): __AlgebraicTypeType {
|
|
57
|
+
return __AlgebraicTypeValue.Product({
|
|
58
|
+
elements: [
|
|
59
|
+
{ name: 'name', algebraicType: __AlgebraicTypeValue.String },
|
|
60
|
+
{ name: 'productTypeRef', algebraicType: __AlgebraicTypeValue.U32 },
|
|
61
|
+
{
|
|
62
|
+
name: 'primaryKey',
|
|
63
|
+
algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U16),
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'indexes',
|
|
67
|
+
algebraicType: __AlgebraicTypeValue.Array(
|
|
68
|
+
RawIndexDefV9.getTypeScriptAlgebraicType()
|
|
69
|
+
),
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'constraints',
|
|
73
|
+
algebraicType: __AlgebraicTypeValue.Array(
|
|
74
|
+
RawConstraintDefV9.getTypeScriptAlgebraicType()
|
|
75
|
+
),
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'sequences',
|
|
79
|
+
algebraicType: __AlgebraicTypeValue.Array(
|
|
80
|
+
RawSequenceDefV9.getTypeScriptAlgebraicType()
|
|
81
|
+
),
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'schedule',
|
|
85
|
+
algebraicType: __AlgebraicTypeValue.createOptionType(
|
|
86
|
+
RawScheduleDefV9.getTypeScriptAlgebraicType()
|
|
87
|
+
),
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'tableType',
|
|
91
|
+
algebraicType: TableType.getTypeScriptAlgebraicType(),
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'tableAccess',
|
|
95
|
+
algebraicType: TableAccess.getTypeScriptAlgebraicType(),
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
});
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
serialize(writer: __BinaryWriter, value: RawTableDefV9): void {
|
|
102
|
+
__AlgebraicTypeValue.serializeValue(
|
|
103
|
+
writer,
|
|
104
|
+
RawTableDefV9.getTypeScriptAlgebraicType(),
|
|
105
|
+
value
|
|
106
|
+
);
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
deserialize(reader: __BinaryReader): RawTableDefV9 {
|
|
110
|
+
return __AlgebraicTypeValue.deserializeValue(
|
|
111
|
+
reader,
|
|
112
|
+
RawTableDefV9.getTypeScriptAlgebraicType()
|
|
113
|
+
);
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export default RawTableDefV9;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
|
2
|
+
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
|
3
|
+
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/* tslint:disable */
|
|
6
|
+
import {
|
|
7
|
+
AlgebraicType as __AlgebraicTypeValue,
|
|
8
|
+
BinaryReader as __BinaryReader,
|
|
9
|
+
BinaryWriter as __BinaryWriter,
|
|
10
|
+
ConnectionId as __ConnectionId,
|
|
11
|
+
Identity as __Identity,
|
|
12
|
+
TimeDuration as __TimeDuration,
|
|
13
|
+
Timestamp as __Timestamp,
|
|
14
|
+
deepEqual as __deepEqual,
|
|
15
|
+
type AlgebraicType as __AlgebraicTypeType,
|
|
16
|
+
type AlgebraicTypeVariants as __AlgebraicTypeVariants,
|
|
17
|
+
} from '../index';
|
|
18
|
+
import { RawScopedTypeNameV9 } from './raw_scoped_type_name_v_9_type';
|
|
19
|
+
// Mark import as potentially unused
|
|
20
|
+
declare type __keep_RawScopedTypeNameV9 = RawScopedTypeNameV9;
|
|
21
|
+
|
|
22
|
+
export type RawTypeDefV9 = {
|
|
23
|
+
name: RawScopedTypeNameV9;
|
|
24
|
+
ty: number;
|
|
25
|
+
customOrdering: boolean;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* An object for generated helper functions.
|
|
29
|
+
*/
|
|
30
|
+
export const RawTypeDefV9 = {
|
|
31
|
+
/**
|
|
32
|
+
* A function which returns this type represented as an AlgebraicType.
|
|
33
|
+
* This function is derived from the AlgebraicType used to generate this type.
|
|
34
|
+
*/
|
|
35
|
+
getTypeScriptAlgebraicType(): __AlgebraicTypeType {
|
|
36
|
+
return __AlgebraicTypeValue.Product({
|
|
37
|
+
elements: [
|
|
38
|
+
{
|
|
39
|
+
name: 'name',
|
|
40
|
+
algebraicType: RawScopedTypeNameV9.getTypeScriptAlgebraicType(),
|
|
41
|
+
},
|
|
42
|
+
{ name: 'ty', algebraicType: __AlgebraicTypeValue.U32 },
|
|
43
|
+
{ name: 'customOrdering', algebraicType: __AlgebraicTypeValue.Bool },
|
|
44
|
+
],
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
serialize(writer: __BinaryWriter, value: RawTypeDefV9): void {
|
|
49
|
+
__AlgebraicTypeValue.serializeValue(
|
|
50
|
+
writer,
|
|
51
|
+
RawTypeDefV9.getTypeScriptAlgebraicType(),
|
|
52
|
+
value
|
|
53
|
+
);
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
deserialize(reader: __BinaryReader): RawTypeDefV9 {
|
|
57
|
+
return __AlgebraicTypeValue.deserializeValue(
|
|
58
|
+
reader,
|
|
59
|
+
RawTypeDefV9.getTypeScriptAlgebraicType()
|
|
60
|
+
);
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default RawTypeDefV9;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
|
2
|
+
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
|
3
|
+
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/* tslint:disable */
|
|
6
|
+
import {
|
|
7
|
+
AlgebraicType as __AlgebraicTypeValue,
|
|
8
|
+
BinaryReader as __BinaryReader,
|
|
9
|
+
BinaryWriter as __BinaryWriter,
|
|
10
|
+
ConnectionId as __ConnectionId,
|
|
11
|
+
Identity as __Identity,
|
|
12
|
+
TimeDuration as __TimeDuration,
|
|
13
|
+
Timestamp as __Timestamp,
|
|
14
|
+
deepEqual as __deepEqual,
|
|
15
|
+
type AlgebraicType as __AlgebraicTypeType,
|
|
16
|
+
type AlgebraicTypeVariants as __AlgebraicTypeVariants,
|
|
17
|
+
} from '../index';
|
|
18
|
+
|
|
19
|
+
export type RawUniqueConstraintDataV9 = {
|
|
20
|
+
columns: number[];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* An object for generated helper functions.
|
|
24
|
+
*/
|
|
25
|
+
export const RawUniqueConstraintDataV9 = {
|
|
26
|
+
/**
|
|
27
|
+
* A function which returns this type represented as an AlgebraicType.
|
|
28
|
+
* This function is derived from the AlgebraicType used to generate this type.
|
|
29
|
+
*/
|
|
30
|
+
getTypeScriptAlgebraicType(): __AlgebraicTypeType {
|
|
31
|
+
return __AlgebraicTypeValue.Product({
|
|
32
|
+
elements: [
|
|
33
|
+
{
|
|
34
|
+
name: 'columns',
|
|
35
|
+
algebraicType: __AlgebraicTypeValue.Array(__AlgebraicTypeValue.U16),
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
serialize(writer: __BinaryWriter, value: RawUniqueConstraintDataV9): void {
|
|
42
|
+
__AlgebraicTypeValue.serializeValue(
|
|
43
|
+
writer,
|
|
44
|
+
RawUniqueConstraintDataV9.getTypeScriptAlgebraicType(),
|
|
45
|
+
value
|
|
46
|
+
);
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
deserialize(reader: __BinaryReader): RawUniqueConstraintDataV9 {
|
|
50
|
+
return __AlgebraicTypeValue.deserializeValue(
|
|
51
|
+
reader,
|
|
52
|
+
RawUniqueConstraintDataV9.getTypeScriptAlgebraicType()
|
|
53
|
+
);
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export default RawUniqueConstraintDataV9;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
|
2
|
+
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
|
3
|
+
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/* tslint:disable */
|
|
6
|
+
import {
|
|
7
|
+
AlgebraicType as __AlgebraicTypeValue,
|
|
8
|
+
BinaryReader as __BinaryReader,
|
|
9
|
+
BinaryWriter as __BinaryWriter,
|
|
10
|
+
ConnectionId as __ConnectionId,
|
|
11
|
+
Identity as __Identity,
|
|
12
|
+
TimeDuration as __TimeDuration,
|
|
13
|
+
Timestamp as __Timestamp,
|
|
14
|
+
deepEqual as __deepEqual,
|
|
15
|
+
type AlgebraicType as __AlgebraicTypeType,
|
|
16
|
+
type AlgebraicTypeVariants as __AlgebraicTypeVariants,
|
|
17
|
+
} from '../index';
|
|
18
|
+
import { ProductTypeElement } from './product_type_element_type';
|
|
19
|
+
// Mark import as potentially unused
|
|
20
|
+
declare type __keep_ProductTypeElement = ProductTypeElement;
|
|
21
|
+
|
|
22
|
+
export type ReducerDef = {
|
|
23
|
+
name: string;
|
|
24
|
+
args: ProductTypeElement[];
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* An object for generated helper functions.
|
|
28
|
+
*/
|
|
29
|
+
export const ReducerDef = {
|
|
30
|
+
/**
|
|
31
|
+
* A function which returns this type represented as an AlgebraicType.
|
|
32
|
+
* This function is derived from the AlgebraicType used to generate this type.
|
|
33
|
+
*/
|
|
34
|
+
getTypeScriptAlgebraicType(): __AlgebraicTypeType {
|
|
35
|
+
return __AlgebraicTypeValue.Product({
|
|
36
|
+
elements: [
|
|
37
|
+
{ name: 'name', algebraicType: __AlgebraicTypeValue.String },
|
|
38
|
+
{
|
|
39
|
+
name: 'args',
|
|
40
|
+
algebraicType: __AlgebraicTypeValue.Array(
|
|
41
|
+
ProductTypeElement.getTypeScriptAlgebraicType()
|
|
42
|
+
),
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
serialize(writer: __BinaryWriter, value: ReducerDef): void {
|
|
49
|
+
__AlgebraicTypeValue.serializeValue(
|
|
50
|
+
writer,
|
|
51
|
+
ReducerDef.getTypeScriptAlgebraicType(),
|
|
52
|
+
value
|
|
53
|
+
);
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
deserialize(reader: __BinaryReader): ReducerDef {
|
|
57
|
+
return __AlgebraicTypeValue.deserializeValue(
|
|
58
|
+
reader,
|
|
59
|
+
ReducerDef.getTypeScriptAlgebraicType()
|
|
60
|
+
);
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default ReducerDef;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
|
2
|
+
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
|
3
|
+
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/* tslint:disable */
|
|
6
|
+
import {
|
|
7
|
+
AlgebraicType as __AlgebraicTypeValue,
|
|
8
|
+
BinaryReader as __BinaryReader,
|
|
9
|
+
BinaryWriter as __BinaryWriter,
|
|
10
|
+
ConnectionId as __ConnectionId,
|
|
11
|
+
Identity as __Identity,
|
|
12
|
+
TimeDuration as __TimeDuration,
|
|
13
|
+
Timestamp as __Timestamp,
|
|
14
|
+
deepEqual as __deepEqual,
|
|
15
|
+
type AlgebraicType as __AlgebraicTypeType,
|
|
16
|
+
type AlgebraicTypeVariants as __AlgebraicTypeVariants,
|
|
17
|
+
} from '../index';
|
|
18
|
+
import { SumTypeVariant } from './sum_type_variant_type';
|
|
19
|
+
// Mark import as potentially unused
|
|
20
|
+
declare type __keep_SumTypeVariant = SumTypeVariant;
|
|
21
|
+
|
|
22
|
+
export type SumType = {
|
|
23
|
+
variants: SumTypeVariant[];
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* An object for generated helper functions.
|
|
27
|
+
*/
|
|
28
|
+
export const SumType = {
|
|
29
|
+
/**
|
|
30
|
+
* A function which returns this type represented as an AlgebraicType.
|
|
31
|
+
* This function is derived from the AlgebraicType used to generate this type.
|
|
32
|
+
*/
|
|
33
|
+
getTypeScriptAlgebraicType(): __AlgebraicTypeType {
|
|
34
|
+
return __AlgebraicTypeValue.Product({
|
|
35
|
+
elements: [
|
|
36
|
+
{
|
|
37
|
+
name: 'variants',
|
|
38
|
+
algebraicType: __AlgebraicTypeValue.Array(
|
|
39
|
+
SumTypeVariant.getTypeScriptAlgebraicType()
|
|
40
|
+
),
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
serialize(writer: __BinaryWriter, value: SumType): void {
|
|
47
|
+
__AlgebraicTypeValue.serializeValue(
|
|
48
|
+
writer,
|
|
49
|
+
SumType.getTypeScriptAlgebraicType(),
|
|
50
|
+
value
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
deserialize(reader: __BinaryReader): SumType {
|
|
55
|
+
return __AlgebraicTypeValue.deserializeValue(
|
|
56
|
+
reader,
|
|
57
|
+
SumType.getTypeScriptAlgebraicType()
|
|
58
|
+
);
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default SumType;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
|
2
|
+
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
|
3
|
+
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/* tslint:disable */
|
|
6
|
+
import {
|
|
7
|
+
AlgebraicType as __AlgebraicTypeValue,
|
|
8
|
+
BinaryReader as __BinaryReader,
|
|
9
|
+
BinaryWriter as __BinaryWriter,
|
|
10
|
+
ConnectionId as __ConnectionId,
|
|
11
|
+
Identity as __Identity,
|
|
12
|
+
TimeDuration as __TimeDuration,
|
|
13
|
+
Timestamp as __Timestamp,
|
|
14
|
+
deepEqual as __deepEqual,
|
|
15
|
+
type AlgebraicType as __AlgebraicTypeType,
|
|
16
|
+
type AlgebraicTypeVariants as __AlgebraicTypeVariants,
|
|
17
|
+
} from '../index';
|
|
18
|
+
import { AlgebraicType } from './algebraic_type_type';
|
|
19
|
+
// Mark import as potentially unused
|
|
20
|
+
declare type __keep_AlgebraicType = AlgebraicType;
|
|
21
|
+
|
|
22
|
+
export type SumTypeVariant = {
|
|
23
|
+
name: string | undefined;
|
|
24
|
+
algebraicType: AlgebraicType;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* An object for generated helper functions.
|
|
28
|
+
*/
|
|
29
|
+
export const SumTypeVariant = {
|
|
30
|
+
/**
|
|
31
|
+
* A function which returns this type represented as an AlgebraicType.
|
|
32
|
+
* This function is derived from the AlgebraicType used to generate this type.
|
|
33
|
+
*/
|
|
34
|
+
getTypeScriptAlgebraicType(): __AlgebraicTypeType {
|
|
35
|
+
return __AlgebraicTypeValue.Product({
|
|
36
|
+
elements: [
|
|
37
|
+
{
|
|
38
|
+
name: 'name',
|
|
39
|
+
algebraicType: __AlgebraicTypeValue.createOptionType(
|
|
40
|
+
__AlgebraicTypeValue.String
|
|
41
|
+
),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'algebraicType',
|
|
45
|
+
algebraicType: AlgebraicType.getTypeScriptAlgebraicType(),
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
serialize(writer: __BinaryWriter, value: SumTypeVariant): void {
|
|
52
|
+
__AlgebraicTypeValue.serializeValue(
|
|
53
|
+
writer,
|
|
54
|
+
SumTypeVariant.getTypeScriptAlgebraicType(),
|
|
55
|
+
value
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
deserialize(reader: __BinaryReader): SumTypeVariant {
|
|
60
|
+
return __AlgebraicTypeValue.deserializeValue(
|
|
61
|
+
reader,
|
|
62
|
+
SumTypeVariant.getTypeScriptAlgebraicType()
|
|
63
|
+
);
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default SumTypeVariant;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
|
2
|
+
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
|
3
|
+
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/* tslint:disable */
|
|
6
|
+
import {
|
|
7
|
+
AlgebraicType as __AlgebraicTypeValue,
|
|
8
|
+
BinaryReader as __BinaryReader,
|
|
9
|
+
BinaryWriter as __BinaryWriter,
|
|
10
|
+
ConnectionId as __ConnectionId,
|
|
11
|
+
Identity as __Identity,
|
|
12
|
+
TimeDuration as __TimeDuration,
|
|
13
|
+
Timestamp as __Timestamp,
|
|
14
|
+
deepEqual as __deepEqual,
|
|
15
|
+
type AlgebraicType as __AlgebraicTypeType,
|
|
16
|
+
type AlgebraicTypeVariants as __AlgebraicTypeVariants,
|
|
17
|
+
} from '../index';
|
|
18
|
+
import * as TableAccessVariants from './table_access_variants';
|
|
19
|
+
|
|
20
|
+
// The tagged union or sum type for the algebraic type `TableAccess`.
|
|
21
|
+
export type TableAccess =
|
|
22
|
+
| TableAccessVariants.Public
|
|
23
|
+
| TableAccessVariants.Private;
|
|
24
|
+
|
|
25
|
+
// A value with helper functions to construct the type.
|
|
26
|
+
export const TableAccess = {
|
|
27
|
+
// Helper functions for constructing each variant of the tagged union.
|
|
28
|
+
// ```
|
|
29
|
+
// const foo = Foo.A(42);
|
|
30
|
+
// assert!(foo.tag === "A");
|
|
31
|
+
// assert!(foo.value === 42);
|
|
32
|
+
// ```
|
|
33
|
+
Public: { tag: 'Public' } as const,
|
|
34
|
+
Private: { tag: 'Private' } as const,
|
|
35
|
+
|
|
36
|
+
getTypeScriptAlgebraicType(): __AlgebraicTypeType {
|
|
37
|
+
return __AlgebraicTypeValue.Sum({
|
|
38
|
+
variants: [
|
|
39
|
+
{
|
|
40
|
+
name: 'Public',
|
|
41
|
+
algebraicType: __AlgebraicTypeValue.Product({ elements: [] }),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'Private',
|
|
45
|
+
algebraicType: __AlgebraicTypeValue.Product({ elements: [] }),
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
serialize(writer: __BinaryWriter, value: TableAccess): void {
|
|
52
|
+
__AlgebraicTypeValue.serializeValue(
|
|
53
|
+
writer,
|
|
54
|
+
TableAccess.getTypeScriptAlgebraicType(),
|
|
55
|
+
value
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
deserialize(reader: __BinaryReader): TableAccess {
|
|
60
|
+
return __AlgebraicTypeValue.deserializeValue(
|
|
61
|
+
reader,
|
|
62
|
+
TableAccess.getTypeScriptAlgebraicType()
|
|
63
|
+
);
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default TableAccess;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
|
2
|
+
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
|
3
|
+
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/* tslint:disable */
|
|
6
|
+
import {
|
|
7
|
+
AlgebraicType as __AlgebraicTypeValue,
|
|
8
|
+
BinaryReader as __BinaryReader,
|
|
9
|
+
BinaryWriter as __BinaryWriter,
|
|
10
|
+
ConnectionId as __ConnectionId,
|
|
11
|
+
Identity as __Identity,
|
|
12
|
+
TimeDuration as __TimeDuration,
|
|
13
|
+
Timestamp as __Timestamp,
|
|
14
|
+
deepEqual as __deepEqual,
|
|
15
|
+
type AlgebraicType as __AlgebraicTypeType,
|
|
16
|
+
type AlgebraicTypeVariants as __AlgebraicTypeVariants,
|
|
17
|
+
} from '../index';
|
|
18
|
+
|
|
19
|
+
export type Public = { tag: 'Public' };
|
|
20
|
+
export type Private = { tag: 'Private' };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
|
2
|
+
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
|
3
|
+
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/* tslint:disable */
|
|
6
|
+
import {
|
|
7
|
+
AlgebraicType as __AlgebraicTypeValue,
|
|
8
|
+
BinaryReader as __BinaryReader,
|
|
9
|
+
BinaryWriter as __BinaryWriter,
|
|
10
|
+
ConnectionId as __ConnectionId,
|
|
11
|
+
Identity as __Identity,
|
|
12
|
+
TimeDuration as __TimeDuration,
|
|
13
|
+
Timestamp as __Timestamp,
|
|
14
|
+
deepEqual as __deepEqual,
|
|
15
|
+
type AlgebraicType as __AlgebraicTypeType,
|
|
16
|
+
type AlgebraicTypeVariants as __AlgebraicTypeVariants,
|
|
17
|
+
} from '../index';
|
|
18
|
+
import { RawTableDefV8 } from './raw_table_def_v_8_type';
|
|
19
|
+
// Mark import as potentially unused
|
|
20
|
+
declare type __keep_RawTableDefV8 = RawTableDefV8;
|
|
21
|
+
|
|
22
|
+
export type TableDesc = {
|
|
23
|
+
schema: RawTableDefV8;
|
|
24
|
+
data: number;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* An object for generated helper functions.
|
|
28
|
+
*/
|
|
29
|
+
export const TableDesc = {
|
|
30
|
+
/**
|
|
31
|
+
* A function which returns this type represented as an AlgebraicType.
|
|
32
|
+
* This function is derived from the AlgebraicType used to generate this type.
|
|
33
|
+
*/
|
|
34
|
+
getTypeScriptAlgebraicType(): __AlgebraicTypeType {
|
|
35
|
+
return __AlgebraicTypeValue.Product({
|
|
36
|
+
elements: [
|
|
37
|
+
{
|
|
38
|
+
name: 'schema',
|
|
39
|
+
algebraicType: RawTableDefV8.getTypeScriptAlgebraicType(),
|
|
40
|
+
},
|
|
41
|
+
{ name: 'data', algebraicType: __AlgebraicTypeValue.U32 },
|
|
42
|
+
],
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
serialize(writer: __BinaryWriter, value: TableDesc): void {
|
|
47
|
+
__AlgebraicTypeValue.serializeValue(
|
|
48
|
+
writer,
|
|
49
|
+
TableDesc.getTypeScriptAlgebraicType(),
|
|
50
|
+
value
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
deserialize(reader: __BinaryReader): TableDesc {
|
|
55
|
+
return __AlgebraicTypeValue.deserializeValue(
|
|
56
|
+
reader,
|
|
57
|
+
TableDesc.getTypeScriptAlgebraicType()
|
|
58
|
+
);
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default TableDesc;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
|
2
|
+
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
|
3
|
+
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/* tslint:disable */
|
|
6
|
+
import {
|
|
7
|
+
AlgebraicType as __AlgebraicTypeValue,
|
|
8
|
+
BinaryReader as __BinaryReader,
|
|
9
|
+
BinaryWriter as __BinaryWriter,
|
|
10
|
+
ConnectionId as __ConnectionId,
|
|
11
|
+
Identity as __Identity,
|
|
12
|
+
TimeDuration as __TimeDuration,
|
|
13
|
+
Timestamp as __Timestamp,
|
|
14
|
+
deepEqual as __deepEqual,
|
|
15
|
+
type AlgebraicType as __AlgebraicTypeType,
|
|
16
|
+
type AlgebraicTypeVariants as __AlgebraicTypeVariants,
|
|
17
|
+
} from '../index';
|
|
18
|
+
import * as TableTypeVariants from './table_type_variants';
|
|
19
|
+
|
|
20
|
+
// The tagged union or sum type for the algebraic type `TableType`.
|
|
21
|
+
export type TableType = TableTypeVariants.System | TableTypeVariants.User;
|
|
22
|
+
|
|
23
|
+
// A value with helper functions to construct the type.
|
|
24
|
+
export const TableType = {
|
|
25
|
+
// Helper functions for constructing each variant of the tagged union.
|
|
26
|
+
// ```
|
|
27
|
+
// const foo = Foo.A(42);
|
|
28
|
+
// assert!(foo.tag === "A");
|
|
29
|
+
// assert!(foo.value === 42);
|
|
30
|
+
// ```
|
|
31
|
+
System: { tag: 'System' } as const,
|
|
32
|
+
User: { tag: 'User' } as const,
|
|
33
|
+
|
|
34
|
+
getTypeScriptAlgebraicType(): __AlgebraicTypeType {
|
|
35
|
+
return __AlgebraicTypeValue.Sum({
|
|
36
|
+
variants: [
|
|
37
|
+
{
|
|
38
|
+
name: 'System',
|
|
39
|
+
algebraicType: __AlgebraicTypeValue.Product({ elements: [] }),
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'User',
|
|
43
|
+
algebraicType: __AlgebraicTypeValue.Product({ elements: [] }),
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
serialize(writer: __BinaryWriter, value: TableType): void {
|
|
50
|
+
__AlgebraicTypeValue.serializeValue(
|
|
51
|
+
writer,
|
|
52
|
+
TableType.getTypeScriptAlgebraicType(),
|
|
53
|
+
value
|
|
54
|
+
);
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
deserialize(reader: __BinaryReader): TableType {
|
|
58
|
+
return __AlgebraicTypeValue.deserializeValue(
|
|
59
|
+
reader,
|
|
60
|
+
TableType.getTypeScriptAlgebraicType()
|
|
61
|
+
);
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default TableType;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
|
2
|
+
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
|
3
|
+
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/* tslint:disable */
|
|
6
|
+
import {
|
|
7
|
+
AlgebraicType as __AlgebraicTypeValue,
|
|
8
|
+
BinaryReader as __BinaryReader,
|
|
9
|
+
BinaryWriter as __BinaryWriter,
|
|
10
|
+
ConnectionId as __ConnectionId,
|
|
11
|
+
Identity as __Identity,
|
|
12
|
+
TimeDuration as __TimeDuration,
|
|
13
|
+
Timestamp as __Timestamp,
|
|
14
|
+
deepEqual as __deepEqual,
|
|
15
|
+
type AlgebraicType as __AlgebraicTypeType,
|
|
16
|
+
type AlgebraicTypeVariants as __AlgebraicTypeVariants,
|
|
17
|
+
} from '../index';
|
|
18
|
+
|
|
19
|
+
export type System = { tag: 'System' };
|
|
20
|
+
export type User = { tag: 'User' };
|