import type { Plugin as EsbuildPlugin } from 'esbuild'; export type DankMode = 'build' | 'preview' | 'serve'; export type DankDetails = { dev: boolean; production: boolean; mode: DankMode; }; export type DankConfigFunction = (dank: DankDetails) => Partial | Promise>; export declare function defineConfig(config: Partial): Partial; export declare function defineConfig(config: DankConfigFunction): DankConfigFunction; export type DankConfig = { buildTag?: string | BuildTagBuilder; esbuild?: EsbuildConfig; pages: Record<`/${string}`, `${string}.html` | PageMapping>; devPages?: Record<`/__${string}`, `${string}.html` | DevPageMapping>; port?: number; previewPort?: number; services?: Array; serviceWorker?: ServiceWorkerBuilder; afterBuild?: AfterBuild; }; export type BuildTagParams = { production: boolean; }; export type BuildTagBuilder = (build: BuildTagParams) => Promise | string; export type PageMapping = { pattern?: RegExp; webpage: `${string}.html`; }; export type DevPageMapping = { label: string; webpage: `${string}.html`; }; export type DevService = { label?: string; command: string; cwd?: string; env?: Record; http?: { port: number; }; }; export type EsbuildConfig = { loaders?: Record<`.${string}`, EsbuildLoader>; plugins?: Array; port?: number; }; export type EsbuildLoader = 'base64' | 'binary' | 'copy' | 'dataurl' | 'empty' | 'file' | 'json' | 'text'; export type WebsiteManifest = { buildTag: string; files: Array<`/${string}`>; pageUrls: Array<`/${string}`>; }; export type ServiceWorkerParams = { website: WebsiteManifest; }; export type ServiceWorkerBuild = { outputs: Array<{ url: `/${string}.js`; content: string; }>; }; export type ServiceWorkerBuilder = (params: ServiceWorkerParams) => ServiceWorkerBuild | Promise; export { createServiceWorker, type ServiceWorkerCaching, } from './service_worker.ts'; export type AfterBuildArgs = { website: WebsiteManifest; }; export type AfterBuild = (args: AfterBuildArgs) => Promise | void;