@eliseev_s/tolk-tlb-transpiler
Version:
Transpile Tolk structs to TLB definitions and generate TypeScript wrappers for TON blockchain smart contracts
69 lines • 2.73 kB
TypeScript
import type { TLBDefinition } from './types';
/**
* Format TLB definitions into a readable string format
*
* @param definitions - Array of TLB definitions
* @param options - Formatting options
* @returns Formatted TLB string
*/
export declare function formatTlbDefinitions(definitions: TLBDefinition[], headerComment?: string | null): string;
/**
* Get statistics about TLB definitions
*
* @param definitions - Array of TLB definitions
* @returns Statistics object
*/
export declare function getTlbStats(definitions: TLBDefinition[]): {
totalDefinitions: number;
totalConstructors: number;
definitionNames: string[];
};
/**
* Transpile Tolk code and return TLB definitions
*
* @param tolkCode - The Tolk source code
* @returns Promise resolving to TLB definitions
*/
export declare function transpileTolkToTlbDefinitions(tolkCode: string): Promise<TLBDefinition[]>;
/**
* Transpile Tolk file with import resolution and return TLB definitions
*/
export declare function transpileTolkFileToTlbDefinitions(entryFilePath: string): Promise<TLBDefinition[]>;
/**
* Transpile Tolk code and return formatted TLB string
*
* @param tolkCode - The Tolk source code
* @param formatOptions - Optional formatting options
* @returns Promise resolving to formatted TLB string
*/
export declare function transpileTolkToTlb(tolkCode: string, formatOptions?: Parameters<typeof formatTlbDefinitions>[1]): Promise<string>;
/**
* Generate TypeScript wrapper with TLB types for smart contract interaction
*
* @param tolkStructuresCode - Tolk code containing struct definitions
* @param tolkGetMethodsCode - Tolk code containing get method definitions
* @param contractName - Name of the contract (e.g., "Minter")
* @returns Object with TLB definitions, TypeScript code, and wrapper code
*/
export declare function generateContractWrapper(tolkStructuresCode: string, tolkGetMethodsCode: string, contractName: string): Promise<{
tlbDefinitions: TLBDefinition[];
tlbString: string;
typescriptCode: string;
wrapperCode: string;
fullCode: string;
}>;
/**
* Generate TypeScript wrapper with TLB types using Tolk files (supports imports)
*
* @param structuresPath - Path to Tolk file with struct definitions (supports imports)
* @param getMethodsPath - Path to Tolk file with get methods (can import structs)
* @param contractName - Name of the contract (e.g., "Minter")
*/
export declare function generateContractWrapperFromFiles(structuresPath: string, getMethodsPath: string, contractName: string): Promise<{
tlbDefinitions: TLBDefinition[];
tlbString: string;
typescriptCode: string;
wrapperCode: string;
fullCode: string;
}>;
//# sourceMappingURL=handlers.d.ts.map