@lcap/nasl-unified-frontend-generator 3.9.1-beta.7 → 3.9.2-beta.2

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/dist/index.d.mts CHANGED
@@ -528,6 +528,8 @@ declare function bindAttrToIR(b: BindAttribute | {
528
528
  }): BindAttributeIR;
529
529
  declare function logicToLogicIR(logic: Logic): LogicIR;
530
530
  declare function inferChangeEventNameFromAttrName(attrName: string): string;
531
+ declare function bindViewElementEventToIR(b: BindEvent): BindEventIR;
532
+ declare function bindEventToAction(b: BindEventIR): StateActionIR;
531
533
  declare const ApiClientIdentifier = "apiClient";
532
534
  declare class NASLAppIRBuilderPlugin implements NASLDomain.IRBuilder {
533
535
  private preProcessors?;
@@ -874,7 +876,9 @@ declare class ReactFragment implements FileFragment {
874
876
  * 绑定事件
875
877
  * @param b - 绑定事件的IR
876
878
  */
877
- bindEvent(b: BindEventIR): void;
879
+ bindEvent(b: BindEventIR, options?: {
880
+ handlerPrefix: string;
881
+ }): void;
878
882
  /**
879
883
  * 将属性存入当前片段的attrMap
880
884
  *
@@ -950,9 +954,10 @@ type ComponentIRToPathDict = WeakMap<GeneralComponentIR, string>;
950
954
  declare class ReactCodegenPlugin implements JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactCodegen {
951
955
  javaScriptCodegen: JavaScriptDomain.JavaScriptCodegen;
952
956
  reactStateManager: JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactStateManager;
957
+ frontendPerformance: JavaScriptDomain.FrontendApplicationDomain.FrontendPerformance;
953
958
  private projectOrganizer;
954
959
  private reactHookProviders?;
955
- constructor(javaScriptCodegen: JavaScriptDomain.JavaScriptCodegen, reactStateManager: JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactStateManager, projectOrganizer: GeneratorInfrastructureDomain.ProjectOrganizer, reactHookProviders?: JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactHookProvider[] | undefined);
960
+ constructor(javaScriptCodegen: JavaScriptDomain.JavaScriptCodegen, reactStateManager: JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactStateManager, frontendPerformance: JavaScriptDomain.FrontendApplicationDomain.FrontendPerformance, projectOrganizer: GeneratorInfrastructureDomain.ProjectOrganizer, reactHookProviders?: JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactHookProvider[] | undefined);
956
961
  genReactFragment(c: ComponentInstanceIR, ctx: StateContextIR): ReactFragment;
957
962
  /**
958
963
  * 根据组件声明信息和文件夹信息生成React组件
@@ -1009,7 +1014,9 @@ declare const reactComponentLibHackPlugin: {
1009
1014
  name: string;
1010
1015
  } & {
1011
1016
  kind: 'expr';
1012
- }>(ctx: StateContextIR, b: T): T;
1017
+ }>(ctx: StateContextIR, b: T): (BindAttributeIR & {
1018
+ kind: 'expr';
1019
+ }) | BindEventIR;
1013
1020
  };
1014
1021
  };
1015
1022
 
@@ -1075,6 +1082,17 @@ declare class ReactStateManagerMobxPlugin implements JavaScriptDomain.FrontendAp
1075
1082
  static install(container: Container): Container;
1076
1083
  }
1077
1084
 
1085
+ type PerformanceOptions = Partial<{
1086
+ lazy: boolean;
1087
+ chunks: 'initial' | 'all' | 'async';
1088
+ }>;
1089
+
1090
+ type CompilerConfigOptions = Partial<{
1091
+ backendUrl: string;
1092
+ publicPath: string;
1093
+ aliasMapStr: string;
1094
+ }>;
1095
+
1078
1096
  /**
1079
1097
  *
1080
1098
  */
@@ -1285,6 +1303,26 @@ declare namespace JavaScriptDomain {
1285
1303
  */
1286
1304
  withCtx(ctx: StateContextIR): SymbolResolver;
1287
1305
  }
1306
+ interface FrontendBundlerConfig {
1307
+ compilerConfig: CompilerConfigOptions;
1308
+ /**
1309
+ * 存储前端编译器动态配置参数
1310
+ * @param config - 前端编译器动态配置参数
1311
+ */
1312
+ setCompilerConfig: (config: CompilerConfigOptions) => void;
1313
+ getCompilerConfig: () => CompilerConfigOptions;
1314
+ }
1315
+ interface FrontendPerformance {
1316
+ performanceOptions: PerformanceOptions;
1317
+ /**
1318
+ * 设置前端优化选项
1319
+ * @param options - 前端优化选项
1320
+ */
1321
+ setOptions: (options: PerformanceOptions) => void;
1322
+ }
1323
+ interface NpmPackageJSONManager {
1324
+ patch: (patch: Record<string, any>) => void;
1325
+ }
1288
1326
  /**
1289
1327
  * React框架领域
1290
1328
  */
@@ -1460,7 +1498,11 @@ declare const ServiceMetaKind: {
1460
1498
  ReactCodegen: symbol;
1461
1499
  CodeGenerationLifecycleHooks: symbol;
1462
1500
  FileSystemProvider: symbol;
1501
+ FrontendBundlerConfig: symbol;
1502
+ FrontendPerformance: symbol;
1503
+ NpmPackageJSONManager: symbol;
1463
1504
  };
1505
+ declare const hasAfterAllFilesGeneratedKind: symbol[];
1464
1506
 
1465
1507
  declare function Logger(prefix: string): pino.Logger<never>;
1466
1508
 
@@ -1484,4 +1526,4 @@ declare function makePlugin<Functions extends {}>({ name, functions, }: NASLPlug
1484
1526
  declare function deserializeAppWhileKeepTypeAnnotation(appJSON: object): App;
1485
1527
  declare function serializeAppWithKeepTypeAnnotation(app: App): any;
1486
1528
 
1487
- export { ApiClientIdentifier, type BaseComponentIR, type BasePlatformConfig, type BindAttributeIR, type BindDirectiveIR, type BindEventIR, type BizComponentIR, type CommonAppConfig, type ComponentIRToPathDict, type ComponentInstanceIR, type Dict, type Expr, type ExprIR, type FileFragment, FileSystemPlugin, type FinalizedStateContextIR, type GeneralComponentIR, Generator, GeneratorInfrastructureDomain, type HasRuntimeSemantics, type IdentifierNameResolver, type IdentifierResolver, type IdentifierString, type ImportIR, type ImportIRResolver, type InputFile, type JSXNode, JavaScriptCodegenPlugin, JavaScriptDomain, type LegacyMetaData, LifeCycleHooksPlugin, type LocalIndividualStateIR, type LocalLogicStateIR, Logger, type LogicIR, MicroFrontendPlugin, type NASLAppIR, NASLAppIRBuilderPlugin, NASLDomain, type NASLPlugin, type OrganizedFile, type Package, type ParamIR, PlacedFile, type PlatformConfig, type PrettierOptions, ProjectOrganizerPlugin, type ProjectStructureConfig, ReactChildrenPropName, ReactCodegenPlugin, ReactFileDescription, ReactFragment, type ReactHook, ReactPresetPlugin, ReactRouterDefaultBizComponentsFolderName, ReactRouterDefaultViewFolderName, ReactStateManagerMobxPlugin, ReactStateManagerVanillaPlugin, type ReferencedComponent, type ReferencedLibComponent, type RouteIR, ServiceMetaKind, StateActionIR, StateContextIR, type StateIR, type StateManager, type SyntaxNodePrinter, type ToJSXOption, type TreeStateIR, type TypeAnnotationIR, type ViewComponentIR, VirtualProject, bindAttrToIR, codeFormatPlugin, compileAsProject, compileNASLToReactDist, defaultErrorMessageDict, deserializeAppWhileKeepTypeAnnotation, genMetaData, getComponentName, inferChangeEventNameFromAttrName, type javaScriptCodeGenCallBackBag, javaScriptCodeGenPlugin, jsxCodeGenPlugin, logicToLogicIR, makeDefaultContainer, makePlugin, metadataPlugin, paramToIR, reactComponentLibHackPlugin, reactRouterPlugin, reactSlotPlugin, routesExtractionPlugin, serializeAppWithKeepTypeAnnotation, styleStringToInlineObject, translateNASLToReactApp };
1529
+ export { ApiClientIdentifier, type BaseComponentIR, type BasePlatformConfig, type BindAttributeIR, type BindDirectiveIR, type BindEventIR, type BizComponentIR, type CommonAppConfig, type ComponentIRToPathDict, type ComponentInstanceIR, type Dict, type Expr, type ExprIR, type FileFragment, FileSystemPlugin, type FinalizedStateContextIR, type GeneralComponentIR, Generator, GeneratorInfrastructureDomain, type HasRuntimeSemantics, type IdentifierNameResolver, type IdentifierResolver, type IdentifierString, type ImportIR, type ImportIRResolver, type InputFile, type JSXNode, JavaScriptCodegenPlugin, JavaScriptDomain, type LegacyMetaData, LifeCycleHooksPlugin, type LocalIndividualStateIR, type LocalLogicStateIR, Logger, type LogicIR, MicroFrontendPlugin, type NASLAppIR, NASLAppIRBuilderPlugin, NASLDomain, type NASLPlugin, type OrganizedFile, type Package, type ParamIR, PlacedFile, type PlatformConfig, type PrettierOptions, ProjectOrganizerPlugin, type ProjectStructureConfig, ReactChildrenPropName, ReactCodegenPlugin, ReactFileDescription, ReactFragment, type ReactHook, ReactPresetPlugin, ReactRouterDefaultBizComponentsFolderName, ReactRouterDefaultViewFolderName, ReactStateManagerMobxPlugin, ReactStateManagerVanillaPlugin, type ReferencedComponent, type ReferencedLibComponent, type RouteIR, ServiceMetaKind, StateActionIR, StateContextIR, type StateIR, type StateManager, type SyntaxNodePrinter, type ToJSXOption, type TreeStateIR, type TypeAnnotationIR, type ViewComponentIR, VirtualProject, bindAttrToIR, bindEventToAction, bindViewElementEventToIR, codeFormatPlugin, compileAsProject, compileNASLToReactDist, defaultErrorMessageDict, deserializeAppWhileKeepTypeAnnotation, genMetaData, getComponentName, hasAfterAllFilesGeneratedKind, inferChangeEventNameFromAttrName, type javaScriptCodeGenCallBackBag, javaScriptCodeGenPlugin, jsxCodeGenPlugin, logicToLogicIR, makeDefaultContainer, makePlugin, metadataPlugin, paramToIR, reactComponentLibHackPlugin, reactRouterPlugin, reactSlotPlugin, routesExtractionPlugin, serializeAppWithKeepTypeAnnotation, styleStringToInlineObject, translateNASLToReactApp };
package/dist/index.d.ts CHANGED
@@ -528,6 +528,8 @@ declare function bindAttrToIR(b: BindAttribute | {
528
528
  }): BindAttributeIR;
529
529
  declare function logicToLogicIR(logic: Logic): LogicIR;
530
530
  declare function inferChangeEventNameFromAttrName(attrName: string): string;
531
+ declare function bindViewElementEventToIR(b: BindEvent): BindEventIR;
532
+ declare function bindEventToAction(b: BindEventIR): StateActionIR;
531
533
  declare const ApiClientIdentifier = "apiClient";
532
534
  declare class NASLAppIRBuilderPlugin implements NASLDomain.IRBuilder {
533
535
  private preProcessors?;
@@ -874,7 +876,9 @@ declare class ReactFragment implements FileFragment {
874
876
  * 绑定事件
875
877
  * @param b - 绑定事件的IR
876
878
  */
877
- bindEvent(b: BindEventIR): void;
879
+ bindEvent(b: BindEventIR, options?: {
880
+ handlerPrefix: string;
881
+ }): void;
878
882
  /**
879
883
  * 将属性存入当前片段的attrMap
880
884
  *
@@ -950,9 +954,10 @@ type ComponentIRToPathDict = WeakMap<GeneralComponentIR, string>;
950
954
  declare class ReactCodegenPlugin implements JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactCodegen {
951
955
  javaScriptCodegen: JavaScriptDomain.JavaScriptCodegen;
952
956
  reactStateManager: JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactStateManager;
957
+ frontendPerformance: JavaScriptDomain.FrontendApplicationDomain.FrontendPerformance;
953
958
  private projectOrganizer;
954
959
  private reactHookProviders?;
955
- constructor(javaScriptCodegen: JavaScriptDomain.JavaScriptCodegen, reactStateManager: JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactStateManager, projectOrganizer: GeneratorInfrastructureDomain.ProjectOrganizer, reactHookProviders?: JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactHookProvider[] | undefined);
960
+ constructor(javaScriptCodegen: JavaScriptDomain.JavaScriptCodegen, reactStateManager: JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactStateManager, frontendPerformance: JavaScriptDomain.FrontendApplicationDomain.FrontendPerformance, projectOrganizer: GeneratorInfrastructureDomain.ProjectOrganizer, reactHookProviders?: JavaScriptDomain.FrontendApplicationDomain.ReactDomain.ReactHookProvider[] | undefined);
956
961
  genReactFragment(c: ComponentInstanceIR, ctx: StateContextIR): ReactFragment;
957
962
  /**
958
963
  * 根据组件声明信息和文件夹信息生成React组件
@@ -1009,7 +1014,9 @@ declare const reactComponentLibHackPlugin: {
1009
1014
  name: string;
1010
1015
  } & {
1011
1016
  kind: 'expr';
1012
- }>(ctx: StateContextIR, b: T): T;
1017
+ }>(ctx: StateContextIR, b: T): (BindAttributeIR & {
1018
+ kind: 'expr';
1019
+ }) | BindEventIR;
1013
1020
  };
1014
1021
  };
1015
1022
 
@@ -1075,6 +1082,17 @@ declare class ReactStateManagerMobxPlugin implements JavaScriptDomain.FrontendAp
1075
1082
  static install(container: Container): Container;
1076
1083
  }
1077
1084
 
1085
+ type PerformanceOptions = Partial<{
1086
+ lazy: boolean;
1087
+ chunks: 'initial' | 'all' | 'async';
1088
+ }>;
1089
+
1090
+ type CompilerConfigOptions = Partial<{
1091
+ backendUrl: string;
1092
+ publicPath: string;
1093
+ aliasMapStr: string;
1094
+ }>;
1095
+
1078
1096
  /**
1079
1097
  *
1080
1098
  */
@@ -1285,6 +1303,26 @@ declare namespace JavaScriptDomain {
1285
1303
  */
1286
1304
  withCtx(ctx: StateContextIR): SymbolResolver;
1287
1305
  }
1306
+ interface FrontendBundlerConfig {
1307
+ compilerConfig: CompilerConfigOptions;
1308
+ /**
1309
+ * 存储前端编译器动态配置参数
1310
+ * @param config - 前端编译器动态配置参数
1311
+ */
1312
+ setCompilerConfig: (config: CompilerConfigOptions) => void;
1313
+ getCompilerConfig: () => CompilerConfigOptions;
1314
+ }
1315
+ interface FrontendPerformance {
1316
+ performanceOptions: PerformanceOptions;
1317
+ /**
1318
+ * 设置前端优化选项
1319
+ * @param options - 前端优化选项
1320
+ */
1321
+ setOptions: (options: PerformanceOptions) => void;
1322
+ }
1323
+ interface NpmPackageJSONManager {
1324
+ patch: (patch: Record<string, any>) => void;
1325
+ }
1288
1326
  /**
1289
1327
  * React框架领域
1290
1328
  */
@@ -1460,7 +1498,11 @@ declare const ServiceMetaKind: {
1460
1498
  ReactCodegen: symbol;
1461
1499
  CodeGenerationLifecycleHooks: symbol;
1462
1500
  FileSystemProvider: symbol;
1501
+ FrontendBundlerConfig: symbol;
1502
+ FrontendPerformance: symbol;
1503
+ NpmPackageJSONManager: symbol;
1463
1504
  };
1505
+ declare const hasAfterAllFilesGeneratedKind: symbol[];
1464
1506
 
1465
1507
  declare function Logger(prefix: string): pino.Logger<never>;
1466
1508
 
@@ -1484,4 +1526,4 @@ declare function makePlugin<Functions extends {}>({ name, functions, }: NASLPlug
1484
1526
  declare function deserializeAppWhileKeepTypeAnnotation(appJSON: object): App;
1485
1527
  declare function serializeAppWithKeepTypeAnnotation(app: App): any;
1486
1528
 
1487
- export { ApiClientIdentifier, type BaseComponentIR, type BasePlatformConfig, type BindAttributeIR, type BindDirectiveIR, type BindEventIR, type BizComponentIR, type CommonAppConfig, type ComponentIRToPathDict, type ComponentInstanceIR, type Dict, type Expr, type ExprIR, type FileFragment, FileSystemPlugin, type FinalizedStateContextIR, type GeneralComponentIR, Generator, GeneratorInfrastructureDomain, type HasRuntimeSemantics, type IdentifierNameResolver, type IdentifierResolver, type IdentifierString, type ImportIR, type ImportIRResolver, type InputFile, type JSXNode, JavaScriptCodegenPlugin, JavaScriptDomain, type LegacyMetaData, LifeCycleHooksPlugin, type LocalIndividualStateIR, type LocalLogicStateIR, Logger, type LogicIR, MicroFrontendPlugin, type NASLAppIR, NASLAppIRBuilderPlugin, NASLDomain, type NASLPlugin, type OrganizedFile, type Package, type ParamIR, PlacedFile, type PlatformConfig, type PrettierOptions, ProjectOrganizerPlugin, type ProjectStructureConfig, ReactChildrenPropName, ReactCodegenPlugin, ReactFileDescription, ReactFragment, type ReactHook, ReactPresetPlugin, ReactRouterDefaultBizComponentsFolderName, ReactRouterDefaultViewFolderName, ReactStateManagerMobxPlugin, ReactStateManagerVanillaPlugin, type ReferencedComponent, type ReferencedLibComponent, type RouteIR, ServiceMetaKind, StateActionIR, StateContextIR, type StateIR, type StateManager, type SyntaxNodePrinter, type ToJSXOption, type TreeStateIR, type TypeAnnotationIR, type ViewComponentIR, VirtualProject, bindAttrToIR, codeFormatPlugin, compileAsProject, compileNASLToReactDist, defaultErrorMessageDict, deserializeAppWhileKeepTypeAnnotation, genMetaData, getComponentName, inferChangeEventNameFromAttrName, type javaScriptCodeGenCallBackBag, javaScriptCodeGenPlugin, jsxCodeGenPlugin, logicToLogicIR, makeDefaultContainer, makePlugin, metadataPlugin, paramToIR, reactComponentLibHackPlugin, reactRouterPlugin, reactSlotPlugin, routesExtractionPlugin, serializeAppWithKeepTypeAnnotation, styleStringToInlineObject, translateNASLToReactApp };
1529
+ export { ApiClientIdentifier, type BaseComponentIR, type BasePlatformConfig, type BindAttributeIR, type BindDirectiveIR, type BindEventIR, type BizComponentIR, type CommonAppConfig, type ComponentIRToPathDict, type ComponentInstanceIR, type Dict, type Expr, type ExprIR, type FileFragment, FileSystemPlugin, type FinalizedStateContextIR, type GeneralComponentIR, Generator, GeneratorInfrastructureDomain, type HasRuntimeSemantics, type IdentifierNameResolver, type IdentifierResolver, type IdentifierString, type ImportIR, type ImportIRResolver, type InputFile, type JSXNode, JavaScriptCodegenPlugin, JavaScriptDomain, type LegacyMetaData, LifeCycleHooksPlugin, type LocalIndividualStateIR, type LocalLogicStateIR, Logger, type LogicIR, MicroFrontendPlugin, type NASLAppIR, NASLAppIRBuilderPlugin, NASLDomain, type NASLPlugin, type OrganizedFile, type Package, type ParamIR, PlacedFile, type PlatformConfig, type PrettierOptions, ProjectOrganizerPlugin, type ProjectStructureConfig, ReactChildrenPropName, ReactCodegenPlugin, ReactFileDescription, ReactFragment, type ReactHook, ReactPresetPlugin, ReactRouterDefaultBizComponentsFolderName, ReactRouterDefaultViewFolderName, ReactStateManagerMobxPlugin, ReactStateManagerVanillaPlugin, type ReferencedComponent, type ReferencedLibComponent, type RouteIR, ServiceMetaKind, StateActionIR, StateContextIR, type StateIR, type StateManager, type SyntaxNodePrinter, type ToJSXOption, type TreeStateIR, type TypeAnnotationIR, type ViewComponentIR, VirtualProject, bindAttrToIR, bindEventToAction, bindViewElementEventToIR, codeFormatPlugin, compileAsProject, compileNASLToReactDist, defaultErrorMessageDict, deserializeAppWhileKeepTypeAnnotation, genMetaData, getComponentName, hasAfterAllFilesGeneratedKind, inferChangeEventNameFromAttrName, type javaScriptCodeGenCallBackBag, javaScriptCodeGenPlugin, jsxCodeGenPlugin, logicToLogicIR, makeDefaultContainer, makePlugin, metadataPlugin, paramToIR, reactComponentLibHackPlugin, reactRouterPlugin, reactSlotPlugin, routesExtractionPlugin, serializeAppWithKeepTypeAnnotation, styleStringToInlineObject, translateNASLToReactApp };