kea-typegen 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +72 -31
- package/dist/package.json +15 -14
- package/dist/src/__tests__/e2e/actions.js +4 -4
- package/dist/src/__tests__/e2e/actions.js.map +1 -1
- package/dist/src/__tests__/e2e/connect.js +6 -6
- package/dist/src/__tests__/e2e/connect.js.map +1 -1
- package/dist/src/__tests__/e2e/loaders.js +3 -3
- package/dist/src/__tests__/e2e/loaders.js.map +1 -1
- package/dist/src/__tests__/e2e/reducers.js +4 -4
- package/dist/src/__tests__/e2e/reducers.js.map +1 -1
- package/dist/src/__tests__/e2e/selectors.js +3 -3
- package/dist/src/__tests__/e2e/selectors.js.map +1 -1
- package/dist/src/__tests__/utils.js +7 -7
- package/dist/src/__tests__/utils.js.map +1 -1
- package/dist/src/cli/typegen.js +5 -3
- package/dist/src/cli/typegen.js.map +1 -1
- package/dist/src/print/print.d.ts +5 -5
- package/dist/src/print/print.js +55 -43
- package/dist/src/print/print.js.map +1 -1
- package/dist/src/print/printActionCreators.d.ts +1 -2
- package/dist/src/print/printActionCreators.js +7 -7
- package/dist/src/print/printActionCreators.js.map +1 -1
- package/dist/src/print/printActionKeys.d.ts +1 -2
- package/dist/src/print/printActionKeys.js +4 -4
- package/dist/src/print/printActionKeys.js.map +1 -1
- package/dist/src/print/printActionTypes.d.ts +1 -2
- package/dist/src/print/printActionTypes.js +4 -4
- package/dist/src/print/printActionTypes.js.map +1 -1
- package/dist/src/print/printActions.d.ts +1 -2
- package/dist/src/print/printActions.js +4 -4
- package/dist/src/print/printActions.js.map +1 -1
- package/dist/src/print/printConstants.d.ts +1 -2
- package/dist/src/print/printConstants.js +2 -2
- package/dist/src/print/printConstants.js.map +1 -1
- package/dist/src/print/printDefaults.d.ts +1 -2
- package/dist/src/print/printDefaults.js +3 -3
- package/dist/src/print/printDefaults.js.map +1 -1
- package/dist/src/print/printEvents.d.ts +1 -2
- package/dist/src/print/printEvents.js +3 -3
- package/dist/src/print/printEvents.js.map +1 -1
- package/dist/src/print/printInternalExtraInput.d.ts +1 -2
- package/dist/src/print/printInternalExtraInput.js +8 -8
- package/dist/src/print/printInternalExtraInput.js.map +1 -1
- package/dist/src/print/printInternalReducerActions.d.ts +1 -2
- package/dist/src/print/printInternalReducerActions.js +3 -4
- package/dist/src/print/printInternalReducerActions.js.map +1 -1
- package/dist/src/print/printInternalSelectorTypes.d.ts +1 -2
- package/dist/src/print/printInternalSelectorTypes.js +3 -3
- package/dist/src/print/printInternalSelectorTypes.js.map +1 -1
- package/dist/src/print/printKey.d.ts +1 -2
- package/dist/src/print/printKey.js +2 -2
- package/dist/src/print/printKey.js.map +1 -1
- package/dist/src/print/printListeners.d.ts +1 -2
- package/dist/src/print/printListeners.js +9 -9
- package/dist/src/print/printListeners.js.map +1 -1
- package/dist/src/print/printProps.d.ts +1 -2
- package/dist/src/print/printProps.js +6 -5
- package/dist/src/print/printProps.js.map +1 -1
- package/dist/src/print/printReducer.d.ts +1 -2
- package/dist/src/print/printReducer.js +6 -6
- package/dist/src/print/printReducer.js.map +1 -1
- package/dist/src/print/printReducerOptions.d.ts +1 -2
- package/dist/src/print/printReducerOptions.js +3 -3
- package/dist/src/print/printReducerOptions.js.map +1 -1
- package/dist/src/print/printReducers.d.ts +1 -2
- package/dist/src/print/printReducers.js +7 -7
- package/dist/src/print/printReducers.js.map +1 -1
- package/dist/src/print/printSelector.d.ts +1 -2
- package/dist/src/print/printSelector.js +4 -4
- package/dist/src/print/printSelector.js.map +1 -1
- package/dist/src/print/printSelectors.d.ts +1 -2
- package/dist/src/print/printSelectors.js +6 -6
- package/dist/src/print/printSelectors.js.map +1 -1
- package/dist/src/print/printSharedListeners.d.ts +1 -2
- package/dist/src/print/printSharedListeners.js +11 -11
- package/dist/src/print/printSharedListeners.js.map +1 -1
- package/dist/src/print/printValues.d.ts +1 -2
- package/dist/src/print/printValues.js +3 -3
- package/dist/src/print/printValues.js.map +1 -1
- package/dist/src/typegen.js +5 -5
- package/dist/src/typegen.js.map +1 -1
- package/dist/src/types.d.ts +3 -0
- package/dist/src/utils.js +15 -15
- package/dist/src/utils.js.map +1 -1
- package/dist/src/visit/__tests__/visit.js +2 -2
- package/dist/src/visit/__tests__/visit.js.map +1 -1
- package/dist/src/visit/visit.js +22 -14
- package/dist/src/visit/visit.js.map +1 -1
- package/dist/src/visit/visitActions.d.ts +2 -2
- package/dist/src/visit/visitActions.js +13 -11
- package/dist/src/visit/visitActions.js.map +1 -1
- package/dist/src/visit/visitConnect.js +4 -4
- package/dist/src/visit/visitConnect.js.map +1 -1
- package/dist/src/visit/visitDefaults.js +1 -1
- package/dist/src/visit/visitDefaults.js.map +1 -1
- package/dist/src/visit/visitKey.js +2 -2
- package/dist/src/visit/visitKey.js.map +1 -1
- package/dist/src/visit/visitListeners.js +5 -5
- package/dist/src/visit/visitListeners.js.map +1 -1
- package/dist/src/visit/visitLoaders.d.ts +2 -2
- package/dist/src/visit/visitLoaders.js +27 -27
- package/dist/src/visit/visitLoaders.js.map +1 -1
- package/dist/src/visit/visitProps.js +1 -1
- package/dist/src/visit/visitProps.js.map +1 -1
- package/dist/src/visit/visitReducers.js +4 -4
- package/dist/src/visit/visitReducers.js.map +1 -1
- package/dist/src/visit/visitSelectors.js +8 -8
- package/dist/src/visit/visitSelectors.js.map +1 -1
- package/dist/src/visit/visitSharedListeners.js +5 -5
- package/dist/src/visit/visitSharedListeners.js.map +1 -1
- package/dist/src/visit/visitWindowValues.js +1 -1
- package/dist/src/visit/visitWindowValues.js.map +1 -1
- package/dist/src/write/write.d.ts +4 -0
- package/dist/src/{import/writeLogicTypeImports.js → write/write.js} +56 -11
- package/dist/src/write/write.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/form-plugin/lib/form-plugin/src/typegen.js +16 -15
- package/form-plugin/lib/src/types.d.ts +4 -1
- package/form-plugin/package.json +1 -1
- package/form-plugin/src/typegen.ts +25 -25
- package/form-plugin/tsconfig.json +0 -1
- package/form-plugin/yarn.lock +10 -10
- package/package.json +15 -14
- package/samples/autoImportLogic.ts +9 -3
- package/samples/autoImportLogicType.ts +1 -1
- package/samples/loadersLogicType.ts +10 -10
- package/samples/logicType.ts +4 -4
- package/src/__tests__/e2e/__snapshots__/loaders.ts.snap +12 -12
- package/src/__tests__/utils.ts +5 -5
- package/src/cli/typegen.ts +2 -0
- package/src/print/print.ts +65 -36
- package/src/print/printActionCreators.ts +12 -15
- package/src/print/printActionKeys.ts +5 -6
- package/src/print/printActionTypes.ts +6 -7
- package/src/print/printActions.ts +6 -13
- package/src/print/printConstants.ts +5 -6
- package/src/print/printDefaults.ts +5 -6
- package/src/print/printEvents.ts +8 -6
- package/src/print/printInternalExtraInput.ts +12 -13
- package/src/print/printInternalReducerActions.ts +5 -12
- package/src/print/printInternalSelectorTypes.ts +7 -8
- package/src/print/printKey.ts +2 -2
- package/src/print/printListeners.ts +16 -17
- package/src/print/printProps.ts +7 -7
- package/src/print/printReducer.ts +14 -15
- package/src/print/printReducerOptions.ts +4 -5
- package/src/print/printReducers.ts +13 -14
- package/src/print/printSelector.ts +8 -9
- package/src/print/printSelectors.ts +12 -13
- package/src/print/printSharedListeners.ts +20 -21
- package/src/print/printValues.ts +5 -6
- package/src/typegen.ts +4 -4
- package/src/types.ts +4 -1
- package/src/utils.ts +14 -14
- package/src/visit/visit.ts +11 -3
- package/src/visit/visitActions.ts +12 -10
- package/src/visit/visitListeners.ts +8 -8
- package/src/visit/visitLoaders.ts +49 -43
- package/src/visit/visitReducers.ts +1 -1
- package/src/visit/visitSelectors.ts +3 -3
- package/src/visit/visitSharedListeners.ts +8 -10
- package/src/{import/writeLogicTypeImports.ts → write/write.ts} +115 -16
- package/dist/src/import/writeLogicTypeImports.d.ts +0 -3
- package/dist/src/import/writeLogicTypeImports.js.map +0 -1
package/dist/src/print/print.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.printLogicType = exports.getLogicTypeArguments = exports.parsedLogicToTypeString = exports.nodeToString = exports.printToFiles = exports.runThroughPrettier = void 0;
|
|
4
|
-
const
|
|
4
|
+
const typescript_1 = require("typescript");
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const path = require("path");
|
|
7
7
|
const prettier = require("prettier");
|
|
@@ -24,7 +24,7 @@ const printReducerOptions_1 = require("./printReducerOptions");
|
|
|
24
24
|
const printEvents_1 = require("./printEvents");
|
|
25
25
|
const printSharedListeners_1 = require("./printSharedListeners");
|
|
26
26
|
const printListeners_1 = require("./printListeners");
|
|
27
|
-
const
|
|
27
|
+
const write_1 = require("../write/write");
|
|
28
28
|
const printInternalExtraInput_1 = require("./printInternalExtraInput");
|
|
29
29
|
function runThroughPrettier(sourceText, filePath) {
|
|
30
30
|
const options = prettier.resolveConfig.sync(filePath);
|
|
@@ -55,7 +55,7 @@ function printToFiles(program, appOptions, parsedLogics) {
|
|
|
55
55
|
}
|
|
56
56
|
let writtenFiles = 0;
|
|
57
57
|
let filesToWrite = 0;
|
|
58
|
-
let
|
|
58
|
+
let filesToModify = 0;
|
|
59
59
|
Object.entries(groupedByFile).forEach(([fileName, parsedLogics]) => {
|
|
60
60
|
var _a;
|
|
61
61
|
const typeFileName = parsedLogics[0].typeFileName;
|
|
@@ -112,35 +112,47 @@ function printToFiles(program, appOptions, parsedLogics) {
|
|
|
112
112
|
log(`🤷 Unchanged: ${path.relative(process.cwd(), typeFileName)}`);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
const
|
|
115
|
+
const parsedLogicNeedsTypeImport = (pl) => (pl.logicTypeImported === false ||
|
|
116
116
|
pl.logicTypeArguments.join(', ') !== [...pl.typeReferencesInLogicInput].sort().join(', ')) &&
|
|
117
|
-
pl.fileName.match(/\.tsx?$/)
|
|
117
|
+
pl.fileName.match(/\.tsx?$/);
|
|
118
|
+
const logicsNeedingImports = parsedLogics.filter(parsedLogicNeedsTypeImport);
|
|
118
119
|
if (logicsNeedingImports.length > 0) {
|
|
119
120
|
if (appOptions.write && !appOptions.noImport) {
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
(0, write_1.writeTypeImports)(appOptions, program, fileName, logicsNeedingImports, parsedLogics);
|
|
122
|
+
filesToModify += logicsNeedingImports.length;
|
|
122
123
|
}
|
|
123
124
|
else {
|
|
124
125
|
log(`❌ Will not write ${logicsNeedingImports.length} logic type import${logicsNeedingImports.length === 1 ? '' : 's'}`);
|
|
125
126
|
}
|
|
126
127
|
}
|
|
128
|
+
const parsedLogicNeedsPath = appOptions.writePaths ? (pl) => !pl.hasPathInLogic : () => false;
|
|
129
|
+
const logicsNeedingPaths = parsedLogics.filter(parsedLogicNeedsPath);
|
|
130
|
+
if (logicsNeedingPaths.length > 0) {
|
|
131
|
+
if (appOptions.write && !appOptions.noImport) {
|
|
132
|
+
(0, write_1.writePaths)(appOptions, program, fileName, logicsNeedingPaths);
|
|
133
|
+
filesToModify += logicsNeedingPaths.length;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
log(`❌ Will not write ${logicsNeedingPaths.length} logic path${logicsNeedingPaths.length === 1 ? '' : 's'}`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
127
139
|
});
|
|
128
|
-
if (writtenFiles === 0 &&
|
|
140
|
+
if (writtenFiles === 0 && filesToModify === 0) {
|
|
129
141
|
if (appOptions.write) {
|
|
130
142
|
log(`💚 ${parsedLogics.length} logic type${parsedLogics.length === 1 ? '' : 's'} up to date!`);
|
|
131
143
|
log('');
|
|
132
144
|
}
|
|
133
|
-
else if (filesToWrite > 0 ||
|
|
134
|
-
log(`🚨 Run "kea-typegen write" to save ${filesToWrite +
|
|
145
|
+
else if (filesToWrite > 0 || filesToModify > 0) {
|
|
146
|
+
log(`🚨 Run "kea-typegen write" to save ${filesToWrite + filesToModify} file${filesToWrite === 1 ? '' : 's'} to disk`);
|
|
135
147
|
}
|
|
136
148
|
}
|
|
137
|
-
return { filesToWrite, writtenFiles,
|
|
149
|
+
return { filesToWrite, writtenFiles, filesToModify };
|
|
138
150
|
}
|
|
139
151
|
exports.printToFiles = printToFiles;
|
|
140
152
|
function nodeToString(node) {
|
|
141
|
-
const printer =
|
|
142
|
-
const sourceFile =
|
|
143
|
-
return printer.printNode(
|
|
153
|
+
const printer = (0, typescript_1.createPrinter)({ newLine: typescript_1.NewLineKind.LineFeed });
|
|
154
|
+
const sourceFile = (0, typescript_1.createSourceFile)('logic.ts', '', typescript_1.ScriptTarget.Latest, false, typescript_1.ScriptKind.TS);
|
|
155
|
+
return printer.printNode(typescript_1.EmitHint.Unspecified, node, sourceFile);
|
|
144
156
|
}
|
|
145
157
|
exports.nodeToString = nodeToString;
|
|
146
158
|
function parsedLogicToTypeString(parsedLogic, appOptions) {
|
|
@@ -151,48 +163,48 @@ exports.parsedLogicToTypeString = parsedLogicToTypeString;
|
|
|
151
163
|
function getLogicTypeArguments(parsedLogic) {
|
|
152
164
|
return [...parsedLogic.typeReferencesInLogicInput]
|
|
153
165
|
.sort()
|
|
154
|
-
.map((text) =>
|
|
166
|
+
.map((text) => typescript_1.factory.createTypeParameterDeclaration(typescript_1.factory.createIdentifier(text), undefined));
|
|
155
167
|
}
|
|
156
168
|
exports.getLogicTypeArguments = getLogicTypeArguments;
|
|
157
169
|
function printLogicType(parsedLogic, appOptions) {
|
|
158
|
-
const printProperty = (name, typeNode) =>
|
|
170
|
+
const printProperty = (name, typeNode) => typescript_1.factory.createPropertySignature(undefined, typescript_1.factory.createIdentifier(name), undefined, typeNode);
|
|
159
171
|
const addSelectorTypeHelp = parsedLogic.selectors.filter((s) => s.functionTypes.length > 0).length > 0;
|
|
160
172
|
const logicProperties = [
|
|
161
|
-
printProperty('actionCreators', printActionCreators_1.printActionCreators(parsedLogic, appOptions)),
|
|
162
|
-
printProperty('actionKeys', printActionKeys_1.printActionKeys(parsedLogic, appOptions)),
|
|
163
|
-
printProperty('actionTypes', printActionTypes_1.printActionTypes(parsedLogic, appOptions)),
|
|
164
|
-
printProperty('actions', printActions_1.printActions(parsedLogic, appOptions)),
|
|
165
|
-
printProperty('constants', printConstants_1.printConstants(parsedLogic)),
|
|
166
|
-
printProperty('defaults', printDefaults_1.printDefaults(parsedLogic)),
|
|
167
|
-
printProperty('events', printEvents_1.printEvents(parsedLogic)),
|
|
168
|
-
printProperty('key', printKey_1.printKey(parsedLogic)),
|
|
169
|
-
printProperty('listeners', printListeners_1.printListeners(parsedLogic)),
|
|
170
|
-
printProperty('path',
|
|
171
|
-
printProperty('pathString',
|
|
172
|
-
printProperty('props', printProps_1.printProps(parsedLogic)),
|
|
173
|
-
printProperty('reducer', printReducer_1.printReducer(parsedLogic)),
|
|
174
|
-
printProperty('reducerOptions', printReducerOptions_1.printReducerOptions(parsedLogic)),
|
|
175
|
-
printProperty('reducers', printReducers_1.printReducers(parsedLogic)),
|
|
176
|
-
printProperty('selector', printSelector_1.printSelector(parsedLogic)),
|
|
177
|
-
printProperty('selectors', printSelectors_1.printSelectors(parsedLogic)),
|
|
178
|
-
printProperty('sharedListeners', printSharedListeners_1.printSharedListeners(parsedLogic)),
|
|
179
|
-
printProperty('values', printValues_1.printValues(parsedLogic)),
|
|
180
|
-
printProperty('_isKea',
|
|
181
|
-
printProperty('_isKeaWithKey', parsedLogic.keyType ?
|
|
173
|
+
printProperty('actionCreators', (0, printActionCreators_1.printActionCreators)(parsedLogic, appOptions)),
|
|
174
|
+
printProperty('actionKeys', (0, printActionKeys_1.printActionKeys)(parsedLogic, appOptions)),
|
|
175
|
+
printProperty('actionTypes', (0, printActionTypes_1.printActionTypes)(parsedLogic, appOptions)),
|
|
176
|
+
printProperty('actions', (0, printActions_1.printActions)(parsedLogic, appOptions)),
|
|
177
|
+
printProperty('constants', (0, printConstants_1.printConstants)(parsedLogic)),
|
|
178
|
+
printProperty('defaults', (0, printDefaults_1.printDefaults)(parsedLogic)),
|
|
179
|
+
printProperty('events', (0, printEvents_1.printEvents)(parsedLogic)),
|
|
180
|
+
printProperty('key', (0, printKey_1.printKey)(parsedLogic)),
|
|
181
|
+
printProperty('listeners', (0, printListeners_1.printListeners)(parsedLogic)),
|
|
182
|
+
printProperty('path', typescript_1.factory.createTupleTypeNode(parsedLogic.path.map((p) => typescript_1.factory.createLiteralTypeNode(typescript_1.factory.createStringLiteral(p))))),
|
|
183
|
+
printProperty('pathString', typescript_1.factory.createStringLiteral(parsedLogic.pathString)),
|
|
184
|
+
printProperty('props', (0, printProps_1.printProps)(parsedLogic)),
|
|
185
|
+
printProperty('reducer', (0, printReducer_1.printReducer)(parsedLogic)),
|
|
186
|
+
printProperty('reducerOptions', (0, printReducerOptions_1.printReducerOptions)(parsedLogic)),
|
|
187
|
+
printProperty('reducers', (0, printReducers_1.printReducers)(parsedLogic)),
|
|
188
|
+
printProperty('selector', (0, printSelector_1.printSelector)(parsedLogic)),
|
|
189
|
+
printProperty('selectors', (0, printSelectors_1.printSelectors)(parsedLogic)),
|
|
190
|
+
printProperty('sharedListeners', (0, printSharedListeners_1.printSharedListeners)(parsedLogic)),
|
|
191
|
+
printProperty('values', (0, printValues_1.printValues)(parsedLogic)),
|
|
192
|
+
printProperty('_isKea', typescript_1.factory.createTrue()),
|
|
193
|
+
printProperty('_isKeaWithKey', parsedLogic.keyType ? typescript_1.factory.createTrue() : typescript_1.factory.createFalse()),
|
|
182
194
|
addSelectorTypeHelp
|
|
183
|
-
? printProperty('__keaTypeGenInternalSelectorTypes', printInternalSelectorTypes_1.printInternalSelectorTypes(parsedLogic))
|
|
195
|
+
? printProperty('__keaTypeGenInternalSelectorTypes', (0, printInternalSelectorTypes_1.printInternalSelectorTypes)(parsedLogic))
|
|
184
196
|
: null,
|
|
185
197
|
Object.keys(parsedLogic.extraActions).length > 0
|
|
186
|
-
? printProperty('__keaTypeGenInternalReducerActions', printInternalReducerActions_1.printInternalReducerActions(parsedLogic))
|
|
198
|
+
? printProperty('__keaTypeGenInternalReducerActions', (0, printInternalReducerActions_1.printInternalReducerActions)(parsedLogic))
|
|
187
199
|
: null,
|
|
188
200
|
Object.keys(parsedLogic.extraInput).length > 0
|
|
189
|
-
? printProperty('__keaTypeGenInternalExtraInput', printInternalExtraInput_1.printInternalExtraInput(parsedLogic))
|
|
201
|
+
? printProperty('__keaTypeGenInternalExtraInput', (0, printInternalExtraInput_1.printInternalExtraInput)(parsedLogic))
|
|
190
202
|
: null,
|
|
191
203
|
].filter((a) => !!a);
|
|
192
204
|
const logicTypeArguments = getLogicTypeArguments(parsedLogic);
|
|
193
|
-
parsedLogic.interfaceDeclaration =
|
|
194
|
-
|
|
195
|
-
|
|
205
|
+
parsedLogic.interfaceDeclaration = typescript_1.factory.createInterfaceDeclaration(undefined, [typescript_1.factory.createModifier(typescript_1.SyntaxKind.ExportKeyword)], typescript_1.factory.createIdentifier(`${parsedLogic.logicName}Type`), logicTypeArguments, [
|
|
206
|
+
typescript_1.factory.createHeritageClause(typescript_1.SyntaxKind.ExtendsKeyword, [
|
|
207
|
+
typescript_1.factory.createExpressionWithTypeArguments(typescript_1.factory.createIdentifier('Logic'), undefined),
|
|
196
208
|
]),
|
|
197
209
|
], logicProperties);
|
|
198
210
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"print.js","sourceRoot":"","sources":["../../../src/print/print.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"print.js","sourceRoot":"","sources":["../../../src/print/print.ts"],"names":[],"mappings":";;;AAAA,2CAYmB;AACnB,yBAAwB;AACxB,6BAA4B;AAC5B,qCAAoC;AAGpC,iDAA6C;AAC7C,mDAA+C;AAC/C,iDAA6C;AAC7C,mDAA+C;AAC/C,qDAAiD;AACjD,+CAA2C;AAC3C,6EAAyE;AACzE,uDAAmD;AACnD,yDAAqD;AACrD,+EAA2E;AAC3E,+DAA2D;AAC3D,6CAAyC;AACzC,yCAAqC;AACrC,mDAA+C;AAC/C,qDAAiD;AACjD,+DAA2D;AAC3D,+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CAAC,GAAG,WAAW,CAAC,SAAS,MAAM,CAAC,EACxD,kBAAkB,EAClB;QACI,oBAAO,CAAC,oBAAoB,CAAC,uBAAU,CAAC,cAAc,EAAE;YACpD,oBAAO,CAAC,iCAAiC,CAAC,oBAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;SAC1F,CAAC;KACL,EACD,eAAe,CAClB,CAAA;AACL,CAAC;AA1DD,wCA0DC;AAGD,IAAI,CAAC,GAAG,CAAC,CAAA;AACT,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import * as ts from 'typescript';
|
|
2
1
|
import { AppOptions, ParsedLogic } from '../types';
|
|
3
|
-
export declare function printActionCreators(parsedLogic: ParsedLogic, appOptions?: AppOptions):
|
|
2
|
+
export declare function printActionCreators(parsedLogic: ParsedLogic, appOptions?: AppOptions): import("typescript").TypeLiteralNode;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.printActionCreators = void 0;
|
|
4
|
-
const
|
|
4
|
+
const typescript_1 = require("typescript");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
function printActionCreators(parsedLogic, appOptions) {
|
|
7
|
-
const getActionType = utils_1.getActionTypeCreator(parsedLogic);
|
|
8
|
-
return
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
])))
|
|
7
|
+
const getActionType = (0, utils_1.getActionTypeCreator)(parsedLogic);
|
|
8
|
+
return typescript_1.factory.createTypeLiteralNode(parsedLogic.actions.map(({ name, parameters, returnTypeNode }) => {
|
|
9
|
+
return typescript_1.factory.createPropertySignature(undefined, typescript_1.factory.createIdentifier(name), undefined, typescript_1.factory.createFunctionTypeNode(undefined, parameters, typescript_1.factory.createParenthesizedType(typescript_1.factory.createTypeLiteralNode([
|
|
10
|
+
typescript_1.factory.createPropertySignature(undefined, typescript_1.factory.createIdentifier('type'), undefined, typescript_1.factory.createLiteralTypeNode(typescript_1.factory.createStringLiteral(getActionType(name)))),
|
|
11
|
+
typescript_1.factory.createPropertySignature(undefined, typescript_1.factory.createIdentifier('payload'), undefined, returnTypeNode),
|
|
12
|
+
]))));
|
|
13
13
|
}));
|
|
14
14
|
}
|
|
15
15
|
exports.printActionCreators = printActionCreators;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printActionCreators.js","sourceRoot":"","sources":["../../../src/print/printActionCreators.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"printActionCreators.js","sourceRoot":"","sources":["../../../src/print/printActionCreators.ts"],"names":[],"mappings":";;;AAAA,2CAAoC;AAEpC,oCAA+C;AAE/C,SAAgB,mBAAmB,CAAC,WAAwB,EAAE,UAAuB;IACjF,MAAM,aAAa,GAAG,IAAA,4BAAoB,EAAC,WAAW,CAAC,CAAA;IAEvD,OAAO,oBAAO,CAAC,qBAAqB,CAChC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,EAAE;QAC7D,OAAO,oBAAO,CAAC,uBAAuB,CAClC,SAAS,EACT,oBAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAC9B,SAAS,EACT,oBAAO,CAAC,sBAAsB,CAC1B,SAAS,EACT,UAAU,EACV,oBAAO,CAAC,uBAAuB,CAC3B,oBAAO,CAAC,qBAAqB,CAAC;YAC1B,oBAAO,CAAC,uBAAuB,CAC3B,SAAS,EACT,oBAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAChC,SAAS,EACT,oBAAO,CAAC,qBAAqB,CAAC,oBAAO,CAAC,mBAAmB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAClF;YACD,oBAAO,CAAC,uBAAuB,CAC3B,SAAS,EACT,oBAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC,EACnC,SAAS,EACT,cAAc,CACjB;SACJ,CAAC,CACL,CACJ,CACJ,CAAA;IACL,CAAC,CAAC,CACL,CAAA;AACL,CAAC;AAhCD,kDAgCC"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import * as ts from 'typescript';
|
|
2
1
|
import { AppOptions, ParsedLogic } from '../types';
|
|
3
|
-
export declare function printActionKeys(parsedLogic: ParsedLogic, appOptions?: AppOptions):
|
|
2
|
+
export declare function printActionKeys(parsedLogic: ParsedLogic, appOptions?: AppOptions): import("typescript").TypeLiteralNode;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.printActionKeys = void 0;
|
|
4
|
-
const
|
|
4
|
+
const typescript_1 = require("typescript");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
function printActionKeys(parsedLogic, appOptions) {
|
|
7
|
-
const getActionType = utils_1.getActionTypeCreator(parsedLogic);
|
|
8
|
-
return
|
|
9
|
-
return
|
|
7
|
+
const getActionType = (0, utils_1.getActionTypeCreator)(parsedLogic);
|
|
8
|
+
return typescript_1.factory.createTypeLiteralNode(parsedLogic.actions.map(({ name, parameters, returnTypeNode }) => {
|
|
9
|
+
return typescript_1.factory.createPropertySignature(undefined, typescript_1.factory.createStringLiteral(getActionType(name)), undefined, typescript_1.factory.createLiteralTypeNode(typescript_1.factory.createStringLiteral(name)));
|
|
10
10
|
}));
|
|
11
11
|
}
|
|
12
12
|
exports.printActionKeys = printActionKeys;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printActionKeys.js","sourceRoot":"","sources":["../../../src/print/printActionKeys.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"printActionKeys.js","sourceRoot":"","sources":["../../../src/print/printActionKeys.ts"],"names":[],"mappings":";;;AAAA,2CAAoC;AAEpC,oCAA+C;AAE/C,SAAgB,eAAe,CAAC,WAAwB,EAAE,UAAuB;IAC7E,MAAM,aAAa,GAAG,IAAA,4BAAoB,EAAC,WAAW,CAAC,CAAA;IAEvD,OAAO,oBAAO,CAAC,qBAAqB,CAChC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,EAAE;QAC7D,OAAO,oBAAO,CAAC,uBAAuB,CAClC,SAAS,EACT,oBAAO,CAAC,mBAAmB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,EAChD,SAAS,EACT,oBAAO,CAAC,qBAAqB,CAAC,oBAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CACnE,CAAA;IACL,CAAC,CAAC,CACL,CAAA;AACL,CAAC;AAbD,0CAaC"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import * as ts from 'typescript';
|
|
2
1
|
import { AppOptions, ParsedLogic } from '../types';
|
|
3
|
-
export declare function printActionTypes(parsedLogic: ParsedLogic, appOptions?: AppOptions):
|
|
2
|
+
export declare function printActionTypes(parsedLogic: ParsedLogic, appOptions?: AppOptions): import("typescript").TypeLiteralNode;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.printActionTypes = void 0;
|
|
4
|
-
const
|
|
4
|
+
const typescript_1 = require("typescript");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
function printActionTypes(parsedLogic, appOptions) {
|
|
7
|
-
const getActionType = utils_1.getActionTypeCreator(parsedLogic);
|
|
8
|
-
return
|
|
9
|
-
return
|
|
7
|
+
const getActionType = (0, utils_1.getActionTypeCreator)(parsedLogic);
|
|
8
|
+
return typescript_1.factory.createTypeLiteralNode(parsedLogic.actions.map(({ name }) => {
|
|
9
|
+
return typescript_1.factory.createPropertySignature(undefined, typescript_1.factory.createIdentifier(name), undefined, typescript_1.factory.createLiteralTypeNode(typescript_1.factory.createStringLiteral(getActionType(name))));
|
|
10
10
|
}));
|
|
11
11
|
}
|
|
12
12
|
exports.printActionTypes = printActionTypes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printActionTypes.js","sourceRoot":"","sources":["../../../src/print/printActionTypes.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"printActionTypes.js","sourceRoot":"","sources":["../../../src/print/printActionTypes.ts"],"names":[],"mappings":";;;AAAA,2CAAoC;AAEpC,oCAA+C;AAE/C,SAAgB,gBAAgB,CAAC,WAAwB,EAAE,UAAuB;IAC9E,MAAM,aAAa,GAAG,IAAA,4BAAoB,EAAC,WAAW,CAAC,CAAA;IAEvD,OAAO,oBAAO,CAAC,qBAAqB,CAChC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;QACjC,OAAO,oBAAO,CAAC,uBAAuB,CAClC,SAAS,EACT,oBAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAC9B,SAAS,EACT,oBAAO,CAAC,qBAAqB,CAAC,oBAAO,CAAC,mBAAmB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAClF,CAAA;IACL,CAAC,CAAC,CACL,CAAA;AACL,CAAC;AAbD,4CAaC"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import * as ts from 'typescript';
|
|
2
1
|
import { AppOptions, ParsedLogic } from '../types';
|
|
3
|
-
export declare function printActions(parsedLogic: ParsedLogic, appOptions?: AppOptions):
|
|
2
|
+
export declare function printActions(parsedLogic: ParsedLogic, appOptions?: AppOptions): import("typescript").TypeLiteralNode;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.printActions = void 0;
|
|
4
|
-
const
|
|
4
|
+
const typescript_1 = require("typescript");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
function printActions(parsedLogic, appOptions) {
|
|
7
|
-
const getActionType = utils_1.getActionTypeCreator(parsedLogic);
|
|
8
|
-
return
|
|
9
|
-
return
|
|
7
|
+
const getActionType = (0, utils_1.getActionTypeCreator)(parsedLogic);
|
|
8
|
+
return typescript_1.factory.createTypeLiteralNode(parsedLogic.actions.map(({ name, parameters }) => {
|
|
9
|
+
return typescript_1.factory.createPropertySignature(undefined, typescript_1.factory.createIdentifier(name), undefined, typescript_1.factory.createFunctionTypeNode(undefined, parameters, typescript_1.factory.createToken(typescript_1.SyntaxKind.VoidKeyword)));
|
|
10
10
|
}));
|
|
11
11
|
}
|
|
12
12
|
exports.printActions = printActions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printActions.js","sourceRoot":"","sources":["../../../src/print/printActions.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"printActions.js","sourceRoot":"","sources":["../../../src/print/printActions.ts"],"names":[],"mappings":";;;AAAA,2CAAgD;AAEhD,oCAA+C;AAE/C,SAAgB,YAAY,CAAC,WAAwB,EAAE,UAAuB;IAC1E,MAAM,aAAa,GAAG,IAAA,4BAAoB,EAAC,WAAW,CAAC,CAAA;IAEvD,OAAO,oBAAO,CAAC,qBAAqB,CAChC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE;QAC7C,OAAO,oBAAO,CAAC,uBAAuB,CAClC,SAAS,EACT,oBAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAC9B,SAAS,EACT,oBAAO,CAAC,sBAAsB,CAAC,SAAS,EAAE,UAAU,EAAE,oBAAO,CAAC,WAAW,CAAC,uBAAU,CAAC,WAAW,CAAC,CAAC,CACrG,CAAA;IACL,CAAC,CAAC,CACL,CAAA;AACL,CAAC;AAbD,oCAaC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.printConstants = void 0;
|
|
4
|
-
const
|
|
4
|
+
const typescript_1 = require("typescript");
|
|
5
5
|
function printConstants(parsedLogic) {
|
|
6
|
-
return
|
|
6
|
+
return typescript_1.factory.createTypeLiteralNode(parsedLogic.constants.map((constant) => typescript_1.factory.createPropertySignature(undefined, typescript_1.factory.createStringLiteral(constant), undefined, typescript_1.factory.createLiteralTypeNode(typescript_1.factory.createStringLiteral(constant)))));
|
|
7
7
|
}
|
|
8
8
|
exports.printConstants = printConstants;
|
|
9
9
|
//# sourceMappingURL=printConstants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printConstants.js","sourceRoot":"","sources":["../../../src/print/printConstants.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"printConstants.js","sourceRoot":"","sources":["../../../src/print/printConstants.ts"],"names":[],"mappings":";;;AAAA,2CAAoC;AAGpC,SAAgB,cAAc,CAAC,WAAwB;IACnD,OAAO,oBAAO,CAAC,qBAAqB,CAChC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CACnC,oBAAO,CAAC,uBAAuB,CAC3B,SAAS,EACT,oBAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,EACrC,SAAS,EACT,oBAAO,CAAC,qBAAqB,CAAC,oBAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CACvE,CACJ,CACJ,CAAA;AACL,CAAC;AAXD,wCAWC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.printDefaults = void 0;
|
|
4
|
-
const
|
|
4
|
+
const typescript_1 = require("typescript");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
function printDefaults(parsedLogic) {
|
|
7
|
-
return
|
|
8
|
-
return
|
|
7
|
+
return typescript_1.factory.createTypeLiteralNode((0, utils_1.cleanDuplicateAnyNodes)(parsedLogic.reducers).map((reducer) => {
|
|
8
|
+
return typescript_1.factory.createPropertySignature(undefined, typescript_1.factory.createIdentifier(reducer.name), undefined, reducer.typeNode);
|
|
9
9
|
}));
|
|
10
10
|
}
|
|
11
11
|
exports.printDefaults = printDefaults;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printDefaults.js","sourceRoot":"","sources":["../../../src/print/printDefaults.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"printDefaults.js","sourceRoot":"","sources":["../../../src/print/printDefaults.ts"],"names":[],"mappings":";;;AAAA,2CAAoC;AAEpC,oCAAiD;AAEjD,SAAgB,aAAa,CAAC,WAAwB;IAClD,OAAO,oBAAO,CAAC,qBAAqB,CAChC,IAAA,8BAAsB,EAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACzD,OAAO,oBAAO,CAAC,uBAAuB,CAClC,SAAS,EACT,oBAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,EACtC,SAAS,EACT,OAAO,CAAC,QAAQ,CACnB,CAAA;IACL,CAAC,CAAC,CACL,CAAA;AACL,CAAC;AAXD,sCAWC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.printEvents = void 0;
|
|
4
|
-
const
|
|
4
|
+
const typescript_1 = require("typescript");
|
|
5
5
|
function printEvents(parsedLogic) {
|
|
6
|
-
return
|
|
7
|
-
return
|
|
6
|
+
return typescript_1.factory.createTypeLiteralNode(Object.keys(parsedLogic.events).map((name) => {
|
|
7
|
+
return typescript_1.factory.createPropertySignature(undefined, typescript_1.factory.createIdentifier(name), undefined, typescript_1.factory.createFunctionTypeNode(undefined, [], Object.assign(Object.assign({}, typescript_1.factory.createToken(typescript_1.SyntaxKind.VoidKeyword)), { _typeNodeBrand: true })));
|
|
8
8
|
}));
|
|
9
9
|
}
|
|
10
10
|
exports.printEvents = printEvents;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printEvents.js","sourceRoot":"","sources":["../../../src/print/printEvents.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"printEvents.js","sourceRoot":"","sources":["../../../src/print/printEvents.ts"],"names":[],"mappings":";;;AAAA,2CAAgD;AAGhD,SAAgB,WAAW,CAAC,WAAwB;IAChD,OAAO,oBAAO,CAAC,qBAAqB,CAChC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACzC,OAAO,oBAAO,CAAC,uBAAuB,CAClC,SAAS,EACT,oBAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAC9B,SAAS,EACT,oBAAO,CAAC,sBAAsB,CAAC,SAAS,EAAE,EAAE,kCACrC,oBAAO,CAAC,WAAW,CAAC,uBAAU,CAAC,WAAW,CAAC,KAC9C,cAAc,EAAE,IAAI,IACtB,CACL,CAAA;IACL,CAAC,CAAC,CACL,CAAA;AACL,CAAC;AAdD,kCAcC"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { ParsedLogic } from '../types';
|
|
2
|
-
|
|
3
|
-
export declare function printInternalExtraInput(parsedLogic: ParsedLogic): ts.TypeLiteralNode;
|
|
2
|
+
export declare function printInternalExtraInput(parsedLogic: ParsedLogic): import("typescript").TypeLiteralNode;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.printInternalExtraInput = void 0;
|
|
4
|
-
const
|
|
4
|
+
const typescript_1 = require("typescript");
|
|
5
5
|
function printInternalExtraInput(parsedLogic) {
|
|
6
|
-
return
|
|
6
|
+
return typescript_1.factory.createTypeLiteralNode(Object.entries(parsedLogic.extraInput).map(([type, { typeNode, withLogicFunction }]) => {
|
|
7
7
|
if (withLogicFunction) {
|
|
8
8
|
const logicTypeArguments = [...parsedLogic.typeReferencesInLogicInput]
|
|
9
9
|
.sort()
|
|
10
|
-
.map((text) =>
|
|
11
|
-
return
|
|
10
|
+
.map((text) => typescript_1.factory.createTypeReferenceNode(typescript_1.factory.createIdentifier(text), undefined));
|
|
11
|
+
return typescript_1.factory.createPropertySignature(undefined, typescript_1.factory.createStringLiteral(type), undefined, typescript_1.factory.createUnionTypeNode([
|
|
12
12
|
typeNode,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
typescript_1.factory.createFunctionTypeNode(undefined, [
|
|
14
|
+
typescript_1.factory.createParameterDeclaration(undefined, undefined, undefined, typescript_1.factory.createIdentifier('logic'), undefined, typescript_1.factory.createTypeReferenceNode(typescript_1.factory.createIdentifier(parsedLogic.logicTypeName), logicTypeArguments.length > 0 ? logicTypeArguments : undefined), undefined),
|
|
15
15
|
], typeNode),
|
|
16
|
-
])
|
|
16
|
+
]));
|
|
17
17
|
}
|
|
18
|
-
return
|
|
18
|
+
return typescript_1.factory.createPropertySignature(undefined, typescript_1.factory.createStringLiteral(type), undefined, typeNode);
|
|
19
19
|
}));
|
|
20
20
|
}
|
|
21
21
|
exports.printInternalExtraInput = printInternalExtraInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printInternalExtraInput.js","sourceRoot":"","sources":["../../../src/print/printInternalExtraInput.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"printInternalExtraInput.js","sourceRoot":"","sources":["../../../src/print/printInternalExtraInput.ts"],"names":[],"mappings":";;;AACA,2CAAoC;AAEpC,SAAgB,uBAAuB,CAAC,WAAwB;IAC5D,OAAO,oBAAO,CAAC,qBAAqB,CAChC,MAAM,CAA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ReducerActions(parsedLogic: ParsedLogic): ts.TypeLiteralNode;
|
|
2
|
+
export declare function printInternalReducerActions(parsedLogic: ParsedLogic): import("typescript").TypeLiteralNode;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.printInternalReducerActions = void 0;
|
|
4
|
-
const
|
|
4
|
+
const typescript_1 = require("typescript");
|
|
5
5
|
function printInternalReducerActions(parsedLogic) {
|
|
6
|
-
return
|
|
7
|
-
.
|
|
8
|
-
return ts.createPropertySignature(undefined, ts.createStringLiteral(type), undefined, typeNode, undefined);
|
|
6
|
+
return typescript_1.factory.createTypeLiteralNode(Object.entries(parsedLogic.extraActions).map(([type, typeNode]) => {
|
|
7
|
+
return typescript_1.factory.createPropertySignature(undefined, typescript_1.factory.createStringLiteral(type), undefined, typeNode);
|
|
9
8
|
}));
|
|
10
9
|
}
|
|
11
10
|
exports.printInternalReducerActions = printInternalReducerActions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printInternalReducerActions.js","sourceRoot":"","sources":["../../../src/print/printInternalReducerActions.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"printInternalReducerActions.js","sourceRoot":"","sources":["../../../src/print/printInternalReducerActions.ts"],"names":[],"mappings":";;;AACA,2CAAoC;AAEpC,SAAgB,2BAA2B,CAAC,WAAwB;IAChE,OAAO,oBAAO,CAAC,qBAAqB,CAChC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,EAAE;QAC9D,OAAO,oBAAO,CAAC,uBAAuB,CAAC,SAAS,EAAE,oBAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAA;IAC7G,CAAC,CAAC,CACL,CAAA;AACL,CAAC;AAND,kEAMC"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { ParsedLogic } from '../types';
|
|
2
|
-
|
|
3
|
-
export declare function printInternalSelectorTypes(parsedLogic: ParsedLogic): ts.TypeLiteralNode;
|
|
2
|
+
export declare function printInternalSelectorTypes(parsedLogic: ParsedLogic): import("typescript").TypeLiteralNode;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.printInternalSelectorTypes = void 0;
|
|
4
|
-
const
|
|
4
|
+
const typescript_1 = require("typescript");
|
|
5
5
|
function printInternalSelectorTypes(parsedLogic) {
|
|
6
|
-
return
|
|
6
|
+
return typescript_1.factory.createTypeLiteralNode(parsedLogic.selectors
|
|
7
7
|
.filter((s) => s.functionTypes.length > 0)
|
|
8
8
|
.map((selector) => {
|
|
9
|
-
return
|
|
9
|
+
return typescript_1.factory.createPropertySignature(undefined, typescript_1.factory.createIdentifier(selector.name), undefined, typescript_1.factory.createFunctionTypeNode(undefined, selector.functionTypes.map((functionType, index) => typescript_1.factory.createParameterDeclaration(undefined, undefined, undefined, typescript_1.factory.createIdentifier(functionType.name), undefined, functionType.type, undefined)), selector.typeNode));
|
|
10
10
|
}));
|
|
11
11
|
}
|
|
12
12
|
exports.printInternalSelectorTypes = printInternalSelectorTypes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printInternalSelectorTypes.js","sourceRoot":"","sources":["../../../src/print/printInternalSelectorTypes.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"printInternalSelectorTypes.js","sourceRoot":"","sources":["../../../src/print/printInternalSelectorTypes.ts"],"names":[],"mappings":";;;AACA,2CAAoC;AAEpC,SAAgB,0BAA0B,CAAC,WAAwB;IAC/D,OAAO,oBAAO,CAAC,qBAAqB,CAChC,WAAW,CAAC,SAAS;SAChB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;SACzC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;QACd,OAAO,oBAAO,CAAC,uBAAuB,CAClC,SAAS,EACT,oBAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,EACvC,SAAS,EAET,oBAAO,CAAC,sBAAsB,CAC1B,SAAS,EACT,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE,CAC/C,oBAAO,CAAC,0BAA0B,CAC9B,SAAS,EACT,SAAS,EACT,SAAS,EACT,oBAAO,CAAC,gBAAgB,CAAC,YAAY,CAAC,IAAI,CAAC,EAC3C,SAAS,EACT,YAAY,CAAC,IAAI,EACjB,SAAS,CACZ,CACJ,EACD,QAAQ,CAAC,QAAQ,CACpB,CACJ,CAAA;IACL,CAAC,CAAC,CACT,CAAA;AACL,CAAC;AA5BD,gEA4BC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.printKey = void 0;
|
|
4
|
-
const
|
|
4
|
+
const typescript_1 = require("typescript");
|
|
5
5
|
function printKey(parsedLogic) {
|
|
6
|
-
return parsedLogic.keyType ||
|
|
6
|
+
return parsedLogic.keyType || typescript_1.factory.createKeywordTypeNode(typescript_1.SyntaxKind.UndefinedKeyword);
|
|
7
7
|
}
|
|
8
8
|
exports.printKey = printKey;
|
|
9
9
|
//# sourceMappingURL=printKey.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printKey.js","sourceRoot":"","sources":["../../../src/print/printKey.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"printKey.js","sourceRoot":"","sources":["../../../src/print/printKey.ts"],"names":[],"mappings":";;;AAAA,2CAAgD;AAGhD,SAAgB,QAAQ,CAAC,WAAwB;IAC7C,OAAO,WAAW,CAAC,OAAO,IAAI,oBAAO,CAAC,qBAAqB,CAAC,uBAAU,CAAC,gBAAgB,CAAC,CAAA;AAC5F,CAAC;AAFD,4BAEC"}
|