@lcap/nasl
Version:
NetEase Application Specific Language
140 lines • 5.24 kB
TypeScript
import { App, BaseNode } from '../concepts';
export * as getNaturalContext from './getContext';
export declare function genNaturalTS(app: App, currentNode?: BaseNode, focusedNodePath?: string): string;
export declare function genNaturalTSCurrentContext(currentNode: BaseNode, focusedNodePath?: string, experimental?: boolean, restParams?: any): {
currentViewTitle?: string;
viewElementText?: string;
currentNodeName?: string;
currentNodeContext: string;
currentView: string;
};
export declare function genNaturalTSContextJSONForLogic(app: App, currentNode?: BaseNode, focusedNodePath?: string, experimental?: boolean, material?: {
moduleInterfaces: any;
connectors: any;
dependencies: any;
basicMaterials: 'pc' | 'h5' | {
json: any;
tsDeclaration: string;
allNodesAPI: any;
};
extensionMaterials: 'pc' | 'h5' | {
name: string;
title: string;
description: string;
tsDescription: string;
}[];
}, restParams?: any): any;
/**
* 生成 Logic 的 TypeScript 上下文
* @param tsContextJSON: 通过 genNaturalTSContextForLogic 获得到 tsContextJSON
* @param codeType: 'detail' | 'short'。detail 为详细代码,short 为简短代码
* 'detail' 将所有的code都返回(拼接成详细的code)。RAG召回,分析和执行阶段使用
* 'short' 只返回简短的code。模型召回,对应的分析阶段使用
* @param requiredIndexes?: 通过索引获取对应的 code。可挑选需要的 code
**/
export declare const genNaturalTSContextFromJSONForLogic: (tsContextJSON: any, codeType: 'detail' | 'short', requiredIndexes?: string[]) => string;
export declare function genNaturalTSContextForLogic(app: App, currentNode?: BaseNode, focusedNodePath?: string, requiredIndexes?: string[], experimental?: boolean, material?: {
moduleInterfaces: any;
connectors: any;
dependencies: any;
basicMaterials: 'pc' | 'h5' | {
json: any;
tsDeclaration: string;
allNodesAPI: any;
};
extensionMaterials: 'pc' | 'h5' | {
name: string;
title: string;
description: string;
tsDescription: string;
}[];
}, restParams?: {
codeType: 'detail' | 'short';
typeMap?: any;
}): string;
export declare const genNaturalTSContext: typeof genNaturalTSContextForLogic;
export declare const genNaturalTsContextJson: typeof genNaturalTSContextJSONForLogic;
export declare function genNaturalTSContextJSONForUI(app: App, currentNode: BaseNode, material?: {
basicMaterials: 'pc' | 'h5' | {
json: any;
tsDeclaration: string;
allNodesAPI: any;
};
extensionMaterials: 'pc' | 'h5' | {
name: string;
title: string;
description: string;
tsDescription: string;
}[];
moduleInterfaces: any;
connectors: any;
dependencies: any;
}, restParams?: any): {
naslCore: string;
naslUtil: string;
naslUI: string;
components: any;
componentDeclaration: string;
enums: {
namespace: string;
data: import("./getContext").Snippet[];
};
entities: import("./getContext").SnippetBlock[];
structures: {
namespace: string;
data: import("./getContext").Snippet[];
};
appLogics: {
namespace: string;
data: import("./getContext").Snippet[];
};
interfaceDependencies: {
name: string;
structures: import("./getContext").SnippetBlock;
logics: import("./getContext").SnippetBlock;
}[];
dependencies: {
name: string;
structures: import("./getContext").SnippetBlock;
logics: import("./getContext").SnippetBlock;
}[];
frontendVariables: {
namespace: string;
data: import("./getContext").Snippet[];
};
views: {
namespace: string;
data: import("./getContext").Snippet[];
};
currentPage: string;
};
/**
* 根据 tsContextJSON 生成 View 的 TypeScript 上下文
* @param tsContextJSON: 通过 genNaturalTSContextJSONForUI 获得到 tsContextJSON
* @param codeType: 'detail' | 'short'。detail 为详细代码,short 为简短代码
* 'detail' 将所有的code都返回(拼接成详细的code)。RAG召回,分析和执行阶段使用
* 'short' 只返回简短的code。模型召回,对应的分析阶段使用
* @param requiredIndexes?: 通过索引获取对应的 code。可挑选需要的 code
**/
export declare const genNaturalTSContextFromJSONForUI: (tsContextJSON: any, codeType: 'detail' | 'short', requiredIndexes?: string[]) => string;
export declare function genNaturalTSContextForUI(app: App, currentNode: BaseNode, focusedNodePath?: string, requiredIndexes?: string[], material?: {
basicMaterials: 'pc' | 'h5' | {
json: any;
tsDeclaration: string;
allNodesAPI: any;
};
extensionMaterials: 'pc' | 'h5' | {
name: string;
title: string;
description: string;
tsDescription: string;
}[];
moduleInterfaces: any;
connectors: any;
dependencies: any;
}, restParams?: {
codeType: 'detail' | 'short';
typeMap?: any;
notUseBasicMaterial?: boolean;
}): string;
//# sourceMappingURL=genNaturalTS.d.ts.map