import type { ERDNode, ERDField } from '@memberjunction/ng-entity-relationship-diagram';
import type { ColumnSpec, EntityTableSpec, ForeignKeySpec } from '../../database-designer.types.js';
import * as i0 from "@angular/core";
/** Which tab is currently active. */
export type PreviewTab = 'diagram' | 'sql';
export declare class DatabasePreviewPaneComponent {
    private readonly cdr;
    /**
     * Current wizard draft.  Accepts a partial spec so the preview can
     * render meaningfully even on Step 1 (name only).
     */
    set TableDefinition(value: Partial<EntityTableSpec> | null | undefined);
    get TableDefinition(): Partial<EntityTableSpec>;
    private _tableDefinition;
    /**
     * True when this preview is showing an edit of an existing entity
     * (modify flow).  Switches the SQL header to `ALTER` wording and draws
     * a "current vs proposed" indicator in the diagram.
     *
     * Defaults to false (create flow).
     */
    set IsAlter(value: boolean);
    get IsAlter(): boolean;
    private _isAlter;
    ActiveTab: PreviewTab;
    ErdNodes: ERDNode[];
    SqlText: string;
    /** Focus node ID — lets `mj-erd-diagram` highlight the in-progress entity. */
    FocusNodeId: string | null;
    /**
     * Stable config reference — bound to `mj-erd-diagram` via `[config]`.
     * Must be a class property, not an inline object literal in the template,
     * or every CD cycle produces a new reference and the ERD re-runs its
     * layout / fit-to-view on every tick.
     */
    readonly ErdConfig: {
        readonly showAllFields: true;
        readonly maxNodeHeight: 520;
    };
    SelectTab(tab: PreviewTab): void;
    private recompute;
    /**
     * Look up each FK target in MJ metadata and return PK + name-field rows per
     * satellite node.  Falls back to a minimal single-column stub when the
     * referenced table isn't a known MJ entity.
     */
    private resolveSatelliteFields;
    /** DOM id for the focus node, used by `mj-erd-diagram` to highlight. */
    static BuildFocusId(spec: Partial<EntityTableSpec>): string | null;
    /**
     * ERD node list: one focus node + one satellite per distinct FK target.
     * `satelliteEnrichments` — optional PK + name-field rows per satellite,
     * keyed by `MakeSatelliteId(fk)`.  When absent, satellites render a
     * minimal single-column stub.
     */
    static BuildErdNodes(spec: Partial<EntityTableSpec>, satelliteEnrichments?: Map<string, ERDField[]>): ERDNode[];
    /**
     * Field list for the focus node: PK + user columns + synthetic FK columns + system audit.
     * Pure — no link annotation.  `AnnotateFkLinks` runs after to mark FK sources.
     */
    static BuildFocusFields(focusId: string, spec: Partial<EntityTableSpec>): ERDField[];
    /** Stamp FK metadata onto any existing fields that match an FK source column. */
    static AnnotateFkLinks(fields: ERDField[], foreignKeys: ForeignKeySpec[]): void;
    /**
     * One satellite node per distinct FK target (dedupes on schema+table).
     * When `enrichments` provides rows for a satellite id, those rows (PK +
     * name field, resolved from MJ metadata) are used instead of the minimal
     * single-column stub.
     */
    static BuildSatelliteNodes(foreignKeys: ForeignKeySpec[], enrichments?: Map<string, ERDField[]>): ERDNode[];
    static MakeSatelliteId(fk: ForeignKeySpec): string;
    /** Preview DDL for the given TableDefinition.  `isAlter` only affects the lead comment. */
    static BuildSqlText(spec: Partial<EntityTableSpec>, isAlter?: boolean): string;
    static FormatColumnLine(col: ColumnSpec): string;
    static FormatFieldType(col: ColumnSpec): string;
    static ɵfac: i0.ɵɵFactoryDeclaration<DatabasePreviewPaneComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<DatabasePreviewPaneComponent, "mj-database-preview-pane", never, { "TableDefinition": { "alias": "TableDefinition"; "required": false; }; "IsAlter": { "alias": "IsAlter"; "required": false; }; }, {}, never, never, false, never>;
}
//# sourceMappingURL=database-preview-pane.component.d.ts.map