import { IMetadataProvider, UserInfo } from '@memberjunction/core';
import type { FormOverrideDialogResult } from '../components/form-override-dialog.component';
import * as i0 from "@angular/core";
/** Slim row shape for listing existing overrides — matches FormResolverService. */
export interface EntityFormOverrideRow {
    ID: string;
    EntityID: string;
    ComponentID: string;
    Name: string;
    Description: string | null;
    Scope: 'User' | 'Role' | 'Global';
    UserID: string | null;
    RoleID: string | null;
    Priority: number;
    Status: 'Active' | 'Inactive' | 'Pending';
}
/**
 * Studio-side service for managing `EntityFormOverride` rows from Component
 * Studio (post-save dialog + sub-list of existing overrides).
 *
 * Reads use `RunView` with `ResultType: 'simple'` for the list view —
 * cheaper than loading entity objects when we just want to render rows.
 * Writes (`CreateOverride`, `DeactivateOverride`) load the strongly-typed
 * `MJEntityFormOverrideEntity` and call `Save()`. Per the project
 * "NO WEAK TYPING" rule we never use `.Set('FieldName', ...)`.
 *
 * Unlike the Form Builder agent's action (`__CreateInteractiveForm`),
 * which clamps Scope='User' as a security boundary, the Studio service
 * **honors the dialog's Scope/Role/Priority choices** — Studio is the
 * deliberate human-authoring path where promotion to Role / Global is a
 * core feature. The dialog already enforces that Scope='Role' requires a
 * RoleID.
 */
export declare class EntityFormOverrideService {
    /**
     * Fetch existing overrides for an entity, scoped to the calling user's
     * visibility (User, their roles, Global). Used by the Studio sub-list
     * showing "what overrides already exist for this entity."
     */
    ListOverridesForEntity(entityName: string, user: UserInfo, provider?: IMetadataProvider): Promise<EntityFormOverrideRow[]>;
    /**
     * Create an `EntityFormOverride` row pointing the just-saved Component
     * at an entity. Honors the dialog's Scope/Role/Priority/Status choices
     * (unlike the Form Builder action which clamps to User scope).
     */
    CreateOverride(componentID: string, result: FormOverrideDialogResult, user: UserInfo, provider?: IMetadataProvider): Promise<{
        Success: boolean;
        ID?: string;
        Error?: string;
    }>;
    /**
     * Promote a Pending override to Active. Mirrors the server-side
     * `Activate Interactive Form Version` action's intent without round-
     * tripping through the Action layer — for cockpit-internal usage where
     * the user is explicitly clicking "Make Active".
     *
     * Atomically flips the target Override to Active AND demotes any sibling
     * Active override at the same scope target to Inactive. Components
     * mirror the override status (Published / Draft / Deprecated).
     */
    activateVersion(id: string, user?: UserInfo, provider?: IMetadataProvider): Promise<{
        Success: boolean;
        Error?: string;
    }>;
    /**
     * Re-point an Active override at an older Component row in the same Name
     * lineage. Pure UPDATE on the override; no new rows created. Mirrors the
     * server-side `Revert Interactive Form` action.
     */
    revertToComponent(activeOverrideID: string, targetComponentID: string, user?: UserInfo, provider?: IMetadataProvider): Promise<{
        Success: boolean;
        Error?: string;
    }>;
    /**
     * Flip an override's Status to `Inactive`. Preserves the row so it can
     * be re-activated later (vs. deleting outright, which would lose the
     * Component link and require re-authoring).
     */
    DeactivateOverride(id: string, user: UserInfo, provider?: IMetadataProvider): Promise<{
        Success: boolean;
        Error?: string;
    }>;
    static ɵfac: i0.ɵɵFactoryDeclaration<EntityFormOverrideService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<EntityFormOverrideService>;
}
//# sourceMappingURL=entity-form-override.service.d.ts.map