import type { UmbContentDetailModel, UmbElementValueModel } from '../types.js';
import { UmbContentCollectionManager } from '../collection/index.js';
import { UmbContentWorkspaceDataManager } from '../manager/index.js';
import type { UmbContentVariantPickerData, UmbContentVariantPickerValue } from '../variant-picker/index.js';
import type { UmbContentPropertyDatasetContext } from '../property-dataset-context/index.js';
import type { UmbContentValidationRepository } from '../repository/content-validation-repository.interface.js';
import type { UmbContentCollectionWorkspaceContext } from '../collection/content-collection-workspace-context.interface.js';
import type { UmbContentWorkspaceContext } from './content-workspace-context.interface.js';
import { UmbArrayState } from '../../../../libs/observable-api/index.js';
import { UmbContentTypeStructureManager } from '../../content-type/index.js';
import { UmbReadOnlyVariantGuardManager } from '../../../core/utils/index.js';
import { UmbEntityDetailWorkspaceContextBase, UmbWorkspaceSplitViewManager } from '../../../core/workspace/index.js';
import { UmbVariantPropertyGuardManager } from '../../../core/property/index.js';
import { UmbVariantId } from '../../../core/variant/index.js';
import { UmbValidationController } from '../../../core/validation/index.js';
import type { ClassConstructor } from '../../../../libs/extension-api/index.js';
import type { Observable } from '../../../../external/rxjs/index.js';
import type { UmbContentTypeDetailModel, UmbPropertyTypeModel } from '../../content-type/index.js';
import type { UmbControllerHost } from '../../../../libs/controller-api/index.js';
import type { UmbDetailRepository, UmbDetailRepositoryConstructor } from '../../../core/repository/index.js';
import type { UmbEntityDetailWorkspaceContextArgs, UmbEntityDetailWorkspaceContextCreateArgs, UmbSaveableWorkspaceContext } from '../../../core/workspace/index.js';
import type { UmbEntityVariantModel, UmbEntityVariantOptionModel } from '../../../core/variant/index.js';
import type { UmbLanguageDetailModel } from '../../../language/index.js';
import type { UmbModalToken } from '../../../core/modal/index.js';
import type { UmbSegmentModel } from '../../../segment/index.js';
export interface UmbContentDetailWorkspaceContextArgs<DetailModelType extends UmbContentDetailModel<VariantModelType>, ContentTypeDetailModelType extends UmbContentTypeDetailModel = UmbContentTypeDetailModel, VariantModelType extends UmbEntityVariantModel = DetailModelType extends {
    variants: UmbEntityVariantModel[];
} ? DetailModelType['variants'][0] : never, VariantOptionModelType extends UmbEntityVariantOptionModel = UmbEntityVariantOptionModel<VariantModelType>> extends UmbEntityDetailWorkspaceContextArgs {
    contentTypeDetailRepository: UmbDetailRepositoryConstructor<ContentTypeDetailModelType>;
    contentValidationRepository?: ClassConstructor<UmbContentValidationRepository<DetailModelType>>;
    skipValidationOnSubmit?: boolean;
    ignoreValidationResultOnSubmit?: boolean;
    contentVariantScaffold: VariantModelType;
    contentTypePropertyName: string;
    collectionAlias?: string;
    saveModalToken?: UmbModalToken<UmbContentVariantPickerData<VariantOptionModelType>, UmbContentVariantPickerValue>;
}
/**
 * The base class for a content detail workspace context.
 * @exports
 * @abstract
 * @class UmbContentDetailWorkspaceContextBase
 * @augments {UmbEntityDetailWorkspaceContextBase<DetailModelType, DetailRepositoryType, CreateArgsType>}
 * @implements {UmbContentWorkspaceContext<DetailModelType, ContentTypeDetailModelType, VariantModelType>}
 * @template DetailModelType
 * @template DetailRepositoryType
 * @template ContentTypeDetailModelType
 * @template VariantModelType
 * @template VariantOptionModelType
 * @template CreateArgsType
 */
export declare abstract class UmbContentDetailWorkspaceContextBase<DetailModelType extends UmbContentDetailModel<VariantModelType>, DetailRepositoryType extends UmbDetailRepository<DetailModelType> = UmbDetailRepository<DetailModelType>, ContentTypeDetailModelType extends UmbContentTypeDetailModel = UmbContentTypeDetailModel, VariantModelType extends UmbEntityVariantModel = DetailModelType extends {
    variants: UmbEntityVariantModel[];
} ? DetailModelType['variants'][0] : never, VariantOptionModelType extends UmbEntityVariantOptionModel = UmbEntityVariantOptionModel<VariantModelType>, CreateArgsType extends UmbEntityDetailWorkspaceContextCreateArgs<DetailModelType> = UmbEntityDetailWorkspaceContextCreateArgs<DetailModelType>> extends UmbEntityDetailWorkspaceContextBase<DetailModelType, DetailRepositoryType, CreateArgsType> implements UmbContentWorkspaceContext<DetailModelType, ContentTypeDetailModelType, VariantModelType>, UmbSaveableWorkspaceContext, UmbContentCollectionWorkspaceContext<ContentTypeDetailModelType> {
    #private;
    readonly IS_CONTENT_WORKSPACE_CONTEXT: true;
    readonly readOnlyGuard: UmbReadOnlyVariantGuardManager;
    readonly propertyViewGuard: UmbVariantPropertyGuardManager;
    readonly propertyWriteGuard: UmbVariantPropertyGuardManager;
    protected readonly _data: UmbContentWorkspaceDataManager<DetailModelType, VariantModelType>;
    readonly data: Observable<DetailModelType | undefined>;
    readonly values: Observable<UmbElementValueModel<unknown>[] | undefined>;
    readonly variants: Observable<VariantModelType[]>;
    readonly persistedData: Observable<DetailModelType | undefined>;
    readonly structure: UmbContentTypeStructureManager<ContentTypeDetailModelType>;
    readonly variesByCulture: Observable<boolean | undefined>;
    readonly variesBySegment: Observable<boolean | undefined>;
    readonly varies: Observable<boolean | undefined>;
    abstract readonly contentTypeUnique: Observable<string | undefined>;
    readonly splitView: UmbWorkspaceSplitViewManager;
    readonly collection: UmbContentCollectionManager;
    /**
     * @private
     * @description - Should not be used by external code.
     * @internal
     */
    readonly languages: Observable<UmbLanguageDetailModel[]>;
    getLanguages(): Array<UmbLanguageDetailModel>;
    protected readonly _segments: UmbArrayState<UmbSegmentModel, unknown>;
    readonly variantOptions: Observable<VariantOptionModelType[]>;
    getVariantOptions(): Promise<Array<VariantOptionModelType>>;
    protected _variantOptionsFilter: (variantOption: VariantOptionModelType) => boolean;
    getVariantValidationContext(variantId: UmbVariantId): UmbValidationController | undefined;
    constructor(host: UmbControllerHost, args: UmbContentDetailWorkspaceContextArgs<DetailModelType, ContentTypeDetailModelType, VariantModelType, VariantOptionModelType>);
    loadLanguages(): Promise<void>;
    /**
     * @deprecated Call `_loadSegmentsFor` instead. `loadSegments` will be removed in v.18.
     * (note this was introduced in v.17, and deprecated in v.17.0.1)
     */
    protected loadSegments(): Promise<void>;
    protected _loadSegmentsFor(unique: string): Promise<void>;
    protected _processIncomingData(data: DetailModelType): Promise<DetailModelType>;
    /**
     * Get the name of a variant
     * @param {UmbVariantId } [variantId] - The variant id. If not provided, returns the name of the first active variant.
     * @returns { string | undefined} - The name of the variant
     * @memberof UmbContentDetailWorkspaceContextBase
     */
    getName(variantId?: UmbVariantId): string | undefined;
    /**
     * Set the name of a variant
     * @param {string} name - The name of the variant
     * @param {UmbVariantId} [variantId] - The variant id
     * @memberof UmbContentDetailWorkspaceContextBase
     */
    setName(name: string, variantId?: UmbVariantId): void;
    /**
     * Get an observable for the name of a variant
     * @param {UmbVariantId} [variantId] - The variant id. If not provided, observes the name of the first active variant.
     * @returns {Observable<string>} - The name of the variant
     * @memberof UmbContentDetailWorkspaceContextBase
     */
    name(variantId?: UmbVariantId): Observable<string>;
    /**
     * Get whether the content varies by culture
     * @returns { boolean | undefined } - If the content varies by culture
     * @memberof UmbContentDetailWorkspaceContextBase
     */
    getVariesByCulture(): boolean | undefined;
    /**
     * Get whether the content varies by segment
     * @returns {boolean | undefined} - If the content varies by segment
     * @memberof UmbContentDetailWorkspaceContextBase
     */
    getVariesBySegment(): boolean | undefined;
    /**
     * Get whether the content varies
     * @returns { boolean | undefined } - If the content varies
     * @memberof UmbContentDetailWorkspaceContextBase
     */
    getVaries(): boolean | undefined;
    /**
     * Get the variant by the given variantId
     * @param {UmbVariantId} variantId - The variant id
     * @returns { Observable<VariantModelType | undefined> } - The variant or undefined if not found
     * @memberof UmbContentDetailWorkspaceContextBase
     */
    variantById(variantId: UmbVariantId): Observable<VariantModelType | undefined>;
    /**
     * Get the variant by the given variantId
     * @param {UmbVariantId} variantId - The variant id
     * @returns { VariantModelType | undefined } - The variant or undefined if not found
     * @memberof UmbContentDetailWorkspaceContextBase
     */
    getVariant(variantId: UmbVariantId): VariantModelType | undefined;
    getVariants(): Array<VariantModelType> | undefined;
    /**
     * Observe the property type
     * @param {string} propertyId - The id of the property
     * @returns {Promise<Observable<UmbPropertyTypeModel | undefined>>} - An observable for the property type
     * @memberof UmbContentDetailWorkspaceContextBase
     */
    propertyStructureById(propertyId: string): Promise<Observable<UmbPropertyTypeModel | undefined>>;
    /**
     * Get the values of the content
     * @returns {Array<UmbElementValueModel> | undefined} - The values of the content
     * @memberof UmbContentDetailWorkspaceContextBase
     */
    getValues(): Array<UmbElementValueModel> | undefined;
    /**
     * @function propertyValueByAlias
     * @param {string} propertyAlias - The alias of the property
     * @param {UmbVariantId} variantId - The variant
     * @returns {Promise<Observable<ReturnType | undefined> | undefined>} - An observable for the value of the property
     * @description Get an Observable for the value of this property.
     */
    propertyValueByAlias<PropertyValueType = unknown>(propertyAlias: string, variantId?: UmbVariantId): Promise<Observable<PropertyValueType | undefined> | undefined>;
    /**
     * Get the current value of the property with the given alias and variantId.
     * @param {string} alias - The alias of the property
     * @param {UmbVariantId | undefined} variantId - The variant id of the property
     * @returns {ReturnType | undefined} The value or undefined if not set or found.
     */
    getPropertyValue<ReturnType = unknown>(alias: string, variantId?: UmbVariantId): ReturnType | undefined;
    /**
     * Set the value of the property with the given alias and variantId.
     * @template ValueType
     * @param {string} alias - The alias of the property
     * @param {ValueType} value - The value to set
     * @param {UmbVariantId} [variantId] - The variant id of the property
     * @memberof UmbContentDetailWorkspaceContextBase
     */
    setPropertyValue<ValueType = unknown>(alias: string, value: ValueType, variantId?: UmbVariantId): Promise<void>;
    initiatePropertyValueChange(): void;
    finishPropertyValueChange: () => void;
    /**
     * Gets the changed variant ids
     * @returns {Array<UmbVariantId>} - The changed variant ids
     * @memberof UmbContentDetailWorkspaceContextBase
     */
    getChangedVariants(): Array<UmbVariantId>;
    protected _determineVariantOptions(): Promise<{
        options: VariantOptionModelType[];
        selected: string[];
    }>;
    protected _saveableVariantsFilter: (option: VariantOptionModelType) => boolean;
    /**
     * Run the mandatory validation for the save data
     * @param {DetailModelType} saveData - The data to validate
     * @memberof UmbContentDetailWorkspaceContextBase
     */
    runMandatoryValidationForSaveData(saveData: DetailModelType, variantIds?: Array<UmbVariantId>): Promise<void>;
    /**
     * Ask the server to validate the save data
     * @param {DetailModelType} saveData - The data to validate
     * @param {Array<UmbVariantId>} variantIds - The variant ids to validate
     * @memberof UmbContentDetailWorkspaceContextBase
     */
    askServerToValidate(saveData: DetailModelType, variantIds: Array<UmbVariantId>): Promise<void>;
    /**
     * Request a submit of the workspace, in the case of Document Workspaces the validation does not need to be valid for this to be submitted.
     * @returns {Promise<void>} a promise which resolves once it has been completed.
     */
    requestSubmit(): Promise<void>;
    submit(): Promise<void>;
    /**
     * Request a save of the workspace, in the case of Document Workspaces the validation does not need to be valid for this to be saved.
     * @returns {Promise<void>} A promise which resolves once it has been completed.
     */
    requestSave(): Promise<void>;
    /**
     * Get the data to save
     * @param {Array<UmbVariantId>} variantIds - The variant ids to save
     * @returns {Promise<DetailModelType>}  {Promise<DetailModelType>}
     * @memberof UmbContentDetailWorkspaceContextBase
     */
    constructSaveData(variantIds: Array<UmbVariantId>): Promise<DetailModelType>;
    protected _handleSubmit(): Promise<void>;
    protected _handleSave(): Promise<void>;
    validateVariantsAndSubmit(variantIds: Array<UmbVariantId>, onValid: () => Promise<void>, onInvalid: (reason?: any) => Promise<void>): Promise<void>;
    protected _validateVariantsAndLog(variantIds?: Array<UmbVariantId>): Promise<void>;
    /**
     * Perform the create or update of the content
     * @param {Array<UmbVariantId>} variantIds - The variant ids to save
     * @param {DetailModelType} saveData - The data to save
     * @memberof UmbContentDetailWorkspaceContextBase
     */
    performCreateOrUpdate(variantIds: Array<UmbVariantId>, saveData: DetailModelType): Promise<void>;
    resetState(): void;
    abstract getContentTypeUnique(): string | undefined;
    abstract createPropertyDatasetContext(host: UmbControllerHost, variantId: UmbVariantId): UmbContentPropertyDatasetContext<DetailModelType, ContentTypeDetailModelType, VariantModelType>;
    destroy(): void;
}
