tinybase 4.4.0-beta.2 → 4.4.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/lib/cjs/persisters/persister-partykit-server.cjs +1 -1
- package/lib/cjs/persisters/persister-partykit-server.cjs.gz +0 -0
- package/lib/cjs/tools.cjs +1 -1
- package/lib/cjs/tools.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-partykit-server.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-partykit-server.cjs.gz +0 -0
- package/lib/cjs-es6/tools.cjs +1 -1
- package/lib/cjs-es6/tools.cjs.gz +0 -0
- package/lib/debug/persisters/persister-partykit-server.js +35 -21
- package/lib/debug/tools.js +355 -14
- package/lib/es6/persisters/persister-partykit-server.js +1 -1
- package/lib/es6/persisters/persister-partykit-server.js.gz +0 -0
- package/lib/es6/tools.js +1 -1
- package/lib/es6/tools.js.gz +0 -0
- package/lib/persisters/persister-partykit-server.js +1 -1
- package/lib/persisters/persister-partykit-server.js.gz +0 -0
- package/lib/tools.js +1 -1
- package/lib/tools.js.gz +0 -0
- package/lib/types/persisters/persister-partykit-server.d.ts +58 -2
- package/lib/types/persisters/persister-remote.d.ts +6 -1
- package/lib/types/tools.d.ts +2 -2
- package/lib/types/with-schemas/persisters/persister-partykit-server.d.ts +61 -0
- package/lib/types/with-schemas/persisters/persister-remote.d.ts +6 -1
- package/lib/types/with-schemas/tools.d.ts +2 -2
- package/lib/umd/persisters/persister-partykit-server.js +1 -1
- package/lib/umd/persisters/persister-partykit-server.js.gz +0 -0
- package/lib/umd/tools.js +1 -1
- package/lib/umd/tools.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-partykit-server.js +1 -1
- package/lib/umd-es6/persisters/persister-partykit-server.js.gz +0 -0
- package/lib/umd-es6/tools.js +1 -1
- package/lib/umd-es6/tools.js.gz +0 -0
- package/package.json +1 -1
- package/readme.md +13 -13
package/lib/debug/tools.js
CHANGED
|
@@ -10,6 +10,7 @@ const DEFAULT = 'default';
|
|
|
10
10
|
const LISTENER = 'Listener';
|
|
11
11
|
const GET = 'get';
|
|
12
12
|
const ADD = 'add';
|
|
13
|
+
const HAS = 'Has';
|
|
13
14
|
const IDS = 'Ids';
|
|
14
15
|
const TABLE = 'Table';
|
|
15
16
|
const TABLES = TABLE + 's';
|
|
@@ -98,6 +99,7 @@ const A_FUNCTION_FOR = 'A function for';
|
|
|
98
99
|
const AND_REGISTERS =
|
|
99
100
|
', and registers a listener so that any changes to that result will cause a re-render';
|
|
100
101
|
const CALLBACK = 'Callback';
|
|
102
|
+
const COUNT = 'Count';
|
|
101
103
|
const DEL = 'Del';
|
|
102
104
|
const DEPS = 'Deps';
|
|
103
105
|
const DEPS_SUFFIX = DEPS + '?: React.DependencyList';
|
|
@@ -140,12 +142,15 @@ const SPACE = ' ';
|
|
|
140
142
|
const GETS_A_CALLBACK_THAT_CAN = 'Gets a callback that can ';
|
|
141
143
|
const THE = 'the ';
|
|
142
144
|
const THE_SCHEMA_FOR = ' the schema for';
|
|
143
|
-
const
|
|
145
|
+
const getHasDoc = (has = 0) => (has ? 'the existence of ' : '');
|
|
146
|
+
const getTheContentOfDoc = (content = 0, theStore = 0, has = 0) =>
|
|
147
|
+
getHasDoc(has) +
|
|
144
148
|
`the ${CONTENT[content]}content of` +
|
|
145
149
|
(theStore ? SPACE + THE_STORE : EMPTY_STRING);
|
|
146
|
-
const getTheContentOfTheStoreDoc = (content = 0, verb, set = 0) =>
|
|
150
|
+
const getTheContentOfTheStoreDoc = (content = 0, verb, set = 0, has = 0) =>
|
|
147
151
|
VERBS[verb] +
|
|
148
152
|
SPACE +
|
|
153
|
+
getHasDoc(has) +
|
|
149
154
|
getTheContentOfDoc(content, 1) +
|
|
150
155
|
(set ? ' when setting it' : EMPTY_STRING);
|
|
151
156
|
const getRowTypeDoc = (tableId, set = 0) =>
|
|
@@ -162,15 +167,17 @@ const getForEachDoc = (childNoun, parentNoun) =>
|
|
|
162
167
|
const getPropsDoc = (childNoun) =>
|
|
163
168
|
'The props passed to a component that renders ' + childNoun;
|
|
164
169
|
const getCallbackDoc = (takes) => 'A function that takes ' + takes;
|
|
165
|
-
const getListenerTypeDoc = (childNoun, parentNoun = 0) =>
|
|
170
|
+
const getListenerTypeDoc = (childNoun, parentNoun = 0, has = 0) =>
|
|
166
171
|
A_FUNCTION_FOR +
|
|
167
172
|
' listening to changes to ' +
|
|
173
|
+
getHasDoc(has) +
|
|
168
174
|
NOUNS[childNoun] +
|
|
169
175
|
' in ' +
|
|
170
176
|
NOUNS[parentNoun];
|
|
171
|
-
const getListenerDoc = (childNoun, parentNoun, pluralChild = 0) =>
|
|
177
|
+
const getListenerDoc = (childNoun, parentNoun, pluralChild = 0, has = 0) =>
|
|
172
178
|
REGISTERS_A_LISTENER +
|
|
173
179
|
' whenever ' +
|
|
180
|
+
getHasDoc(has) +
|
|
174
181
|
NOUNS[childNoun] +
|
|
175
182
|
' in ' +
|
|
176
183
|
NOUNS[parentNoun] +
|
|
@@ -178,14 +185,22 @@ const getListenerDoc = (childNoun, parentNoun, pluralChild = 0) =>
|
|
|
178
185
|
(pluralChild ? EMPTY_STRING : 's');
|
|
179
186
|
const getTableDoc = (tableId) => `the '${tableId}' ` + TABLE;
|
|
180
187
|
const getRowDoc = (tableId) => 'the specified Row in ' + getTableDoc(tableId);
|
|
181
|
-
const getTableContentDoc = (tableId, verb = 0) =>
|
|
182
|
-
VERBS[verb] +
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
const
|
|
188
|
-
VERBS[verb] + `
|
|
188
|
+
const getTableContentDoc = (tableId, verb = 0, has = 0) =>
|
|
189
|
+
VERBS[verb] +
|
|
190
|
+
SPACE +
|
|
191
|
+
getTheContentOfDoc(0, 0, has) +
|
|
192
|
+
SPACE +
|
|
193
|
+
getTableDoc(tableId);
|
|
194
|
+
const getRowContentDoc = (tableId, verb = 0, has = 0) =>
|
|
195
|
+
VERBS[verb] + ` ${getTheContentOfDoc(0, 0, has)} ` + getRowDoc(tableId);
|
|
196
|
+
const getCellContentDoc = (tableId, cellId, verb = 0, has = 0) =>
|
|
197
|
+
VERBS[verb] +
|
|
198
|
+
SPACE +
|
|
199
|
+
getHasDoc(has) +
|
|
200
|
+
`the '${cellId}' Cell for ` +
|
|
201
|
+
getRowDoc(tableId);
|
|
202
|
+
const getValueContentDoc = (valueId, verb = 0, has = 0) =>
|
|
203
|
+
VERBS[verb] + SPACE + getHasDoc(has) + `the '${valueId}' Value`;
|
|
189
204
|
const VERBS = [
|
|
190
205
|
'Gets',
|
|
191
206
|
'Checks existence of',
|
|
@@ -233,6 +248,7 @@ const NOUNS = [
|
|
|
233
248
|
THE + 'sorted ' + ROW + SPACE + IDS,
|
|
234
249
|
THE + CELL + SPACE + IDS + ' anywhere',
|
|
235
250
|
THE + 'number of Rows',
|
|
251
|
+
A + CELL + ' anywhere',
|
|
236
252
|
];
|
|
237
253
|
const CONTENT = [EMPTY_STRING, 'tabular ', 'keyed value '];
|
|
238
254
|
|
|
@@ -564,6 +580,11 @@ const getTypeFunctions = (
|
|
|
564
580
|
` returning information about any Cell's changes during a ` +
|
|
565
581
|
TRANSACTION_,
|
|
566
582
|
);
|
|
583
|
+
const hasTablesListenerType = addType(
|
|
584
|
+
HAS + TABLES + LISTENER,
|
|
585
|
+
`(${storeParam}, hasTables: boolean)` + RETURNS_VOID,
|
|
586
|
+
getListenerTypeDoc(1, 0, 1),
|
|
587
|
+
);
|
|
567
588
|
const tablesListenerType = addType(
|
|
568
589
|
TABLES + LISTENER,
|
|
569
590
|
`(${storeParam}, getCellChange: ${getCellChangeType}${OR_UNDEFINED})` +
|
|
@@ -575,6 +596,12 @@ const getTypeFunctions = (
|
|
|
575
596
|
`(${storeParam})` + RETURNS_VOID,
|
|
576
597
|
getListenerTypeDoc(2),
|
|
577
598
|
);
|
|
599
|
+
const hasTableListenerType = addType(
|
|
600
|
+
HAS + TABLE + LISTENER,
|
|
601
|
+
`(${storeParam}, tableId: ${tableIdType}, hasTable: boolean)` +
|
|
602
|
+
RETURNS_VOID,
|
|
603
|
+
getListenerTypeDoc(3, 0, 1),
|
|
604
|
+
);
|
|
578
605
|
const tableListenerType = addType(
|
|
579
606
|
TABLE + LISTENER,
|
|
580
607
|
`(${storeParam}, tableId: ${tableIdType}, getCellChange: ${getCellChangeType}${OR_UNDEFINED})` +
|
|
@@ -586,6 +613,30 @@ const getTypeFunctions = (
|
|
|
586
613
|
`(${storeParam}, tableId: ${tableIdType})` + RETURNS_VOID,
|
|
587
614
|
getListenerTypeDoc(14, 3),
|
|
588
615
|
);
|
|
616
|
+
const hasTableCellListenerArgsArrayInnerType = addType(
|
|
617
|
+
'HasTableCellListenerArgsArrayInner',
|
|
618
|
+
`CId extends ${cellIdType}<TId> ? [${storeParam}, tableId: TId, cellId: CId, hasTableCell: boolean] : never`,
|
|
619
|
+
'Cell args for HasTableCellListener',
|
|
620
|
+
`<TId extends ${tableIdType}, CId = ${cellIdType}<TId>>`,
|
|
621
|
+
0,
|
|
622
|
+
);
|
|
623
|
+
const hasTableCellListenerArgsArrayOuterType = addType(
|
|
624
|
+
'HasTableCellListenerArgsArrayOuter',
|
|
625
|
+
`TId extends ${tableIdType} ? ` +
|
|
626
|
+
hasTableCellListenerArgsArrayInnerType +
|
|
627
|
+
'<TId> : never',
|
|
628
|
+
'Table args for HasTableCellListener',
|
|
629
|
+
`<TId = ${tableIdType}>`,
|
|
630
|
+
0,
|
|
631
|
+
);
|
|
632
|
+
const hasTableCellListenerType = addType(
|
|
633
|
+
HAS + TABLE + CELL + LISTENER,
|
|
634
|
+
`(...[${storeInstance}, tableId, cellId, hasTableCell]: ` +
|
|
635
|
+
hasTableCellListenerArgsArrayOuterType +
|
|
636
|
+
')' +
|
|
637
|
+
RETURNS_VOID,
|
|
638
|
+
getListenerTypeDoc(16, 3, 1),
|
|
639
|
+
);
|
|
589
640
|
const rowCountListenerType = addType(
|
|
590
641
|
ROW + 'Count' + LISTENER,
|
|
591
642
|
`(${storeParam}, tableId: ${tableIdType})` + RETURNS_VOID,
|
|
@@ -612,6 +663,19 @@ const getTypeFunctions = (
|
|
|
612
663
|
RETURNS_VOID,
|
|
613
664
|
getListenerTypeDoc(13, 3),
|
|
614
665
|
);
|
|
666
|
+
const hasRowListenerType = addType(
|
|
667
|
+
HAS + ROW + LISTENER,
|
|
668
|
+
'(' +
|
|
669
|
+
getParameterList(
|
|
670
|
+
`${storeParam}`,
|
|
671
|
+
'tableId: ' + tableIdType,
|
|
672
|
+
ROW_ID_PARAM,
|
|
673
|
+
`hasRow: boolean`,
|
|
674
|
+
) +
|
|
675
|
+
')' +
|
|
676
|
+
RETURNS_VOID,
|
|
677
|
+
getListenerTypeDoc(5, 3, 1),
|
|
678
|
+
);
|
|
615
679
|
const rowListenerType = addType(
|
|
616
680
|
ROW + LISTENER,
|
|
617
681
|
'(' +
|
|
@@ -637,6 +701,30 @@ const getTypeFunctions = (
|
|
|
637
701
|
RETURNS_VOID,
|
|
638
702
|
getListenerTypeDoc(6, 5),
|
|
639
703
|
);
|
|
704
|
+
const hasCellListenerArgsArrayInnerType = addType(
|
|
705
|
+
'HasCellListenerArgsArrayInner',
|
|
706
|
+
`CId extends ${cellIdType}<TId> ? [${storeParam}, tableId: TId, ${ROW_ID_PARAM}, cellId: CId, hasCell: boolean] : never`,
|
|
707
|
+
'Cell args for HasCellListener',
|
|
708
|
+
`<TId extends ${tableIdType}, CId = ${cellIdType}<TId>>`,
|
|
709
|
+
0,
|
|
710
|
+
);
|
|
711
|
+
const hasCellListenerArgsArrayOuterType = addType(
|
|
712
|
+
'HasCellListenerArgsArrayOuter',
|
|
713
|
+
`TId extends ${tableIdType} ? ` +
|
|
714
|
+
hasCellListenerArgsArrayInnerType +
|
|
715
|
+
'<TId> : never',
|
|
716
|
+
'Table args for HasCellListener',
|
|
717
|
+
`<TId = ${tableIdType}>`,
|
|
718
|
+
0,
|
|
719
|
+
);
|
|
720
|
+
const hasCellListenerType = addType(
|
|
721
|
+
HAS + CELL + LISTENER,
|
|
722
|
+
`(...[${storeInstance}, tableId, rowId, cellId, hasCell]: ` +
|
|
723
|
+
hasCellListenerArgsArrayOuterType +
|
|
724
|
+
')' +
|
|
725
|
+
RETURNS_VOID,
|
|
726
|
+
getListenerTypeDoc(7, 5, 1),
|
|
727
|
+
);
|
|
640
728
|
const cellListenerArgsArrayInnerType = addType(
|
|
641
729
|
'CellListenerArgsArrayInner',
|
|
642
730
|
`CId extends ${cellIdType}<TId> ? [${storeParam}, tableId: TId, ${ROW_ID_PARAM}, cellId: CId, newCell: ${cellType}<TId, CId> ${OR_UNDEFINED}, oldCell: ${cellType}<TId, CId> ${OR_UNDEFINED}, getCellChange: ${getCellChangeType} ${OR_UNDEFINED}] : never`,
|
|
@@ -679,15 +767,20 @@ const getTypeFunctions = (
|
|
|
679
767
|
rowCallbackType,
|
|
680
768
|
tableCellCallbackType,
|
|
681
769
|
tableCallbackType,
|
|
770
|
+
hasTablesListenerType,
|
|
682
771
|
tablesListenerType,
|
|
683
772
|
tableIdsListenerType,
|
|
773
|
+
hasTableListenerType,
|
|
684
774
|
tableListenerType,
|
|
685
775
|
tableCellIdsListenerType,
|
|
776
|
+
hasTableCellListenerType,
|
|
686
777
|
rowCountListenerType,
|
|
687
778
|
rowIdsListenerType,
|
|
688
779
|
sortedRowIdsListenerType,
|
|
780
|
+
hasRowListenerType,
|
|
689
781
|
rowListenerType,
|
|
690
782
|
cellIdsListenerType,
|
|
783
|
+
hasCellListenerType,
|
|
691
784
|
cellListenerType,
|
|
692
785
|
invalidCellListenerType,
|
|
693
786
|
];
|
|
@@ -743,6 +836,11 @@ const getTypeFunctions = (
|
|
|
743
836
|
` returning information about any Value's changes during a ` +
|
|
744
837
|
TRANSACTION_,
|
|
745
838
|
);
|
|
839
|
+
const hasValuesListenerType = addType(
|
|
840
|
+
HAS + VALUES + LISTENER,
|
|
841
|
+
`(${storeParam}, hasValues: boolean)` + RETURNS_VOID,
|
|
842
|
+
getListenerTypeDoc(9, 0, 1),
|
|
843
|
+
);
|
|
746
844
|
const valuesListenerType = addType(
|
|
747
845
|
VALUES + LISTENER,
|
|
748
846
|
`(${storeParam}, getValueChange: ${getValueChangeType}${OR_UNDEFINED})` +
|
|
@@ -754,6 +852,11 @@ const getTypeFunctions = (
|
|
|
754
852
|
`(${storeParam})` + RETURNS_VOID,
|
|
755
853
|
getListenerTypeDoc(10),
|
|
756
854
|
);
|
|
855
|
+
const hasValueListenerType = addType(
|
|
856
|
+
HAS + VALUE + LISTENER,
|
|
857
|
+
`(${storeParam}, valueId: ValueId, hasValue: boolean)` + RETURNS_VOID,
|
|
858
|
+
getListenerTypeDoc(11, 0, 1),
|
|
859
|
+
);
|
|
757
860
|
const valueListenerArgsArrayType = addType(
|
|
758
861
|
'ValueListenerArgsArray',
|
|
759
862
|
`VId extends ${valueIdType} ? [${storeParam}, valueId: VId, newValue: ${valueType}<VId> ${OR_UNDEFINED}, oldValue: ${valueType}<VId> ${OR_UNDEFINED}, getValueChange: ${getValueChangeType} ${OR_UNDEFINED}] : never`,
|
|
@@ -780,8 +883,10 @@ const getTypeFunctions = (
|
|
|
780
883
|
valueIdType,
|
|
781
884
|
valueType,
|
|
782
885
|
valueCallbackType,
|
|
886
|
+
hasValuesListenerType,
|
|
783
887
|
valuesListenerType,
|
|
784
888
|
valueIdsListenerType,
|
|
889
|
+
hasValueListenerType,
|
|
785
890
|
valueListenerType,
|
|
786
891
|
invalidValueListenerType,
|
|
787
892
|
];
|
|
@@ -928,15 +1033,20 @@ const getStoreCoreApi = (tablesSchema, valuesSchema, module) => {
|
|
|
928
1033
|
rowCallbackType,
|
|
929
1034
|
tableCellCallbackType,
|
|
930
1035
|
tableCallbackType,
|
|
1036
|
+
hasTablesListenerType,
|
|
931
1037
|
tablesListenerType,
|
|
932
1038
|
tableIdsListenerType,
|
|
1039
|
+
hasTableListenerType,
|
|
933
1040
|
tableListenerType,
|
|
934
1041
|
tableCellIdsListenerType,
|
|
1042
|
+
hasTableCellListenerType,
|
|
935
1043
|
rowCountListenerType,
|
|
936
1044
|
rowIdsListenerType,
|
|
937
1045
|
sortedRowIdsListenerType,
|
|
1046
|
+
hasRowListenerType,
|
|
938
1047
|
rowListenerType,
|
|
939
1048
|
cellIdsListenerType,
|
|
1049
|
+
hasCellListenerType,
|
|
940
1050
|
cellListenerType,
|
|
941
1051
|
invalidCellListenerType,
|
|
942
1052
|
] = getTablesTypes(storeInstance, storeType);
|
|
@@ -1010,15 +1120,20 @@ const getStoreCoreApi = (tablesSchema, valuesSchema, module) => {
|
|
|
1010
1120
|
tableIdType,
|
|
1011
1121
|
cellIdType,
|
|
1012
1122
|
tableCallbackType,
|
|
1123
|
+
hasTablesListenerType,
|
|
1013
1124
|
tablesListenerType,
|
|
1014
1125
|
tableIdsListenerType,
|
|
1126
|
+
hasTableListenerType,
|
|
1015
1127
|
tableListenerType,
|
|
1016
1128
|
tableCellIdsListenerType,
|
|
1129
|
+
hasTableCellListenerType,
|
|
1017
1130
|
rowCountListenerType,
|
|
1018
1131
|
rowIdsListenerType,
|
|
1019
1132
|
sortedRowIdsListenerType,
|
|
1133
|
+
hasRowListenerType,
|
|
1020
1134
|
rowListenerType,
|
|
1021
1135
|
cellIdsListenerType,
|
|
1136
|
+
hasCellListenerType,
|
|
1022
1137
|
cellListenerType,
|
|
1023
1138
|
invalidCellListenerType,
|
|
1024
1139
|
);
|
|
@@ -1027,15 +1142,20 @@ const getStoreCoreApi = (tablesSchema, valuesSchema, module) => {
|
|
|
1027
1142
|
tablesWhenSetType,
|
|
1028
1143
|
tableIdType,
|
|
1029
1144
|
cellIdType,
|
|
1145
|
+
hasTablesListenerType,
|
|
1030
1146
|
tablesListenerType,
|
|
1031
1147
|
tableIdsListenerType,
|
|
1148
|
+
hasTableListenerType,
|
|
1032
1149
|
tableListenerType,
|
|
1033
1150
|
tableCellIdsListenerType,
|
|
1151
|
+
hasTableCellListenerType,
|
|
1034
1152
|
rowCountListenerType,
|
|
1035
1153
|
rowIdsListenerType,
|
|
1036
1154
|
sortedRowIdsListenerType,
|
|
1155
|
+
hasRowListenerType,
|
|
1037
1156
|
rowListenerType,
|
|
1038
1157
|
cellIdsListenerType,
|
|
1158
|
+
hasCellListenerType,
|
|
1039
1159
|
cellListenerType,
|
|
1040
1160
|
tablesTypes,
|
|
1041
1161
|
];
|
|
@@ -1123,7 +1243,7 @@ const getStoreCoreApi = (tablesSchema, valuesSchema, module) => {
|
|
|
1123
1243
|
addProxyMethod(
|
|
1124
1244
|
0,
|
|
1125
1245
|
tableName,
|
|
1126
|
-
ROW +
|
|
1246
|
+
ROW + COUNT,
|
|
1127
1247
|
'number',
|
|
1128
1248
|
'Gets the number of Rows in the ' + getTableDoc(tableId),
|
|
1129
1249
|
EMPTY_STRING,
|
|
@@ -1263,12 +1383,24 @@ const getStoreCoreApi = (tablesSchema, valuesSchema, module) => {
|
|
|
1263
1383
|
'tablesJson: ' + JSON$1,
|
|
1264
1384
|
'tables' + JSON$1,
|
|
1265
1385
|
);
|
|
1386
|
+
addProxyListener(
|
|
1387
|
+
HAS + TABLES,
|
|
1388
|
+
hasTablesListenerType,
|
|
1389
|
+
getTheContentOfTheStoreDoc(1, 8, 0, 1) + ' changes',
|
|
1390
|
+
);
|
|
1266
1391
|
addProxyListener(
|
|
1267
1392
|
TABLES,
|
|
1268
1393
|
tablesListenerType,
|
|
1269
1394
|
getTheContentOfTheStoreDoc(1, 8) + ' changes',
|
|
1270
1395
|
);
|
|
1271
1396
|
addProxyListener(TABLE_IDS, tableIdsListenerType, getListenerDoc(2, 0, 1));
|
|
1397
|
+
addProxyListener(
|
|
1398
|
+
HAS + TABLE,
|
|
1399
|
+
hasTableListenerType,
|
|
1400
|
+
getListenerDoc(3, 0, 0, 1),
|
|
1401
|
+
`tableId: ${tableIdType} | null`,
|
|
1402
|
+
'tableId',
|
|
1403
|
+
);
|
|
1272
1404
|
addProxyListener(
|
|
1273
1405
|
TABLE,
|
|
1274
1406
|
tableListenerType,
|
|
@@ -1284,7 +1416,19 @@ const getStoreCoreApi = (tablesSchema, valuesSchema, module) => {
|
|
|
1284
1416
|
'tableId',
|
|
1285
1417
|
);
|
|
1286
1418
|
addProxyListener(
|
|
1287
|
-
|
|
1419
|
+
HAS + TABLE + CELL,
|
|
1420
|
+
hasTableCellListenerType,
|
|
1421
|
+
getListenerDoc(16, 3, 0, 1),
|
|
1422
|
+
`tableId: ${tableIdType} | null, cellId: ${arrayJoin(
|
|
1423
|
+
mapTablesSchema(
|
|
1424
|
+
(tableId) => mapGet(tablesTypes, tableId)?.[4] ?? EMPTY_STRING,
|
|
1425
|
+
),
|
|
1426
|
+
' | ',
|
|
1427
|
+
)} | null`,
|
|
1428
|
+
'tableId, cellId',
|
|
1429
|
+
);
|
|
1430
|
+
addProxyListener(
|
|
1431
|
+
ROW + COUNT,
|
|
1288
1432
|
rowCountListenerType,
|
|
1289
1433
|
getListenerDoc(15, 3),
|
|
1290
1434
|
`tableId: ${tableIdType} | null`,
|
|
@@ -1312,6 +1456,13 @@ const getStoreCoreApi = (tablesSchema, valuesSchema, module) => {
|
|
|
1312
1456
|
1,
|
|
1313
1457
|
'<TId extends TableId>',
|
|
1314
1458
|
);
|
|
1459
|
+
addProxyListener(
|
|
1460
|
+
HAS + ROW,
|
|
1461
|
+
hasRowListenerType,
|
|
1462
|
+
getListenerDoc(5, 3, 0, 1),
|
|
1463
|
+
`tableId: ${tableIdType} | null, rowId: IdOrNull`,
|
|
1464
|
+
'tableId, rowId',
|
|
1465
|
+
);
|
|
1315
1466
|
addProxyListener(
|
|
1316
1467
|
ROW,
|
|
1317
1468
|
rowListenerType,
|
|
@@ -1326,6 +1477,18 @@ const getStoreCoreApi = (tablesSchema, valuesSchema, module) => {
|
|
|
1326
1477
|
`tableId: ${tableIdType} | null, rowId: IdOrNull`,
|
|
1327
1478
|
'tableId, rowId',
|
|
1328
1479
|
);
|
|
1480
|
+
addProxyListener(
|
|
1481
|
+
HAS + CELL,
|
|
1482
|
+
hasCellListenerType,
|
|
1483
|
+
getListenerDoc(7, 5, 0, 1),
|
|
1484
|
+
`tableId: ${tableIdType} | null, rowId: IdOrNull, cellId: ${arrayJoin(
|
|
1485
|
+
mapTablesSchema(
|
|
1486
|
+
(tableId) => mapGet(tablesTypes, tableId)?.[4] ?? EMPTY_STRING,
|
|
1487
|
+
),
|
|
1488
|
+
' | ',
|
|
1489
|
+
)} | null`,
|
|
1490
|
+
'tableId, rowId, cellId',
|
|
1491
|
+
);
|
|
1329
1492
|
addProxyListener(
|
|
1330
1493
|
CELL,
|
|
1331
1494
|
cellListenerType,
|
|
@@ -1382,8 +1545,10 @@ const getStoreCoreApi = (tablesSchema, valuesSchema, module) => {
|
|
|
1382
1545
|
valueIdType,
|
|
1383
1546
|
_valueType,
|
|
1384
1547
|
valueCallbackType,
|
|
1548
|
+
hasValuesListenerType,
|
|
1385
1549
|
valuesListenerType,
|
|
1386
1550
|
valueIdsListenerType,
|
|
1551
|
+
hasValueListenerType,
|
|
1387
1552
|
valueListenerType,
|
|
1388
1553
|
invalidValueListenerType,
|
|
1389
1554
|
] = getValuesTypes(storeInstance, storeType);
|
|
@@ -1394,8 +1559,10 @@ const getStoreCoreApi = (tablesSchema, valuesSchema, module) => {
|
|
|
1394
1559
|
valuesWhenSetType,
|
|
1395
1560
|
valueIdType,
|
|
1396
1561
|
valueCallbackType,
|
|
1562
|
+
hasValuesListenerType,
|
|
1397
1563
|
valuesListenerType,
|
|
1398
1564
|
valueIdsListenerType,
|
|
1565
|
+
hasValueListenerType,
|
|
1399
1566
|
valueListenerType,
|
|
1400
1567
|
invalidValueListenerType,
|
|
1401
1568
|
);
|
|
@@ -1403,8 +1570,10 @@ const getStoreCoreApi = (tablesSchema, valuesSchema, module) => {
|
|
|
1403
1570
|
valuesType,
|
|
1404
1571
|
valuesWhenSetType,
|
|
1405
1572
|
valueIdType,
|
|
1573
|
+
hasValuesListenerType,
|
|
1406
1574
|
valuesListenerType,
|
|
1407
1575
|
valueIdsListenerType,
|
|
1576
|
+
hasValueListenerType,
|
|
1408
1577
|
valueListenerType,
|
|
1409
1578
|
];
|
|
1410
1579
|
arrayForEach(
|
|
@@ -1480,12 +1649,24 @@ const getStoreCoreApi = (tablesSchema, valuesSchema, module) => {
|
|
|
1480
1649
|
'valuesJson: ' + JSON$1,
|
|
1481
1650
|
'values' + JSON$1,
|
|
1482
1651
|
);
|
|
1652
|
+
addProxyListener(
|
|
1653
|
+
HAS + VALUES,
|
|
1654
|
+
hasValuesListenerType,
|
|
1655
|
+
getTheContentOfTheStoreDoc(2, 8, 0, 1) + ' changes',
|
|
1656
|
+
);
|
|
1483
1657
|
addProxyListener(
|
|
1484
1658
|
VALUES,
|
|
1485
1659
|
valuesListenerType,
|
|
1486
1660
|
getTheContentOfTheStoreDoc(2, 8) + ' changes',
|
|
1487
1661
|
);
|
|
1488
1662
|
addProxyListener(VALUE_IDS, valueIdsListenerType, getListenerDoc(10, 0, 1));
|
|
1663
|
+
addProxyListener(
|
|
1664
|
+
HAS + VALUE,
|
|
1665
|
+
hasValueListenerType,
|
|
1666
|
+
getListenerDoc(11, 0, 0, 1),
|
|
1667
|
+
`valueId: ${valueIdType} | null`,
|
|
1668
|
+
'valueId',
|
|
1669
|
+
);
|
|
1489
1670
|
addProxyListener(
|
|
1490
1671
|
VALUE,
|
|
1491
1672
|
valueListenerType,
|
|
@@ -1958,15 +2139,20 @@ const getStoreUiReactApi = (
|
|
|
1958
2139
|
tablesWhenSetType,
|
|
1959
2140
|
tableIdType,
|
|
1960
2141
|
cellIdType,
|
|
2142
|
+
hasTablesListenerType,
|
|
1961
2143
|
tablesListenerType,
|
|
1962
2144
|
tableIdsListenerType,
|
|
2145
|
+
hasTableListenerType,
|
|
1963
2146
|
tableListenerType,
|
|
1964
2147
|
tableCellIdsListenerType,
|
|
2148
|
+
hasTableCellListenerType,
|
|
1965
2149
|
rowCountListenerType,
|
|
1966
2150
|
rowIdsListenerType,
|
|
1967
2151
|
sortedRowIdsListenerType,
|
|
2152
|
+
hasRowListenerType,
|
|
1968
2153
|
rowListenerType,
|
|
1969
2154
|
cellIdsListenerType,
|
|
2155
|
+
hasCellListenerType,
|
|
1970
2156
|
cellListenerType,
|
|
1971
2157
|
tablesTypes,
|
|
1972
2158
|
] = sharedTableTypes;
|
|
@@ -1976,16 +2162,21 @@ const getStoreUiReactApi = (
|
|
|
1976
2162
|
tablesType,
|
|
1977
2163
|
tablesWhenSetType,
|
|
1978
2164
|
tableIdType,
|
|
2165
|
+
hasTablesListenerType,
|
|
1979
2166
|
tablesListenerType,
|
|
1980
2167
|
tableIdsListenerType,
|
|
2168
|
+
hasTableListenerType,
|
|
1981
2169
|
tableListenerType,
|
|
1982
2170
|
tableCellIdsListenerType,
|
|
2171
|
+
hasTableCellListenerType,
|
|
1983
2172
|
rowCountListenerType,
|
|
1984
2173
|
rowIdsListenerType,
|
|
1985
2174
|
sortedRowIdsListenerType,
|
|
2175
|
+
hasRowListenerType,
|
|
1986
2176
|
rowListenerType,
|
|
1987
2177
|
cellIdsListenerType,
|
|
1988
2178
|
cellListenerType,
|
|
2179
|
+
hasCellListenerType,
|
|
1989
2180
|
);
|
|
1990
2181
|
addImport(0, moduleDefinition, cellIdType);
|
|
1991
2182
|
addImport(1, moduleDefinition, storeType);
|
|
@@ -2044,6 +2235,12 @@ const getStoreUiReactApi = (
|
|
|
2044
2235
|
),
|
|
2045
2236
|
) + NullComponent,
|
|
2046
2237
|
);
|
|
2238
|
+
addProxyHook(
|
|
2239
|
+
HAS + TABLES,
|
|
2240
|
+
HAS + TABLES,
|
|
2241
|
+
BOOLEAN,
|
|
2242
|
+
getTheContentOfTheStoreDoc(1, 0, 0, 1) + AND_REGISTERS,
|
|
2243
|
+
);
|
|
2047
2244
|
addProxyHook(
|
|
2048
2245
|
TABLES,
|
|
2049
2246
|
TABLES,
|
|
@@ -2209,6 +2406,14 @@ const getStoreUiReactApi = (
|
|
|
2209
2406
|
rowWhenSetType,
|
|
2210
2407
|
cellIdType2,
|
|
2211
2408
|
);
|
|
2409
|
+
addProxyHook(
|
|
2410
|
+
HAS + tableName + TABLE,
|
|
2411
|
+
HAS + TABLE,
|
|
2412
|
+
BOOLEAN,
|
|
2413
|
+
getTableContentDoc(tableId, 0, 1) + AND_REGISTERS,
|
|
2414
|
+
EMPTY_STRING,
|
|
2415
|
+
TABLE_ID,
|
|
2416
|
+
);
|
|
2212
2417
|
addProxyHook(
|
|
2213
2418
|
tableName + TABLE,
|
|
2214
2419
|
TABLE,
|
|
@@ -2225,6 +2430,14 @@ const getStoreUiReactApi = (
|
|
|
2225
2430
|
EMPTY_STRING,
|
|
2226
2431
|
TABLE_ID,
|
|
2227
2432
|
);
|
|
2433
|
+
addProxyHook(
|
|
2434
|
+
tableName + ROW + COUNT,
|
|
2435
|
+
ROW + COUNT,
|
|
2436
|
+
NUMBER,
|
|
2437
|
+
'Gets the number of Rows in ' + getTableDoc(tableId) + AND_REGISTERS,
|
|
2438
|
+
EMPTY_STRING,
|
|
2439
|
+
TABLE_ID,
|
|
2440
|
+
);
|
|
2228
2441
|
const useRowIds = addProxyHook(
|
|
2229
2442
|
tableName + ROW_IDS,
|
|
2230
2443
|
ROW_IDS,
|
|
@@ -2243,6 +2456,14 @@ const getStoreUiReactApi = (
|
|
|
2243
2456
|
', descending?: boolean, offset?: number, limit?: number',
|
|
2244
2457
|
TABLE_ID + ', cellId, descending, offset, limit',
|
|
2245
2458
|
);
|
|
2459
|
+
addProxyHook(
|
|
2460
|
+
HAS + tableName + ROW,
|
|
2461
|
+
HAS + ROW,
|
|
2462
|
+
BOOLEAN,
|
|
2463
|
+
getRowContentDoc(tableId, 0, 1) + AND_REGISTERS,
|
|
2464
|
+
TYPED_ROW_ID,
|
|
2465
|
+
getParameterList(TABLE_ID, ROW_ID),
|
|
2466
|
+
);
|
|
2246
2467
|
addProxyHook(
|
|
2247
2468
|
tableName + ROW,
|
|
2248
2469
|
ROW,
|
|
@@ -2414,6 +2635,24 @@ const getStoreUiReactApi = (
|
|
|
2414
2635
|
const mapCellType = 'Map' + camel(type, 1);
|
|
2415
2636
|
addImport(0, moduleDefinition, mapCellType);
|
|
2416
2637
|
addImport(1, moduleDefinition, mapCellType);
|
|
2638
|
+
addProxyHook(
|
|
2639
|
+
HAS + tableName + cellName + TABLE + CELL,
|
|
2640
|
+
HAS + TABLE + CELL,
|
|
2641
|
+
BOOLEAN,
|
|
2642
|
+
`Gets ${getHasDoc(1)}the '${cellId}' Cell anywhere in ` +
|
|
2643
|
+
getTableDoc(tableId) +
|
|
2644
|
+
AND_REGISTERS,
|
|
2645
|
+
EMPTY_STRING,
|
|
2646
|
+
getParameterList(TABLE_ID, CELL_ID),
|
|
2647
|
+
);
|
|
2648
|
+
addProxyHook(
|
|
2649
|
+
HAS + tableName + cellName + CELL,
|
|
2650
|
+
HAS + CELL,
|
|
2651
|
+
BOOLEAN,
|
|
2652
|
+
getCellContentDoc(tableId, cellId, 0, 1) + AND_REGISTERS,
|
|
2653
|
+
TYPED_ROW_ID,
|
|
2654
|
+
getParameterList(TABLE_ID, ROW_ID, CELL_ID),
|
|
2655
|
+
);
|
|
2417
2656
|
const useCell = addProxyHook(
|
|
2418
2657
|
tableName + cellName + CELL,
|
|
2419
2658
|
CELL,
|
|
@@ -2474,6 +2713,14 @@ const getStoreUiReactApi = (
|
|
|
2474
2713
|
),
|
|
2475
2714
|
' | ',
|
|
2476
2715
|
);
|
|
2716
|
+
addProxyHook(
|
|
2717
|
+
HAS + TABLES + LISTENER,
|
|
2718
|
+
HAS + TABLES + LISTENER,
|
|
2719
|
+
VOID,
|
|
2720
|
+
getTheContentOfTheStoreDoc(1, 8, 0, 1) + ' changes',
|
|
2721
|
+
getListenerHookParams(hasTablesListenerType),
|
|
2722
|
+
getListenerHookParamsInCall(),
|
|
2723
|
+
);
|
|
2477
2724
|
addProxyHook(
|
|
2478
2725
|
TABLES + LISTENER,
|
|
2479
2726
|
TABLES + LISTENER,
|
|
@@ -2490,6 +2737,17 @@ const getStoreUiReactApi = (
|
|
|
2490
2737
|
getListenerHookParams(tableIdsListenerType),
|
|
2491
2738
|
getListenerHookParamsInCall(),
|
|
2492
2739
|
);
|
|
2740
|
+
addProxyHook(
|
|
2741
|
+
HAS + TABLE + LISTENER,
|
|
2742
|
+
HAS + TABLE + LISTENER,
|
|
2743
|
+
VOID,
|
|
2744
|
+
getListenerDoc(3, 0, 0, 1),
|
|
2745
|
+
getListenerHookParams(
|
|
2746
|
+
hasTableListenerType,
|
|
2747
|
+
`tableId: ${tableIdType} | null`,
|
|
2748
|
+
),
|
|
2749
|
+
getListenerHookParamsInCall('tableId'),
|
|
2750
|
+
);
|
|
2493
2751
|
addProxyHook(
|
|
2494
2752
|
TABLE + LISTENER,
|
|
2495
2753
|
TABLE + LISTENER,
|
|
@@ -2512,6 +2770,29 @@ const getStoreUiReactApi = (
|
|
|
2512
2770
|
),
|
|
2513
2771
|
getListenerHookParamsInCall('tableId'),
|
|
2514
2772
|
);
|
|
2773
|
+
addProxyHook(
|
|
2774
|
+
HAS + TABLE + CELL + LISTENER,
|
|
2775
|
+
HAS + TABLE + CELL + LISTENER,
|
|
2776
|
+
VOID,
|
|
2777
|
+
getListenerDoc(16, 3, 0, 1),
|
|
2778
|
+
getListenerHookParams(
|
|
2779
|
+
hasTableCellListenerType,
|
|
2780
|
+
`tableId: ${tableIdType} | null`,
|
|
2781
|
+
`cellId: ${cellIdsType} | null`,
|
|
2782
|
+
),
|
|
2783
|
+
getListenerHookParamsInCall('tableId', 'cellId'),
|
|
2784
|
+
);
|
|
2785
|
+
addProxyHook(
|
|
2786
|
+
ROW + COUNT + LISTENER,
|
|
2787
|
+
ROW + COUNT + LISTENER,
|
|
2788
|
+
VOID,
|
|
2789
|
+
getListenerDoc(15, 3),
|
|
2790
|
+
getListenerHookParams(
|
|
2791
|
+
rowCountListenerType,
|
|
2792
|
+
`tableId: ${tableIdType} | null`,
|
|
2793
|
+
),
|
|
2794
|
+
getListenerHookParamsInCall('tableId'),
|
|
2795
|
+
);
|
|
2515
2796
|
addProxyHook(
|
|
2516
2797
|
ROW_IDS + LISTENER,
|
|
2517
2798
|
ROW_IDS + LISTENER,
|
|
@@ -2544,6 +2825,18 @@ const getStoreUiReactApi = (
|
|
|
2544
2825
|
'limit',
|
|
2545
2826
|
),
|
|
2546
2827
|
);
|
|
2828
|
+
addProxyHook(
|
|
2829
|
+
HAS + ROW + LISTENER,
|
|
2830
|
+
HAS + ROW + LISTENER,
|
|
2831
|
+
VOID,
|
|
2832
|
+
getListenerDoc(5, 3, 0, 1),
|
|
2833
|
+
getListenerHookParams(
|
|
2834
|
+
hasRowListenerType,
|
|
2835
|
+
`tableId: ${tableIdType} | null`,
|
|
2836
|
+
ROW_ID + `: IdOrNull`,
|
|
2837
|
+
),
|
|
2838
|
+
getListenerHookParamsInCall('tableId', ROW_ID),
|
|
2839
|
+
);
|
|
2547
2840
|
addProxyHook(
|
|
2548
2841
|
ROW + LISTENER,
|
|
2549
2842
|
ROW + LISTENER,
|
|
@@ -2568,6 +2861,19 @@ const getStoreUiReactApi = (
|
|
|
2568
2861
|
),
|
|
2569
2862
|
getListenerHookParamsInCall('tableId', ROW_ID),
|
|
2570
2863
|
);
|
|
2864
|
+
addProxyHook(
|
|
2865
|
+
HAS + CELL + LISTENER,
|
|
2866
|
+
HAS + CELL + LISTENER,
|
|
2867
|
+
VOID,
|
|
2868
|
+
getListenerDoc(7, 5, 0, 1),
|
|
2869
|
+
getListenerHookParams(
|
|
2870
|
+
hasCellListenerType,
|
|
2871
|
+
`tableId: ${tableIdType} | null`,
|
|
2872
|
+
ROW_ID + `: IdOrNull`,
|
|
2873
|
+
`cellId: ${cellIdsType} | null`,
|
|
2874
|
+
),
|
|
2875
|
+
getListenerHookParamsInCall('tableId', ROW_ID, 'cellId'),
|
|
2876
|
+
);
|
|
2571
2877
|
addProxyHook(
|
|
2572
2878
|
CELL + LISTENER,
|
|
2573
2879
|
CELL + LISTENER,
|
|
@@ -2587,8 +2893,10 @@ const getStoreUiReactApi = (
|
|
|
2587
2893
|
valuesType,
|
|
2588
2894
|
valuesWhenSetType,
|
|
2589
2895
|
valueIdType,
|
|
2896
|
+
hasValuesListenerType,
|
|
2590
2897
|
valuesListenerType,
|
|
2591
2898
|
valueIdsListenerType,
|
|
2899
|
+
hasValueListenerType,
|
|
2592
2900
|
valueListenerType,
|
|
2593
2901
|
] = sharedValueTypes;
|
|
2594
2902
|
addImport(null, moduleDefinition, ...sharedValueTypes);
|
|
@@ -2603,6 +2911,12 @@ const getStoreUiReactApi = (
|
|
|
2603
2911
|
),
|
|
2604
2912
|
) + NullComponent,
|
|
2605
2913
|
);
|
|
2914
|
+
addProxyHook(
|
|
2915
|
+
HAS + VALUES,
|
|
2916
|
+
HAS + VALUES,
|
|
2917
|
+
BOOLEAN,
|
|
2918
|
+
getTheContentOfTheStoreDoc(2, 0, 0, 1) + AND_REGISTERS,
|
|
2919
|
+
);
|
|
2606
2920
|
addProxyHook(
|
|
2607
2921
|
VALUES,
|
|
2608
2922
|
VALUES,
|
|
@@ -2713,6 +3027,14 @@ const getStoreUiReactApi = (
|
|
|
2713
3027
|
const mapValueType = 'Map' + camel(type, 1);
|
|
2714
3028
|
addImport(0, moduleDefinition, mapValueType);
|
|
2715
3029
|
addImport(1, moduleDefinition, mapValueType);
|
|
3030
|
+
addProxyHook(
|
|
3031
|
+
HAS + valueName + VALUE,
|
|
3032
|
+
HAS + VALUE,
|
|
3033
|
+
BOOLEAN,
|
|
3034
|
+
getValueContentDoc(valueId, 0, 1) + AND_REGISTERS,
|
|
3035
|
+
EMPTY_STRING,
|
|
3036
|
+
VALUE_ID,
|
|
3037
|
+
);
|
|
2716
3038
|
const useValue = addProxyHook(
|
|
2717
3039
|
valueName + VALUE,
|
|
2718
3040
|
VALUE,
|
|
@@ -2762,6 +3084,14 @@ const getStoreUiReactApi = (
|
|
|
2762
3084
|
getValueContentDoc(valueId, 13) + AND_REGISTERS,
|
|
2763
3085
|
);
|
|
2764
3086
|
});
|
|
3087
|
+
addProxyHook(
|
|
3088
|
+
HAS + VALUES + LISTENER,
|
|
3089
|
+
HAS + VALUES + LISTENER,
|
|
3090
|
+
VOID,
|
|
3091
|
+
getTheContentOfTheStoreDoc(2, 8, 0, 1) + ' changes',
|
|
3092
|
+
getListenerHookParams(hasValuesListenerType),
|
|
3093
|
+
getListenerHookParamsInCall(),
|
|
3094
|
+
);
|
|
2765
3095
|
addProxyHook(
|
|
2766
3096
|
VALUES + LISTENER,
|
|
2767
3097
|
VALUES + LISTENER,
|
|
@@ -2778,6 +3108,17 @@ const getStoreUiReactApi = (
|
|
|
2778
3108
|
getListenerHookParams(valueIdsListenerType),
|
|
2779
3109
|
getListenerHookParamsInCall(),
|
|
2780
3110
|
);
|
|
3111
|
+
addProxyHook(
|
|
3112
|
+
HAS + VALUE + LISTENER,
|
|
3113
|
+
HAS + VALUE + LISTENER,
|
|
3114
|
+
VOID,
|
|
3115
|
+
getListenerDoc(11, 0, 0, 1),
|
|
3116
|
+
getListenerHookParams(
|
|
3117
|
+
hasValueListenerType,
|
|
3118
|
+
`valueId: ${valueIdType} | null`,
|
|
3119
|
+
),
|
|
3120
|
+
getListenerHookParamsInCall('valueId'),
|
|
3121
|
+
);
|
|
2781
3122
|
addProxyHook(
|
|
2782
3123
|
VALUE + LISTENER,
|
|
2783
3124
|
VALUE + LISTENER,
|