import type { BuildOptions } from 'esbuild';
export type EntryMode = 'all' | 'single' | 'auto' | 'platform' | 'custom';
/**
 * Configuration for specifying which paths are targeted.
 */
export interface PathConfig {
    /**
     * Glob patterns to exclude (takes precedence over include).
     */
    exclude?: string[];
    /**
     * Glob patterns to include.
     */
    include?: string[];
}
/**
 * Configuration for Dynamic Share.
 */
export interface DynamicShareConfig extends PathConfig {
}
/**
 * Configuration for Live Share.
 */
export interface LiveShareConfig extends PathConfig {
}
export interface CompileConfig {
    bundleTypes?: boolean;
    /** @param entryMode all, single, custom, platform, or auto */
    entryMode?: EntryMode;
    /** @param when building types with tsc, should it use the outDir to write to? */
    outDirAsBuildDir?: boolean;
    /**
     * When true (default), `xy compile` runs `tsc -p tsconfig.json` as a
     * no-emit pre-pass to validate every TypeScript file in the package,
     * including specs, stories, configs, and .storybook/. Set to false to
     * skip — useful as a temporary escape hatch while migrating a package.
     */
    validate?: boolean;
}
export type PackageCompileEntryOptions = BuildOptions & Record<string, unknown> & {
    /**
     * Extra entries relative to the platform source directory. This preserves the
     * old tsup-style `entry` field used by existing xy.config.ts files.
     */
    entry?: string[];
    /** @deprecated Use esbuild's `outdir` or the default platform output layout. */
    outDir?: string;
};
export type LegacyPackageCompileOptions = PackageCompileEntryOptions & Record<string, unknown>;
export type PackageCompileEsbuildConfig = CompileConfig & {
    browser?: Record<string, LegacyPackageCompileOptions> | boolean;
    esbuild?: {
        options?: PackageCompileEntryOptions;
    };
    neutral?: Record<string, LegacyPackageCompileOptions> | boolean;
    node?: Record<string, LegacyPackageCompileOptions> | boolean;
    /** @deprecated Use `esbuild.options` instead. Shared fields are still honored. */
    tsup?: {
        options?: LegacyPackageCompileOptions;
    };
    verbose?: boolean;
};
/** @deprecated Use PackageCompileEsbuildConfig. */
export type PackageCompileTsupConfig = PackageCompileEsbuildConfig;
export type PackageCompileTscConfig = CompileConfig & {
    mode: 'tsc';
};
/**
 * How deplint should classify a dependency.
 * - `dep`: must stay in `dependencies` (never promoted to peerDependencies)
 * - `peer`: should be treated as a peerDependency (overrides a parent `dep` setting)
 * - `dev`: must only appear in `devDependencies`; flagged as misplaced if found in `dependencies` or `peerDependencies`
 */
export type DeplintRefType = 'dep' | 'dev' | 'peer';
/**
 * Per-package configuration within deplint.
 */
export interface DeplintPackageConfig {
    /**
     * Force `peerDependenciesMeta[<name>].optional` when this package is added
     * to `peerDependencies`. Omit (default) to auto-derive from the requiring
     * dependencies' own `peerDependenciesMeta` — optional only when every
     * requiring source marks it optional.
     */
    peerOptional?: boolean;
    /** How this dependency should be classified. */
    refType?: DeplintRefType;
}
export type DeplintRuleLevel = 'error' | 'off' | 'warn';
export interface DeplintRuleCommonOptions {
    /**
     * Package names or glob patterns to suppress for this rule.
     * Examples: `react`, `@scope/*`.
     */
    ignore?: string[];
}
export interface DeplintPeerRangeStyleRuleOptions extends DeplintRuleCommonOptions {
    /**
     * Broad peer range upper-bound style. Setting this implies
     * `form: "broad"` for backward compatibility.
     * - `infer` keeps the current behavior: `~` devDeps use a minor bound,
     *   everything else uses a major bound.
     * - `major` always uses `<next-major>`.
     * - `minor` always uses `<next-minor>`.
     */
    bound?: 'infer' | 'major' | 'minor';
    /**
     * Peer range style to enforce.
     * - `shorthand` rejects broad comparator ranges like `>=1.2.3 <2`
     *   and fixes them to compact semver shorthand like `^1.2` or `~1.2`.
     * - `broad` enforces the legacy comparator form.
     * @default "shorthand"
     */
    form?: 'broad' | 'shorthand';
}
export interface DeplintWorkspaceProtocolRuleOptions extends DeplintRuleCommonOptions {
    /**
     * Workspace protocol value to write with `xy deplint --fix`.
     * When set explicitly, the rule also enforces this exact value.
     * @default "workspace:~"
     */
    protocol?: 'workspace:*' | 'workspace:^' | 'workspace:~';
}
export type DeplintRuleConfig<TOptions extends object = DeplintRuleCommonOptions> = DeplintRuleLevel | [DeplintRuleLevel, TOptions];
export interface DeplintRulesConfig {
    [ruleId: string]: DeplintRuleConfig | undefined;
    'deplint.peerDependencies.range-style'?: DeplintRuleConfig<DeplintPeerRangeStyleRuleOptions>;
    'deplint.workspace.protocol'?: DeplintRuleConfig<DeplintWorkspaceProtocolRuleOptions>;
}
/**
 * Configuration for deplint (dependency linting).
 */
export interface DeplintConfig {
    /**
     * Workspace-relative file or directory globs to exclude from source scanning.
     * Use this for generated build output such as Electron release folders.
     */
    exclude?: string[];
    /**
     * Per-dependency configuration keyed by package name.
     * Cascades from root to package configs (maps are merged, with
     * package-level entries overriding root-level entries for the same key).
     */
    packages?: Record<string, DeplintPackageConfig>;
    /**
     * Additional deplint rule plugins to load.
     * Entries may be package names, absolute paths, or paths relative to the
     * current working directory.
     */
    plugins?: string[];
    /**
     * ESLint-style rule configuration keyed by rule id.
     *
     * Examples:
     * ```ts
     * rules: {
     *   'deplint.dependencies.unused': 'off',
     *   'deplint.peerDependencies.range-style': ['warn', { form: 'broad', ignore: ['react'], bound: 'major' }],
     *   'deplint.workspace.protocol': ['error', { protocol: 'workspace:^' }],
     * }
     * ```
     *
     * Root and package-level configs are merged by rule id; when the same rule
     * is configured in a package, its entry replaces the root entry.
     * Unconfigured rules default to warning severity and do not fail `xy deplint`.
     */
    rules?: DeplintRulesConfig;
    /**
     * Treat this package as terminal (an app or CLI, not a library).
     * Terminal packages send unsatisfied runtime peers to `dependencies`
     * instead of `peerDependencies`, and are exempt from the library
     * peer-promotion rule.
     *
     * Auto-detected when `private: true`, or when the package looks like a
     * bundled CLI (has `bin`, no `main`/`module`, and `exports` either
     * missing or limited to `.`/`./package.json`/`./README.md`). Set this
     * explicitly when neither auto-detection fires — e.g. a published CLI
     * with library-shaped exports.
     */
    terminal?: boolean;
}
/**
 * Canonical names for individually toggleable publint checks.
 */
export type PublintCheckName = 'files' | 'importToDefault' | 'main' | 'module' | 'peerDeps' | 'publint' | 'resolutions' | 'rootSource' | 'rootTypes' | 'sideEffects' | 'source' | 'types';
export declare const ALL_PUBLINT_CHECKS: PublintCheckName[];
/** Checks that only apply to published (non-private) packages */
export declare const PUBLISH_ONLY_CHECKS: PublintCheckName[];
/**
 * Configuration for publint (package publishing linting).
 */
export interface PublintConfig {
    /**
     * Check names to exclude from publint runs.
     * All checks run by default; listed names are skipped.
     * Cannot be used together with `include`.
     */
    exclude?: PublintCheckName[];
    /**
     * Check names to include (whitelist) in publint runs.
     * Only listed checks will run; all others are skipped.
     * Cannot be used together with `exclude`.
     */
    include?: PublintCheckName[];
    /**
     * Whether to run `pack` when invoking the publint library.
     * When true (default), the package manager is used to determine which
     * files would be published. Set to false to skip packing for faster runs.
     */
    pack?: boolean;
}
/**
 * Configuration for packman lint (package manager config linting).
 */
export interface PackmanConfig {
    /**
     * Minimum age in minutes that a package must be published before pnpm will install it.
     * Only applies when pnpm is the detected package manager.
     * @default 4320 (3 days)
     */
    minimumReleaseAge?: number;
    /**
     * Package patterns to exclude from the minimumReleaseAge requirement.
     * These packages can be installed immediately upon release.
     * Supports exact names and scoped wildcards (e.g. '@myorg/*').
     * @default ["'@xylabs/*'", "'@xyo-network/*'"]
     */
    minimumReleaseAgeExclude?: string[];
}
/**
 * Command-specific configuration that cascades from root to package.
 * Settings here override the legacy top-level equivalents.
 */
export interface CommandsConfig {
    deplint?: DeplintConfig;
    packman?: PackmanConfig;
    publint?: boolean | PublintConfig;
}
export interface XyConfigBase {
    /**
     * Command-specific settings grouped under `commands`.
     * These cascade from root xy.config down to per-package xy.config files.
     * Takes precedence over the legacy top-level `deplint`/`publint` fields.
     */
    commands?: CommandsConfig;
    compile?: CompileConfig;
    /** @deprecated Use `commands.deplint` instead. */
    deplint?: DeplintConfig;
    dynamicShare?: DynamicShareConfig;
    liveShare?: LiveShareConfig;
    /** @deprecated Use `commands.publint` instead. */
    publint?: boolean | PublintConfig;
    verbose?: boolean;
}
export interface XyEsbuildConfig extends XyConfigBase {
    compile?: PackageCompileEsbuildConfig;
}
/** @deprecated Use XyEsbuildConfig. */
export interface XyTsupConfig extends XyConfigBase {
    compile?: PackageCompileEsbuildConfig;
}
export interface XyTscConfig extends XyConfigBase {
    compile?: PackageCompileTscConfig;
}
export type XyConfigLegacy = XyEsbuildConfig | XyTscConfig;
export type XyConfig = XyConfigLegacy & {
    dev?: {
        build?: {
            clean?: boolean;
            compile?: boolean;
            deplint?: boolean;
            gitlint?: boolean;
            license?: boolean;
            lint?: boolean;
            publint?: boolean;
            statics?: boolean;
            verbose?: boolean;
        };
        compile?: PackageCompileEsbuildConfig;
        verbose?: boolean;
    };
    verbose?: boolean;
};
//# sourceMappingURL=XyConfig.d.ts.map