UNPKG

@eliseev_s/tolk-tlb-transpiler

Version:

Transpile Tolk structs to TLB definitions and generate TypeScript wrappers for TON blockchain smart contracts

145 lines 4.09 kB
import type { WrapperGeneratorConfig } from './types'; export declare class WrapperGenerator { private config; private additionalImports; private utilityTypes; private wrapperClass; private typescriptCode; constructor(config: WrapperGeneratorConfig); /** * Create and initialize a ready-to-use WrapperGenerator instance * * @param config - Configuration for the wrapper generator * @returns Promise resolving to initialized WrapperGenerator instance */ static create(config: WrapperGeneratorConfig): Promise<WrapperGenerator>; /** * Initialize wrapper generator with TypeScript code generation */ private initialize; /** * Format TLB definitions into a readable string format */ private formatTlbDefinitions; /** * Generate additional imports needed for wrapper */ private generateImports; /** * Generate utility types for send methods */ private generateUtilityTypes; /** * Generate wrapper class */ private generateWrapperClass; /** * Render the complete wrapper code */ render(): string; /** * Get the generated TypeScript code */ getTypescriptCode(): string; /** * Get the generated wrapper class code */ getWrapperCode(): string; /** * Get the formatted TLB definitions */ getTlbString(): string; /** * Generate additional imports needed for wrapper (avoiding duplicates) */ private static generateAdditionalImports; /** * Generate utility types for send methods */ private static generateUtilityTypes; /** * Generate class declaration */ private static generateClassDeclaration; /** * Generate createFromAddress method */ private static generateCreateFromAddress; /** * Generate createFromConfig method */ private static generateCreateFromConfig; /** * Generate sendDeploy method */ private static generateSendDeploy; /** * Generate send method for internal message */ private static generateSendMethod; /** * Generate static create body method for internal message */ private static generateCreateBodyMethod; /** * Generate get method */ private static generateGetMethod; /** * Generate flat list of stack arguments for a parameter type. * Structs are flattened into sequential arguments for each field. * Nested structs are also flattened recursively. */ private static generateStackArgumentsFlat; /** * Generate stack argument for get method parameter (single atomic type) */ private static generateStackArgument; /** * Generate stack reader for return type */ private static generateStackReader; /** * Generate stack reader for struct type */ private static generateStackReaderForStruct; /** * Generate stack reader for struct field type (handles special cases for struct compatibility) */ private static generateStructFieldStackReader; /** * Generate reader for nullable field using loadMaybe */ private static generateNullableFieldReader; /** * Extract send methods from internal message union type name */ private static extractSendMethods; /** * Generate class end */ private static generateClassEnd; /** * Capitalize first letter */ private static capitalize; /** * Convert snake_case to camelCase */ private static snakeToCamelCase; /** * Convert method name to camelCase (handles both snake_case and PascalCase) */ private static normalizeMethodName; /** * Extract opcodes map from internal message union type */ private static extractOpcodesMap; /** * Generate static opcodes map */ private static generateOpcodesMap; private static generateDictValueCodec; private static collectAllMapTypes; } //# sourceMappingURL=wrapper-generator.d.ts.map