import type { AsyncMode as WITAsyncMode, InstantiationMode as WITInstantiationMode } from '../vendor/js-component-bindgen-component.js';
import { type OptimizeOptions } from './opt.js';
/** Instantiation mode for a transpiled component */
export type InstantiationMode = 'async' | 'sync';
/** Async mode for the component (i.e. whether to use JSPI) */
export type AsyncMode = 'sync' | 'jspi';
/** Options for transpilation */
export interface TranspilationOptions {
    /** Name of the component */
    name?: string;
    /**
     * Instantiation mode
     *
     * This determines whether importing the module instantiates it or not,
     * which influeces whether imports can be supplied dynamically at instantiation
     * time or not.
     */
    instantiation?: InstantiationMode | WITInstantiationMode;
    /** How to import bindings */
    importBindings?: 'js' | 'optimized' | 'hybrid' | 'direct-optimized';
    /**
     * Mapping of imports that will be used for transpilation
     *
     * ```
     * map: {
     *     'wasi:cli/*': '@bytecodealliance/preview2-shim/cli#*',
     *     ...
     * }
     * ```
     */
    map?: Record<string, string>;
    /** Asynchronous mode to use */
    asyncMode?: AsyncMode | WITAsyncMode;
    /**
     * Imports that should be treated as asynchronous *host side* functions
     *
     * This option works in conjunction with `asyncMode` set to `'jspi'`
     */
    asyncImports?: string[];
    /**
     * Exports that should be treated as asynchronous Wasm functions to the Host that
     * calls them.
     *
     * This option works in conjunction with `asyncMode` set to `'jspi'`
     */
    asyncExports?: string[];
    /**
     * WASI imports that should be marked as asynchronous
     *
     * @see: `asyncImports`
     */
    asyncWasiImports?: string[];
    /**
     * WASI exports that should be marked as asynchronous
     *
     * @see: `asyncExports`
     */
    asyncWasiExports?: string[];
    /** Whether the valid lifting optimization should be performed */
    validLiftingOptimization?: boolean;
    /** Enable/disable tracing for debug purposes */
    tracing?: boolean;
    /** Enable/disable NodeJS compat */
    nodejsCompat?: boolean;
    /** Enable/disable Top Level Await ("TLA") compat */
    tlaCompat?: boolean;
    /** Cutoff of base64 content in the binary */
    base64Cutoff?: number;
    /**
     * Whether to generate the code for ASM.js, with a separate instantiate function
     *
     * @see `generateASMJS()`
     */
    js?: boolean;
    /** Whether to perform minification of the JS */
    minify?: boolean;
    /** Whether to optimize the WebAssembly binary with wasm-opt */
    optimize?: boolean;
    /** Arguments to wasm-opt */
    optimizeOptions?: OptimizeOptions;
    /** Whether to use namespaced exports */
    namespacedExports?: boolean;
    /** Output directory */
    outDir?: string;
    /** Whether to use multi memory support */
    multiMemory?: boolean;
    /** Whether to enable WebIDL imports */
    experimentalIdlImports?: boolean;
    /** Whether to shim WASI imports */
    wasiShim?: boolean;
    /** Whether to emit Typescript declaration files */
    emitTypescriptDeclarations?: boolean;
    /** Whether to create a stub */
    stub?: boolean;
    /** Whether to run bindgen in strict mode */
    strict?: boolean;
}
interface TranspilationResult {
    files: Record<string, Uint8Array>;
    imports: string[];
    exports: [string, 'function' | 'instance'][];
}
/**
 * Transpile a provided WebAssembly component to an ES module
 * that can be run in JS environments
 *
 * @param componentPath
 * @param [opts]
 * @returns A `Promise` that resolves to the result (generated files, etc) of the transpilation
 */
export declare function transpile(componentPath: string, opts?: TranspilationOptions): Promise<TranspilationResult>;
/**
 * Perform transpilation, using the transpiled js-component-bindgen Rust crate.
 *
 * @param component - component bytes
 * @param [opts] - transpilation options
 * @returns A `Promise` that resolves to the results of transpilation
 */
export declare function transpileBytes(component: Uint8Array, opts?: TranspilationOptions): Promise<TranspilationResult>;
export {};
