import type { SiteCommandRef, SiteCommandType } from '../../../../site-commands/src/index';
import type { SyncResult, ResidualSettingsDiff, ResidualSettingsLocalContent } from '../sync';
import type { PushScope } from '../commands/push/consts';
import type { compileEntryPushCommands, EntryCommandExecutionReport } from './entryCommands';
import type { compileFormPushCommands, FormCommandExecutionReport } from './formCommands';
import type { compileNavigationPushCommands, NavigationCommandExecutionReport } from './navigationCommands';
import type { compilePagePushCommands, PageCommandExecutionReport } from './pageCommands';
export type CommandSurface = 'entry' | 'page' | 'form' | 'navigation';
export type CommandSurfaceFailurePolicy = 'continue' | 'stop';
export type ContentPushScope = Extract<PushScope, 'entries' | 'pages' | 'navigation' | 'forms' | 'all'>;
export type ResidualSettingsPushPlan = Readonly<{
    diff: ResidualSettingsDiff;
    local: ResidualSettingsLocalContent;
}>;
export type CommandSurfaceCompileResult = Readonly<{
    surface: 'entry';
    compileResult: ReturnType<typeof compileEntryPushCommands>;
}> | Readonly<{
    surface: 'page';
    compileResult: ReturnType<typeof compilePagePushCommands>;
}> | Readonly<{
    surface: 'form';
    compileResult: ReturnType<typeof compileFormPushCommands>;
}> | Readonly<{
    surface: 'navigation';
    compileResult: ReturnType<typeof compileNavigationPushCommands>;
}>;
export type CommandSurfaceCompileSuccess = Readonly<{
    surface: 'entry';
    compileValue: OkValue<ReturnType<typeof compileEntryPushCommands>>;
}> | Readonly<{
    surface: 'page';
    compileValue: OkValue<ReturnType<typeof compilePagePushCommands>>;
}> | Readonly<{
    surface: 'form';
    compileValue: OkValue<ReturnType<typeof compileFormPushCommands>>;
}> | Readonly<{
    surface: 'navigation';
    compileValue: OkValue<ReturnType<typeof compileNavigationPushCommands>>;
}>;
type OkValue<T> = T extends Readonly<{
    ok: true;
    value: infer TValue;
}> ? TValue : never;
export type ContentPushExecutionStep = Readonly<{
    kind: 'residual-settings-sync';
    residual: ResidualSettingsPushPlan;
    onFailure: CommandSurfaceFailurePolicy;
}> | Readonly<{
    kind: 'command-surface';
    surface: CommandSurface;
    onFailure: CommandSurfaceFailurePolicy;
}>;
export type CompiledContentPushExecutionStep = Readonly<{
    kind: 'residual-settings-sync';
    residual: ResidualSettingsPushPlan;
    onFailure: CommandSurfaceFailurePolicy;
}> | Readonly<{
    kind: 'command-surface';
    surface: CommandSurfaceCompileSuccess;
    onFailure: CommandSurfaceFailurePolicy;
}>;
export type ContentPushExecutionPlan = Readonly<{
    kind: 'sync-steps';
    steps: readonly ContentPushExecutionStep[];
}>;
export type CompiledContentPushExecutionPlan = Readonly<{
    kind: 'compiled-sync-steps';
    steps: readonly CompiledContentPushExecutionStep[];
}>;
export type CommandSurfaceExecutionReport = Readonly<{
    surface: 'entry';
    report: EntryCommandExecutionReport;
}> | Readonly<{
    surface: 'page';
    report: PageCommandExecutionReport;
}> | Readonly<{
    surface: 'form';
    report: FormCommandExecutionReport;
}> | Readonly<{
    surface: 'navigation';
    report: NavigationCommandExecutionReport;
}>;
export type ContentPushExecutionReport = Readonly<{
    commandReports: readonly CommandSurfaceExecutionReport[];
    residualSyncResults: readonly SyncResult[];
}>;
export type ReportedCommandWithSubject<TSubject> = Readonly<{
    plannedCommand: Readonly<{
        command: Readonly<{
            ref: SiteCommandRef;
            type: SiteCommandType;
        }>;
    }>;
    reportSubject: TSubject;
}>;
export {};
