import React from "react";
import { InsertOption } from "../types";
export type PageSkeleton = {
    editRevision: string;
    item: ItemDescriptor;
    rootComponent: ComponentSkeleton;
};
export type PlaceholderSkeleton = {
    name: string;
    key: string;
    description: string;
    components: ComponentSkeleton[];
    parentComponent: ComponentSkeleton;
    editable?: boolean;
};
export type ComponentSkeleton = {
    id: string;
    name: string;
    type: string;
    typeId: string;
    parametersTemplateId?: string;
    parameters?: string;
    items: RenderedItemSkeleton[];
    placeholders: PlaceholderSkeleton[];
    datasourceItem?: RenderedItemSkeleton;
    isRemovedFromMasterLanguage?: boolean;
    isInheritedFromMasterLanguage?: boolean;
    visible?: boolean;
    parentPlaceholder?: PlaceholderSkeleton;
    renderedDictionaryKeys: string[];
    isShared?: boolean;
    hasPersonalization?: boolean;
    layoutId?: string;
    isSharedLayout?: boolean;
    editorFields: EditorFields;
    firstDOMElement?: Element;
    lastDOMElement?: Element;
    editable?: boolean;
};
export type RenderedItemSkeleton = ItemDescriptor & {
    renderedFieldIds: string[];
};
export type ItemDescriptor = {
    id: string;
    language: string;
    version: number;
    name?: string;
    displayName?: string;
    path?: string;
    database?: string;
};
export declare function toItemDescriptor(item: ItemDescriptor | {
    descriptor: ItemDescriptor;
}): ItemDescriptor;
export type Field = {
    id: string;
    value: unknown;
    rawValue?: string | null;
    name?: string;
    shortDescription?: string;
    type: string;
    descriptor: FieldDescriptor;
    displayName?: string;
    sortOrder?: number;
    sectionSortOrder?: number;
    customProperties?: any;
    canWrite?: boolean;
    hasLock?: boolean;
    canLock?: boolean;
    lockedBy?: LockSession;
    section?: string;
    isFallback?: boolean;
    isStandardValue?: boolean;
    isShared?: boolean;
    hasValue?: boolean;
    sourceItems: ItemRef[];
    buttons?: FieldButton[];
    fallbackChain?: FieldDescriptor[];
    isHistoric?: boolean;
};
export type ItemRef = {
    id: string;
    name?: string;
};
export type FieldButtonParameter = {
    id: string;
    label: string;
    placeholder?: string;
    type?: "text" | "textarea" | "number" | "select";
    required?: boolean;
    defaultValue?: string;
    options?: {
        value: string;
        label: string;
    }[];
    rows?: number;
};
export type FieldButton = {
    id: string;
    label: string;
    description: string;
    action?: string;
    icon?: React.ReactNode;
    isGenerator: boolean;
    parameters?: FieldButtonParameter[];
};
export type LockSession = {
    sessionId: string;
    name: string;
};
export type FieldDescriptor = {
    item: ItemDescriptor;
    fieldId: string;
};
export type Language = {
    name: string;
    versions: number;
    icon: string;
    languageCode: string;
};
export type Version = {
    version: number;
    updated: Date;
    updatedBy: string;
    workflowState?: string;
    isFinalState?: boolean;
    isPublished?: boolean;
    publishedTargets?: string[];
    publishingRestrictions?: {
        hideVersion: boolean;
        hideVersionFieldId?: string | null;
        validFrom?: string | null;
        validFromFieldId?: string | null;
        validTo?: string | null;
        validToFieldId?: string | null;
    };
};
export type CustomProperty = {
    key: string;
    label: string;
    value: string;
};
export type Timings = {
    [key: string]: number;
};
export type ItemStub = ItemDescriptor & {
    name: string;
    templateId: string;
    templateName: string;
    icon: string;
    largeIcon: string;
    path: string;
    idPath: string;
    database: string;
    parentId: string;
    hasLayout: boolean;
    hasChildren: boolean;
    versions: number;
    canDelete?: boolean;
    canCreate?: boolean;
    canRename?: boolean;
    canWrite?: boolean;
    thumbnail?: string;
};
export type FullItem = ItemDescriptor & {
    descriptor: ItemDescriptor;
    name: string;
    templateId: string;
    templateName: string;
    icon: string;
    largeIcon: string;
    thumbnail: string;
    path: string;
    masterLanguages?: string[];
    translations?: string[];
    fields: Field[];
    canWriteItem: boolean;
    canWriteLanguage: boolean;
    canWriteWorkflow: boolean;
    canRename: boolean;
    canDelete: boolean;
    canCreate: boolean;
    workflowState: string;
    /**
     * Provided by the backend item serializer when a workflow is assigned.
     * Prefer this over workbox-derived state: final-state items typically aren't in the workbox.
     */
    isFinalState?: boolean;
    hasLock: boolean;
    hasLayout: boolean;
    idPath: string;
    canLock: boolean;
    lockedBy: string;
    isInheritedFromMasterLanguage: boolean;
    mainItemId?: string;
    hasChildren: boolean;
    parentId: string;
    versions: number;
    customProperties?: CustomProperty[];
};
export type Page = {
    editRevision: string;
    item: FullItem;
    rootComponent: Component;
};
export type RenderedItem = RenderedItemSkeleton & ItemStub;
type EditorFields = {
    [group: string]: {
        addFields: string[];
        removeFields: string[];
    };
};
export type Component = {
    id: string;
    name: string;
    type: string;
    typeId: string;
    parametersTemplateId?: string;
    parameters?: string;
    items: RenderedItem[];
    placeholders: Placeholder[];
    datasourceItem?: RenderedItem;
    isRemovedFromMasterLanguage?: boolean;
    isInheritedFromMasterLanguage?: boolean;
    visible?: boolean;
    parentPlaceholder?: Placeholder;
    renderedDictionaryKeys: string[];
    isShared: boolean;
    hasPersonalization?: boolean;
    rendering?: RenderingReference;
    layoutId?: string;
    isSharedLayout?: boolean;
    editorFields: EditorFields;
    firstDOMElement?: Element;
    lastDOMElement?: Element;
    canBeMoved: boolean;
    icon?: string;
    editable?: boolean;
};
export type Placeholder = {
    key: string;
    name: string;
    description: string;
    components: Component[];
    parentComponent: Component;
    canSynchronize: boolean;
    insertOptions: InsertOption[];
    editable: boolean;
    placeholderSettingsItem?: ItemDescriptor;
};
export interface RenderingReference {
    id: string;
    revision: string;
}
export type ItemIdAndName = {
    name: string;
    id: string;
};
export {};
