@effindomv2/fui-as 0.1.41 → 0.1.42
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
CHANGED
|
@@ -117,12 +117,17 @@ export async function generateAssemblyScriptHostEventsFile(
|
|
|
117
117
|
const callbackImport =
|
|
118
118
|
primitivesImportOverride ??
|
|
119
119
|
relativeImport(outputPath, path.resolve(path.dirname(modulePath), "..", "..", "src/FuiPrimitives.ts"));
|
|
120
|
+
const callbackNames = ["Callback0", "Callback1", "Callback2"].filter((_name, arity) =>
|
|
121
|
+
methods.some((method) => method.args.length === arity),
|
|
122
|
+
);
|
|
120
123
|
const blocks: string[] = [
|
|
121
124
|
"// @ts-nocheck",
|
|
122
125
|
`// Generated by hostgen from ${sourcePathForHeader(modulePath)}#${exportName}.`,
|
|
123
|
-
`import { Callback0, Callback1, Callback2 } from "${callbackImport}";`,
|
|
124
|
-
"",
|
|
125
126
|
];
|
|
127
|
+
if (callbackNames.length > 0) {
|
|
128
|
+
blocks.push(`import { ${callbackNames.join(", ")} } from "${callbackImport}";`);
|
|
129
|
+
blocks.push("");
|
|
130
|
+
}
|
|
126
131
|
methods.forEach((method, index) => {
|
|
127
132
|
const callbackType = callbackTypeFor(method.args);
|
|
128
133
|
const exportArgs = emitExportArgs(method.args);
|