/// import { Metadata } from './types'; import { CreateBundleResult } from 'packherd'; export declare const BUNDLE_WRAPPER_OPEN: Buffer; export declare const BUNDLE_WRAPPER_CLOSE: Buffer; export declare type CreateBundleOpts = { baseDirPath: string; entryFilePath: string; bundlerPath: string; nodeModulesOnly: boolean; deferred?: string[]; norewrite?: string[]; includeStrictVerifiers?: boolean; sourcemap?: boolean; sourcemapExternalPath?: string; sourcemapEmbed: boolean; sourcemapInline: boolean; }; export declare type CreateSnapshotScriptOpts = CreateBundleOpts & { resolverMap?: Record; auxiliaryData?: Record; nodeEnv: string; }; export declare type CreateSnapshotScript = (opts: CreateSnapshotScriptOpts) => Promise<{ snapshotScript: string; }>; /** * Assembles a snapshot script for the provided bundle configured for the * provided meta data, basedir and opts. * * @param bundle contents of the bundle created previously * @param basedir project root directory * @param entryFilepath * @param opts * * @return the contents of the assembled script */ export declare function assembleScript(bundle: Buffer, basedir: string, entryFilePath: string, opts: { auxiliaryData?: Record; entryPoint?: string; includeStrictVerifiers?: boolean; sourceMap?: Buffer; sourcemapEmbed: boolean; sourcemapInline: boolean; sourcemapExternalPath: string | undefined; nodeEnv: string; resolverMap?: Record; meta?: Metadata; }): { script: Buffer; processedSourceMap?: string; }; /** * Creates bundle and meta file via the provided bundler written in Go * and reads and returns its contents asynchronously. * * @param opts * @return promise of the paths and contents of the created bundle and related metadata */ export declare function createBundleAsync(opts: CreateBundleOpts): Promise<{ warnings: CreateBundleResult['warnings']; meta: Metadata; bundle: Buffer; sourceMap?: Buffer; }>; /** * Creates a bundle for the provided entry file and then assembles a * snapshot script from them. * * @param opts * @return the paths and contents of the created bundle and related metadata * as well as the created snapshot script */ export declare function createSnapshotScript(opts: CreateSnapshotScriptOpts): Promise<{ snapshotScript: Buffer; meta: Metadata; bundle: Buffer; }>;