import { Artefacts, BuildSettings } from './types'; import { BuildFormat } from './formats'; interface BuildSuccess { status: 0; warnings: Array; } interface BuildFailure { status: 1; warnings: Array; errors: Array; } export type BuildResult = BuildSuccess | BuildFailure; /** * Simple build function to compile a Pd patch into compiled code * that can be directly run into a web app. * * Throws an error if the build fails. * * @see performBuildStep */ export declare const buildRunnable: (pdFile: string, format: 'javascript' | 'wasm', settings: BuildSettings) => Promise; export declare const defaultSettingsForBuild: () => BuildSettings; /** * @returns an empty artefacts object. */ export declare const createArtefacts: () => Artefacts; /** * Helper to unpack an artefact from an ArrayBuffer into its correct format. * Useful for example to load artefacts from files or http requests. * * @returns a new artefacts object. */ export declare const loadArtefact: (artefacts: Artefacts, artefactBuffer: ArrayBuffer, artefactFormat: BuildFormat) => Artefacts; /** * A helper to perform a build step on a given artefacts object. * If the build is successful, the artefacts object is updated in place with * the newly built artefact. * * Beware that this can only build one step at a time. If targetting a given format * requires multiple steps, you need to call this function multiple times with intermediate targets. * * @see fromPatch * * @param artefacts * @param target * @param settings */ export declare const performBuildStep: (artefacts: Artefacts, target: BuildFormat, { nodeBuilders, nodeImplementations, audioSettings, renderAudioSettings, io, abstractionLoader, }: BuildSettings) => Promise; export {};