import { Cell } from '@ton/core'; import { CompilableConfig, CompilerConfig } from './CompilerConfig'; import { FuncCompileResult } from './func/compile.func'; import { TactCompileResult } from './tact/compile.tact'; import { TolkCompileResult } from './tolk/compile.tolk'; import { SupportedLang } from './SupportedLang'; export declare function getCompilablesDirectory(): Promise; export declare function extractCompilableConfig(path: string): CompilableConfig; export declare const COMPILE_END = ".compile.ts"; /** * Retrieves the compiler configuration for a specific contract. * * This function checks if a Tact configuration exists for the given contract * `tact.config.json`. If found, it returns that configuration. Otherwise, it falls back * to loading and extracting the `.compile.ts` configuration file from the appropriate * compilables directory (`compilables/` or `wrappers/`). * * @param {string} name - The name of the contract * * @throws Error Throws if configuration is invalid or not found. * * @example * const config = await getCompilerConfigForContract('MyContract'); * console.log('Compiler config:', config); */ export declare function getCompilerConfigForContract(name: string): Promise; export type CompileResult = TactCompileResult | FuncCompileResult | TolkCompileResult; export declare function getCompilerOptions(config: CompilerConfig): Promise<{ lang: SupportedLang; version: string; }>; export declare function libraryCellFromCode(code: Cell): Cell; export declare function doCompile(name: string, opts?: CompileOpts): Promise; /** * Optional compilation settings, including user data passed to hooks */ export type CompileOpts = { /** * Any user-defined data that will be passed to both `preCompileHook` and `postCompileHook`. */ hookUserData?: any; debugInfo?: boolean; buildLibrary?: boolean; }; /** * Compiles a contract using the specified configuration for `tact`, `func`, or `tolk` languages. * * This function resolves the appropriate compiler configuration for a given contract name, * runs any defined pre-compile and post-compile hooks, and returns the resulting compiled code * as a [Cell]{@link Cell}. * * @param {string} name - The name of the contract to compile. This should correspond to a * file named `.compile.ts` in the `compilables` or `wrappers` directory. * @param {CompileOpts} [opts] - Optional compilation options, including user data passed to hooks. * * @returns {Promise} A promise that resolves to the compiled contract code as a `Cell`. * * @example * import { compile } from '@ton/blueprint'; * * async function main() { * const codeCell = await compile('Contract'); * console.log('Compiled code BOC:', codeCell.toBoc().toString('base64')); * } * * main(); */ export declare function compile(name: string, opts?: CompileOpts): Promise; export type { TactCompileResult, TolkCompileResult, FuncCompileResult };