import * as _angular_core from '@angular/core';
import { ElementRef, NgZone } from '@angular/core';
import { CdkDragDrop } from '@angular/cdk/drag-drop';

type EntityViewType = 'Text' | 'Date' | 'DateTime' | 'Percentage' | 'Status' | 'Currency' | 'Checkbox' | 'User';
/** Entity size – controls column span (1-12) inside a 12-column grid */
type EntitySize = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
interface EntityBaseConfig {
    /** Column span of the entity card (1-12). Default: 4 */
    size?: EntitySize;
    /** Whether to show a dashed border around the entity card */
    showBorder?: boolean;
}
interface EntityUserConfig extends EntityBaseConfig {
    showDisplayName?: boolean;
    showPhoneNumber?: boolean;
    showEmail?: boolean;
}
interface EntityPercentageConfig extends EntityBaseConfig {
    showName?: boolean;
}
type EntityConfiguration = EntityBaseConfig | EntityUserConfig | EntityPercentageConfig;
interface EntityStatusValue {
    key: string;
    display: string;
    color: string;
    description?: string;
}
interface EntityData {
    id?: number;
    propertyId?: number;
    key?: string;
    normalizedKey?: string;
    name?: string;
    rawValue?: string;
    order?: number;
    value: string | EntityStatusValue;
    viewType: EntityViewType;
    type?: string;
    userName?: string;
    displayName?: string;
    photoUrl?: string;
    phoneNumber?: string;
    email?: string;
    configuration?: EntityConfiguration;
}
/** Emitted when an entity is resized via the drag handle */
interface EntityResizeEvent {
    entity: EntityData;
    previousSize: EntitySize;
    newSize: EntitySize;
}

declare class EntityText {
    /** Full entity data object */
    readonly data: _angular_core.InputSignal<EntityData | undefined>;
    /** Individual inputs (used when data is not provided) */
    readonly name: _angular_core.InputSignal<string | undefined>;
    readonly value: _angular_core.InputSignal<string | undefined>;
    readonly displayName: _angular_core.Signal<string>;
    readonly displayValue: _angular_core.Signal<string>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityText, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityText, "mt-entity-text", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntityDate {
    /** Full entity data object */
    readonly data: _angular_core.InputSignal<EntityData | undefined>;
    /** Individual inputs (used when data is not provided) */
    readonly name: _angular_core.InputSignal<string | undefined>;
    readonly value: _angular_core.InputSignal<string | undefined>;
    readonly displayName: _angular_core.Signal<string>;
    readonly displayValue: _angular_core.Signal<string>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityDate, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityDate, "mt-entity-date", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntityStatus {
    /** Full entity data object */
    readonly data: _angular_core.InputSignal<EntityData | undefined>;
    /** Individual inputs (used when data is not provided) */
    readonly name: _angular_core.InputSignal<string | undefined>;
    readonly value: _angular_core.InputSignal<EntityStatusValue | undefined>;
    readonly displayName: _angular_core.Signal<string>;
    readonly statusValue: _angular_core.Signal<EntityStatusValue | null>;
    readonly badgeStyle: _angular_core.Signal<{
        color?: undefined;
        backgroundColor?: undefined;
    } | {
        color: string;
        backgroundColor: string;
    }>;
    private hexToRgba;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityStatus, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityStatus, "mt-entity-status", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntityUser {
    /** Full entity data object */
    readonly data: _angular_core.InputSignal<EntityData | undefined>;
    /** Individual inputs (used when data is not provided) */
    readonly displayName: _angular_core.InputSignal<string | undefined>;
    readonly photoUrl: _angular_core.InputSignal<string | undefined>;
    readonly userName: _angular_core.Signal<string>;
    readonly userPhoto: _angular_core.Signal<string>;
    readonly labelText: _angular_core.Signal<string>;
    readonly initials: _angular_core.Signal<string>;
    private readonly config;
    readonly showDisplayName: _angular_core.Signal<boolean>;
    readonly showPhoneNumber: _angular_core.Signal<boolean>;
    readonly showEmail: _angular_core.Signal<boolean>;
    readonly phoneNumber: _angular_core.Signal<string>;
    readonly email: _angular_core.Signal<string>;
    readonly hasContactInfo: _angular_core.Signal<boolean>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityUser, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityUser, "mt-entity-user", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "displayName": { "alias": "displayName"; "required": false; "isSignal": true; }; "photoUrl": { "alias": "photoUrl"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntityPercentage {
    /** Full entity data object */
    readonly data: _angular_core.InputSignal<EntityData | undefined>;
    /** Individual inputs (used when data is not provided) */
    readonly name: _angular_core.InputSignal<string | undefined>;
    readonly value: _angular_core.InputSignal<string | undefined>;
    readonly rawValue: _angular_core.InputSignal<string | undefined>;
    readonly displayName: _angular_core.Signal<string>;
    readonly displayValue: _angular_core.Signal<string>;
    readonly numericValue: _angular_core.Signal<number>;
    readonly maxValue: _angular_core.Signal<number>;
    private readonly config;
    readonly showName: _angular_core.Signal<boolean>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityPercentage, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityPercentage, "mt-entity-percentage", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "rawValue": { "alias": "rawValue"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntityCurrency {
    /** Full entity data object */
    readonly data: _angular_core.InputSignal<EntityData | undefined>;
    /** Individual inputs (used when data is not provided) */
    readonly name: _angular_core.InputSignal<string | undefined>;
    readonly value: _angular_core.InputSignal<string | undefined>;
    readonly displayName: _angular_core.Signal<string>;
    readonly displayValue: _angular_core.Signal<string>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityCurrency, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityCurrency, "mt-entity-currency", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntityCheckbox {
    /** Full entity data object */
    readonly data: _angular_core.InputSignal<EntityData | undefined>;
    /** Individual inputs (used when data is not provided) */
    readonly name: _angular_core.InputSignal<string | undefined>;
    readonly value: _angular_core.InputSignal<string | undefined>;
    readonly rawValue: _angular_core.InputSignal<string | undefined>;
    readonly displayName: _angular_core.Signal<string>;
    readonly isChecked: _angular_core.Signal<boolean>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityCheckbox, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityCheckbox, "mt-entity-checkbox", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "rawValue": { "alias": "rawValue"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntityPreview {
    /** Single entity data to display */
    readonly data: _angular_core.InputSignal<EntityData>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntityPreview, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntityPreview, "mt-entity-preview", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class EntitiesPreview {
    /** Array of entity data to display */
    readonly entities: _angular_core.InputSignal<EntityData[]>;
    /** Entities sorted by order */
    readonly sortedEntities: _angular_core.Signal<EntityData[]>;
    /** Returns the grid-column span for a given entity size (1-12) */
    getColSpan(entity: EntityData): string;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntitiesPreview, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntitiesPreview, "mt-entities-preview", never, { "entities": { "alias": "entities"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
}

/**
 * Base class that encapsulates all entity resize-via-drag logic.
 *
 * Extend this directive in any component that needs column-resize behaviour
 * on a 12-column CSS grid.  The subclass must:
 *   - Provide a `model.required<EntityData[]>()` (or equivalent) for the
 *     entity list so `updateEntitySize()` can be called after resize.
 *   - Contain a `.grid` element (or override `getGridElement()`).
 *
 * Resize flow:
 *   1. `onResizeStart(event, entity)` — called from a mousedown on the handle
 *   2. mousemove  → snaps to nearest column, updates `resizePreviewSize`
 *   3. mouseup    → emits `entityResized` with previous & new size
 */
declare abstract class EntitiesResizeBase {
    protected readonly elRef: ElementRef<any>;
    protected readonly zone: NgZone;
    protected readonly doc: Document;
    /** Emits when an entity is resized via the drag handle */
    readonly entityResized: _angular_core.OutputEmitterRef<EntityResizeEvent>;
    /** The entity currently being resized (null when idle) */
    readonly resizingEntity: _angular_core.WritableSignal<EntityData | null>;
    /** Live preview size while dragging */
    readonly resizePreviewSize: _angular_core.WritableSignal<EntitySize | null>;
    /** Bound listeners kept for cleanup */
    private _onMouseMove;
    private _onMouseUp;
    /**
     * Returns the grid element used to compute column widths.
     * Override if the grid selector differs.
     */
    protected getGridElement(): HTMLElement | null;
    /**
     * Returns the grid-column span string for a given entity.
     * While resizing the active entity, returns the preview size.
     */
    getResizeColSpan(entity: EntityData): string;
    /** Starts a resize operation from the right-edge handle */
    onResizeStart(event: MouseEvent, entity: EntityData): void;
    /**
     * Called when a resize operation completes with a changed size.
     * Subclasses should update the entity list and emit events here.
     */
    protected abstract onResizeComplete(entity: EntityData, previousSize: EntitySize, newSize: EntitySize): void;
    /** Removes global mouse listeners */
    private _cleanupListeners;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntitiesResizeBase, never>;
    static ɵdir: _angular_core.ɵɵDirectiveDeclaration<EntitiesResizeBase, never, never, {}, { "entityResized": "entityResized"; }, never, never, true, never>;
}

declare class EntitiesManage extends EntitiesResizeBase {
    /** Array of entity data – supports two-way binding to keep order in sync */
    readonly entities: _angular_core.ModelSignal<EntityData[]>;
    /** Emits the reordered entities array after each drag-drop */
    readonly entitiesReordered: _angular_core.OutputEmitterRef<EntityData[]>;
    /** Entities sorted by their order field */
    readonly sortedEntities: _angular_core.Signal<EntityData[]>;
    /** Returns the grid-column span for a given entity size (1-12) */
    getColSpan(entity: EntityData): string;
    /** Handle drag-drop reorder */
    onDrop(event: CdkDragDrop<EntityData[]>): void;
    protected onResizeComplete(entity: EntityData, previousSize: EntitySize, newSize: EntitySize): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EntitiesManage, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EntitiesManage, "mt-entities-manage", never, { "entities": { "alias": "entities"; "required": true; "isSignal": true; }; }, { "entities": "entitiesChange"; "entitiesReordered": "entitiesReordered"; }, never, never, true, never>;
}

export { EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityCheckbox, EntityCurrency, EntityDate, EntityPercentage, EntityPreview, EntityStatus, EntityText, EntityUser };
export type { EntityBaseConfig, EntityConfiguration, EntityData, EntityPercentageConfig, EntityResizeEvent, EntitySize, EntityStatusValue, EntityUserConfig, EntityViewType };
