UNPKG

@eliseev_s/tolk-tlb-transpiler

Version:

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

46 lines 1.7 kB
import type { TolkType } from './types'; /** * Convert Tolk type to TypeScript type string */ export declare function tolkTypeToTSType(type: TolkType): string; /** * Check if a width value represents a "small" integer (fits in number) */ export declare function isSmallInt(width: number): boolean; /** * Convert Tolk type to store function name */ export declare function tolkTypeToStoreName(type: TolkType): string; /** * Get numeric width from a type if it's an int/uint type */ export declare function getIntWidth(type: TolkType): number | null; /** * Generate TypeScript type for number/bigint based on width */ export declare function getNumericTSType(width: number): 'number' | 'bigint'; /** * Generate Dictionary key descriptor (for @ton/core) * @ton/core has different methods for small vs big integers: * - Int(bits) / Uint(bits) for <= 32 bits (returns DictionaryKey<number>) * - BigInt(bits) / BigUint(bits) for > 32 bits (returns DictionaryKey<bigint>) */ export declare function generateDictKeyDescriptor(keyType: TolkType): { expr: string; ts: string; }; /** * Generate a compact identifier for a type (for generated variable names) * For int types, includes signedness to distinguish int32 from uint32 */ export declare function getTypeIdentifier(type: TolkType): string; /** * Generate dictionary loader function name */ export declare function getDictLoaderName(keyType: TolkType, valueType: TolkType): string; /** * Extract key bit width from map key type for HashmapE generation * Returns null if the key type is not supported */ export declare function getMapKeyBitWidth(keyType: TolkType): number | null; //# sourceMappingURL=type-converters.d.ts.map