/**
 * Configuration for `compile.mode: 'monolith'` — a single package that hosts
 * many logical modules under `src/modules/<name>/`, cross-referenced through
 * `#module` package.json `imports` aliases and published with per-module
 * subpath exports plus platform-conditional shims.
 *
 * The monolith pipeline: layout sync (regenerate imports/paths/barrels/shims
 * from this config) → esbuild library compile with computed entries →
 * declaration import rewriting. See `monolithCompileLayout.ts`.
 */
/**
 * One or more star-reexport targets for barrel/shim/facade config.
 * Arrays emit multiple `export * from '…'` lines in order.
 */
export type MonolithReexportTargets = string | string[];
/**
 * Per-platform files copied into the monolith output without compilation.
 * The outer key is a dist platform (`neutral`, `node`, or `browser`); each
 * inner key is both the path under `dist/<platform>/` and the suggested public
 * package subpath. Values are package export specifiers or filesystem paths
 * resolved from the compiling package.
 */
export type MonolithCopyEntries = Partial<Record<'browser' | 'neutral' | 'node', Record<string, string>>>;
/** One umbrella module living at `src/modules/<name>/`. */
export interface MonolithModuleConfig {
    /** Re-export from the master barrel (`src/index.ts`). */
    barrel?: boolean;
    /**
     * Override the barrel re-export target(s) (default `#<name>`, or
     * {@link reexport} when set). Arrays emit multiple star re-exports.
     */
    barrelFrom?: MonolithReexportTargets;
    /** Emit a root subpath shim `src/<name>.ts` (becomes a dist subpath export). */
    export?: boolean;
    /** Only usable via `#imports` inside the package; no shim, no barrel. */
    internal?: boolean;
    /** Module has a `model.ts` type barrel (adds `#<name>/model` and `src/<name>.model.ts`). */
    model?: boolean;
    /** Directory name under `src/modules/`. */
    name: string;
    /**
     * Facade mode: this module is only star re-exports of external package
     * subpaths (e.g. `'@scope/pkg/hooks'` or a list for dual packages).
     * Layout sync generates `src/modules/<name>/index.ts`, and barrel/shim
     * targets default to these package specifiers so compiled `.mjs` stays
     * pure `export * from` (no esbuild `__reExport` helpers).
     */
    reexport?: MonolithReexportTargets;
    /**
     * Override the subpath shim re-export target(s) (default `#<name>`, or
     * {@link reexport} when set). Arrays emit multiple star re-exports.
     */
    shimFrom?: MonolithReexportTargets;
    /**
     * Extra value subpaths backed by `src/modules/<name>/<sub>.ts` files —
     * each adds `#<name>/<sub>`, a `src/<name>.<sub>.ts` shim, and a
     * `<name>.<sub>` dist entry (the value-export analogue of `model`).
     */
    subpaths?: string[];
}
/** Master barrel (`src/index.ts`) options. */
export interface MonolithIndexConfig {
    /**
     * The master barrel is hand-written — layout sync neither generates nor
     * drift-checks `src/index.ts`. Use when the barrel carries content the
     * generator cannot express (curated plugin arrays, a default export).
     * The file may use `#module` specifiers like any module source.
     */
    custom?: boolean;
    /**
     * Per-platform master barrel entry override, relative to `src/`
     * (default `./index.ts`), e.g. `{ browser: './index-browser.ts',
     * node: './index-node.ts' }` when a platform's barrel excludes
     * platform-incompatible modules. Output keeps the file's basename
     * (`dist/browser/index-browser.mjs`), so point the package `exports`
     * conditions at those names. Overridden files are hand-written (layout
     * sync never generates them); combine with `custom` when no platform
     * uses the default `src/index.ts` at all.
     */
    entries?: Record<string, string>;
}
/** Platform-conditional `#import`: package.json conditions + tsconfig fallback. */
export interface MonolithConditionalImportConfig {
    /**
     * Condition → dist path used for the package.json `imports` entry when
     * `moduleLinkage: 'external'`, e.g.
     * `{ node: './dist/node/hash.mjs', default: './dist/browser/hash.mjs' }`.
     * Required in external mode; ignored otherwise. Key order is preserved.
     */
    distImports?: Record<string, string>;
    /**
     * Condition → src path, e.g.
     * `{ node: './src/modules/platform/node/index.ts', default: './src/modules/platform/index-neutral.ts' }`.
     * Key order is preserved in the generated package.json `imports` entry.
     */
    package: Record<string, string>;
    /** Single src path used for the generated tsconfig `paths` (type-check fallback). */
    tsconfig: string;
}
export interface MonolithConfig {
    /** Extra `#alias` → src path imports (e.g. `'#object/index-un-deprecated'`). */
    aliasImports?: Record<string, string>;
    /**
     * External package specifiers re-exported from the master barrel before the
     * module lines (bare packages sort ahead of `#` imports), e.g.
     * `['@xyo-network/sdk-protocol']` emits
     * `export * from '@xyo-network/sdk-protocol'`. Bare package imports stay
     * external in the compiled output and resolve through node_modules.
     */
    barrelImports?: string[];
    /**
     * Platforms that compile the master barrel entry (`./index.ts`).
     * Defaults to every active platform. Restrict when the `.` export only
     * has conditions for some platforms so no unexported barrel is emitted.
     */
    barrelPlatforms?: string[];
    /** Per-import platform-conditional package.json `imports` entries. */
    conditionalImports?: Record<string, MonolithConditionalImportConfig>;
    /** Opaque runtime entries copied into `dist` after compilation. */
    copyEntries?: MonolithCopyEntries;
    /** Master barrel options: hand-written index, per-platform entry files. */
    index?: MonolithIndexConfig;
    /**
     * How cross-module `#imports` are linked in the compiled output.
     * `bundle` (default) inlines every referenced module into each entry —
     * self-contained files, but shared code is duplicated across entries so
     * object identity does not hold between subpaths. `external` keeps
     * `#module` specifiers in the emitted `.mjs` and resolves them at runtime
     * through a dist-pointing package.json `imports` map — each module has one
     * canonical bundle per platform, preserving `instanceof`/singleton
     * semantics across subpath imports (matches a real multi-package graph).
     * @default 'bundle'
     */
    moduleLinkage?: 'bundle' | 'external';
    modules: MonolithModuleConfig[];
    /**
     * Which platform hosts the per-module subpath entries (the `src/<name>.ts`
     * shims and, when any module declares a model, the model barrel).
     * `neutral` for platform-agnostic libraries; `browser` for React packages.
     * @default 'neutral'
     */
    modulesPlatform?: string;
    /**
     * Per-platform extra entry shims: platform → shim name → re-export target
     * (relative to the generated `src/<platform>/<name>.ts` file), e.g.
     * `{ node: { platform: '../modules/platform/node/index.ts' } }`.
     */
    platformEntries?: Record<string, Record<string, string>>;
    /**
     * Platforms to build. Every listed platform gets at least the master
     * barrel entry (`./index.ts`); `modulesPlatform` additionally gets the
     * module subpath entries, and `platformEntries` add their shims.
     * @default ['neutral', 'node', 'browser']
     */
    platforms?: string[];
}
//# sourceMappingURL=MonolithConfig.d.ts.map