import { EditOperation, FieldDescriptor, FieldHistoryItem, InsertOption, UserInfo } from "../../types";
import { ItemTreeNodeData } from "./contentService";
import { ExecutionResult } from "./serviceHelper";
import { Field, FieldButton, ItemDescriptor, ItemIdAndName } from "../pageModel";
import { PictureRawValue } from "../fieldTypes";
export type PlaceholderInsertOptions = {
    key: string;
    insertOptions: InsertOption[];
    editable: boolean;
    placeholderSettingsItem?: ItemDescriptor;
};
export type { ExecutionResult } from "./serviceHelper";
export type ConnectionAvailabilityResult = {
    allowed: boolean;
    backendReachable: boolean;
    currentUsers?: number;
    maxUsers?: number;
    message?: string;
};
/**
 * Checks if a WebSocket connection is allowed before attempting to connect.
 * Returns connection availability status.
 */
export declare function checkConnectionAvailability(sessionId: string): Promise<ConnectionAvailabilityResult>;
export type ActiveLicenseUserRow = {
    userName: string;
    fullName?: string;
    email?: string;
    connectionCount: number;
    connectedSinceUtc?: string;
};
/**
 * Sitecore administrators only: users currently using a concurrent license seat.
 */
export declare function getActiveLicenseUsers(): Promise<ActiveLicenseUserRow[]>;
/**
 * Sitecore administrators only: disconnect all editor sessions for a user (frees a seat).
 */
export declare function disconnectLicenseUser(userName: string): Promise<{
    disconnected: number;
}>;
export type SourceImageData = {
    base64: string;
    contentType?: string;
};
export type StartImageJobRequest = {
    prompt: string;
    itemId: string;
    fieldId: string;
    language: string;
    version: number;
    modelId?: string;
    variantName?: string;
    pageItemId?: string;
    targetFolderId?: string;
    sourceImages?: SourceImageData[];
};
export type ImageModelOption = {
    id: string;
    name: string;
    providerName?: string;
    isDefault?: boolean;
};
export type ImageModelsResponse = {
    defaultModelId?: string;
    models: ImageModelOption[];
};
export type StartImageJobResponse = {
    jobKey: string;
    status: string;
    message: string;
};
export declare function getImageModels(): Promise<ExecutionResult<ImageModelsResponse>>;
export declare function startImageJob(request: StartImageJobRequest, sessionId: string): Promise<ExecutionResult<StartImageJobResponse>>;
export declare function connectSocket(sessionId: string): WebSocket;
export declare function reconnectSession(sessionId: string): Promise<ExecutionResult<{
    succeeded: boolean;
    sessionId: string;
}>>;
export declare function getPictureValue(field: Field, pictureRawValue: PictureRawValue, site: string, sessionId: string): Promise<any>;
export declare function executeEditOperation(editOperation: EditOperation, sessionId: string): Promise<ExecutionResult<unknown>>;
export declare function executeUndo(sessionId: string, editOperationIds: string[]): Promise<ExecutionResult<any>>;
export declare function executeRedo(sessionId: string, editOperationId: string): Promise<ExecutionResult<any>>;
export type OperationSummary = {
    id: string;
    type: string;
    title: string;
    username: string;
    date: string;
};
export type OperationImpactResult = {
    hasExternalChanges: boolean;
    externalChangesCount: number;
    externalUsers: string[];
    sampleOperations: OperationSummary[];
    affectedSummary: string;
};
export declare function checkOperationImpact(sessionId: string, operationId: string, action: "undo" | "redo"): Promise<ExecutionResult<OperationImpactResult>>;
export declare function executeDeleteItems(items: ItemDescriptor[]): Promise<ExecutionResult<any>>;
export type ReferencingItemInfo = {
    id: string;
    name: string;
    path: string;
    /** Names of the fields on the referencing item that contain the reference. */
    fieldNames: string[] | null;
    icon: string | null;
    templateName: string | null;
    language: string | null;
    database: string | null;
};
export type ItemReferenceInfo = {
    item: ItemDescriptor;
    /** One entry per distinct referencing item (per language). */
    referencingItems: ReferencingItemInfo[];
    /** Count of distinct referencing items (may exceed referencingItems.length if truncated). */
    totalReferenceCount: number;
};
export declare function checkItemReferences(items: ItemDescriptor[]): Promise<ExecutionResult<ItemReferenceInfo[]>>;
export declare function lockItems(items: ItemDescriptor[]): Promise<ExecutionResult<any>>;
export declare function unlockItems(items: ItemDescriptor[]): Promise<ExecutionResult<any>>;
export declare function lockField(item: ItemDescriptor, fieldId: string, sessionId: string, signal?: AbortSignal): Promise<ExecutionResult<any>>;
export declare function releaseFieldLocks(sessionId: string): Promise<ExecutionResult<any>>;
export declare function forceUnlockField(sessionIdToUnlock: string, item: ItemDescriptor, fieldId: string): Promise<ExecutionResult<any>>;
export declare function validateItems(items: ItemDescriptor[], sessionId: string): Promise<ExecutionResult<any>>;
export declare function executeWorkflowCommand(item: ItemDescriptor, commandId: string, comment: string): Promise<ExecutionResult<any>>;
export declare function executeFieldAction(item: ItemDescriptor, fieldId: string, pageItem: ItemDescriptor, action: string, sessionId: string, selectedText: string, parameters: Record<string, string>, callback: (data: any) => void): Promise<ExecutionResult<any>>;
export declare function createVersion(page: ItemDescriptor, sessionId: string): Promise<ExecutionResult<any>>;
export type BatchVersionResult = {
    itemId: string;
    language: string;
    version: number;
};
export type BatchVersionError = {
    itemId: string;
    language: string;
    error: string;
};
export type BatchCreateVersionResponse = {
    created: BatchVersionResult[];
    skipped: BatchVersionError[];
};
export declare function createVersionsBatch(items: Array<{
    id: string;
    language: string;
    version: number;
}>, sessionId: string): Promise<ExecutionResult<BatchCreateVersionResponse>>;
export declare function deleteVersion(page: ItemDescriptor, sessionId: string): Promise<ExecutionResult<any>>;
export declare function loadInsertOptions(item: ItemDescriptor): Promise<ItemTreeNodeData[]>;
export declare function loadPlaceholderInsertOptions(pageItem: ItemDescriptor, placeholderKeys: string[], layoutMode?: "final" | "shared"): Promise<PlaceholderInsertOptions[]>;
export type SharedComponentTargetInfo = {
    supported: boolean;
    rootFolderId?: string;
    rootFolderPath?: string;
    allowUserSelection?: boolean;
};
export type RenderingParameterOption = {
    id: string;
    name: string;
};
export type RenderingParameterField = {
    name: string;
    title: string;
    sectionTitle: string;
    type: string;
    inputType: "text" | "checkbox" | "select" | "multiselect" | "droptree";
    options: RenderingParameterOption[];
};
export type RenderingParametersSchema = {
    parametersTemplateId?: string | null;
    fields: RenderingParameterField[];
};
export type CreateComponentThumbnailRequest = {
    pageItem: ItemDescriptor;
    componentId: string;
    imageDataUrl: string;
    imageWidth: number;
    imageHeight: number;
};
export type CreateComponentThumbnailResponse = {
    success: boolean;
    mediaItemId: string;
    mediaItemPath: string;
    thumbnailUrl: string;
    renderingItemId: string;
};
export declare function getSharedComponentTarget(pageItem: ItemDescriptor, componentId: string): Promise<SharedComponentTargetInfo>;
export declare function loadRenderingParametersSchema(pageItem: ItemDescriptor, componentId: string): Promise<RenderingParametersSchema>;
export declare function createComponentThumbnail(request: CreateComponentThumbnailRequest): Promise<ExecutionResult<CreateComponentThumbnailResponse>>;
export declare function loadFieldButtons(field: FieldDescriptor): Promise<FieldButton[]>;
export type LookupSourcesResponse = {
    items: ItemIdAndName[];
    database: string;
};
export declare function getLookupSources(field: Field): Promise<LookupSourcesResponse>;
export declare function executeCreateItem(parent: ItemDescriptor, templateId: string, name: string, sessionId?: string, branchId?: string): Promise<ExecutionResult<any>>;
export declare function getEditHistory(options?: {
    item?: ItemDescriptor;
    sessionId?: string;
    limit?: number;
    /** Optional language filter for global mode (filters without requiring itemId) */
    language?: string;
    /** Optional backend search query for path/title/description filtering. */
    query?: string;
}): Promise<ExecutionResult<EditOperation[]>>;
export declare function getEditOperation(operationId: string): Promise<ExecutionResult<EditOperation>>;
export declare function getAgentHistory(agentId: string, limit?: number): Promise<ExecutionResult<EditOperation[]>>;
/**
 * Gets all currently executing long-running operations for the current user.
 * Used for resuming UI state after client reconnect.
 */
export declare function getRunningOperations(): Promise<ExecutionResult<EditOperation[]>>;
export declare function getFieldHistory(item: ItemDescriptor, fieldId: string): Promise<ExecutionResult<FieldHistoryItem[]>>;
export declare function getUserInfo(): Promise<ExecutionResult<UserInfo>>;
export type ItemVisitor = {
    userName: string;
    userFullName?: string | null;
    visitedAt: string;
    avatarUrl?: string | null;
};
export declare function getItemVisitors(item: ItemDescriptor): Promise<ExecutionResult<ItemVisitor[]>>;
export declare function executeMoveItems(items: ItemDescriptor[], target: ItemDescriptor, index: number): Promise<ExecutionResult<any>>;
export declare function executeCopyItems(items: ItemDescriptor[], target: ItemDescriptor, index: number, sessionId: string): Promise<ExecutionResult<any>>;
export declare function executeDuplicateItem(item: ItemDescriptor, target: ItemDescriptor, name: string, sessionId: string): Promise<ExecutionResult<ItemDescriptor>>;
export declare function executeChangeTemplate(item: ItemDescriptor, newTemplateId: string, sessionId: string): Promise<ExecutionResult<any>>;
