import build, { type NetlifyConfig, type OnPostBuild, type Logs } from '@netlify/build'; import type { MinimalHeader } from '@netlify/headers-parser'; import type { OptionValues } from 'commander'; import type { MinimalAccount, EnvironmentVariables, Plugin, SiteInfo } from '../utils/types.js'; import type { EdgeFunctionDeclaration } from './edge-functions/proxy.js'; export interface CachedConfig { accounts: MinimalAccount[] | undefined; buildDir: string; env: EnvironmentVariables; repositoryRoot: string; siteInfo: SiteInfo; api?: unknown; branch?: unknown; config: { build: { base: string; command?: string | undefined; functions?: string | undefined; functionsSource?: string | undefined; edge_functions?: string | undefined; environment: Record; processing: { css: Record; html: Record; images: Record; js: Record; }; publish: string; publishOrigin: string; services: Record; }; dev?: undefined | { command?: string | undefined; functions?: string | undefined; functionsPort?: number | undefined; https?: { certFile: string; keyFile: string; } | undefined; processing: { html?: { injections?: { /** * The location at which the `html` will be injected. * Defaults to `before_closing_head_tag` which will inject the HTML before the tag. */ location?: 'before_closing_head_tag' | 'before_closing_body_tag'; /** * The injected HTML code. */ html: string; }[]; }; }; }; db?: { migrations?: { path?: string; }; }; edge_functions?: EdgeFunctionDeclaration[]; functions?: NetlifyConfig['functions']; functionsDirectory?: undefined | string; headers: MinimalHeader[]; images: { remote_images: string[]; }; plugins?: Plugin[]; redirects: undefined | NetlifyConfig['redirects']; }; configPath?: undefined | string; context: string; headersPath?: unknown; logs?: unknown; redirectsPath?: unknown; token?: unknown; } export interface DefaultConfig { build: { command?: string | undefined; commandOrigin?: 'default' | undefined; publish?: string | undefined; publishOrigin?: 'default' | undefined; }; plugins?: { package: unknown; origin: 'default'; }[]; } export type RunBuildOptions = Omit[0]>, 'cachedConfig'> & { cachedConfig: CachedConfig; defaultConfig: DefaultConfig | Record; edgeFunctionsBootstrapURL: string; }; interface HandlerResult { newEnvChanges?: Record; configMutations?: Record; status?: string; } export type PatchedHandlerType void | Promise> = (opts: Parameters[0]) => HandlerResult | Promise; export declare const getRunBuildOptions: ({ cachedConfig, currentDir, defaultConfig, deployHandler, deployId, options: { alias, context, cwd, debug, dry, json, offline, silent }, packagePath, skewProtectionToken, token, }: { cachedConfig: CachedConfig; currentDir: string; defaultConfig?: undefined | DefaultConfig; deployHandler?: PatchedHandlerType; deployId?: string; options: OptionValues; packagePath?: string; skewProtectionToken?: string; token?: null | string; }) => Promise; export declare const logsAreBuffered: (logs: unknown) => logs is Logs; export declare const runBuild: (options: RunBuildOptions) => Promise<{ exitCode: number; newConfig: NetlifyConfig; configMutations: Record; logs?: Logs; }>; export {}; //# sourceMappingURL=build.d.ts.map