import { EnvironmentProviders, Signal } from '@angular/core';
import { MessageService, ConfirmationService } from 'primeng/api';
import { HttpContext, HttpContextToken } from '@angular/common/http';
import { ValidatorFn, AbstractControl } from '@angular/forms';
import * as _masterteam_components from '@masterteam/components';
import { StateContext } from '@ngxs/store';
import { Observable } from 'rxjs';

interface MTThemeOptions {
    primaryColor?: string;
    textColor?: string;
    backgroundColor?: string;
}
declare function changePrimaryColor(color: string): void;
declare function changeBackgroundColor(color?: string): void;
declare function changeTextColor(color: string): void;
declare function provideMTComponents(themeOptions?: MTThemeOptions): EnvironmentProviders;

declare function provideMTMessages(): typeof MessageService;

declare function provideMTConfirmation(): typeof ConfirmationService;

type FieldType = 'text' | 'textarea' | 'select' | 'date' | 'number' | 'slider' | 'multi-select' | 'pick-list' | 'checkbox' | 'icon-field' | 'color-picker' | 'spacer' | 'lookup-matrix' | string;
type ValidatorType = 'required' | 'email' | 'minLength' | 'maxLength' | 'min' | 'max' | 'pattern' | 'custom';
type FieldRelationAction = 'enable' | 'disable' | 'show' | 'hide';
interface FieldRelationConfig {
    key: string;
    value: any;
    action: FieldRelationAction;
}
type FormulaConditionMode = 'auto' | 'show' | 'hide' | 'enable' | 'disable';
interface FormulaConditionConfig {
    formulaTokens: string;
    formulaText?: string;
    mode?: FormulaConditionMode;
}
type FormulaValidationSeverity = 'error' | 'warning';
interface FormulaValidationRuleConfig {
    id: string | number;
    formulaTokens: string;
    formulaText?: string;
    message: string;
    severity: FormulaValidationSeverity;
    enabled: boolean;
}
type FormulaRuntimeMessageCode = 'FORMULA_PARSE_ERROR' | 'FORMULA_EVALUATION_ERROR' | 'FORMULA_FALSE';
interface FormulaRuntimeMessage {
    code: FormulaRuntimeMessageCode;
    severity: FormulaValidationSeverity;
    message: string;
    formulaText?: string;
    ruleId?: string | number;
    fieldKey?: string;
}
interface ResponsiveColSpan {
    xs?: number;
    sm?: number;
    md?: number;
    lg?: number;
    xl?: number;
}
declare class ValidatorConfig {
    type: ValidatorType;
    value?: any;
    message?: string;
    customValidator?: (value: any) => boolean | Promise<boolean>;
    constructor(config: {
        type: ValidatorType;
        value?: any;
        message?: string;
        customValidator?: (value: any) => boolean | Promise<boolean>;
    });
    static required(message?: string): ValidatorConfig;
    static email(message?: string): ValidatorConfig;
    static minLength(length: number, message?: string): ValidatorConfig;
    static maxLength(length: number, message?: string): ValidatorConfig;
    static min(value: number, message?: string): ValidatorConfig;
    static max(value: number, message?: string): ValidatorConfig;
    static pattern(pattern: string, message?: string): ValidatorConfig;
    static custom(validator: (value: any) => boolean | Promise<boolean>, message?: string): ValidatorConfig;
}
type BaseFieldConstructorConfig = ConstructorParameters<typeof BaseFieldConfig>[0];
declare abstract class BaseFieldConfig {
    key: string;
    label: string;
    type: FieldType;
    required: boolean;
    disabled: boolean;
    readonly: boolean;
    hidden: boolean;
    placeholder: string;
    hint: string;
    cssClass: string;
    validators: ValidatorConfig[];
    order: number;
    colSpan: number | ResponsiveColSpan;
    defaultValue?: any;
    customTemplate: string;
    relations: FieldRelationConfig[];
    formulaCondition?: FormulaConditionConfig;
    constructor(config: {
        key?: string;
        label?: string;
        type: FieldType;
        required?: boolean;
        disabled?: boolean;
        readonly?: boolean;
        hidden?: boolean;
        placeholder?: string;
        hint?: string;
        cssClass?: string;
        validators?: ValidatorConfig[];
        order?: number;
        relations?: FieldRelationConfig[];
        formulaCondition?: FormulaConditionConfig;
        colSpan?: number | ResponsiveColSpan;
    });
}
declare class TextFieldConfig extends BaseFieldConfig {
    inputType: string;
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
        inputType?: string;
    });
}
declare class TextareaFieldConfig extends BaseFieldConfig {
    rows: number;
    autoResize: boolean;
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
        rows?: number;
        autoResize?: boolean;
    });
}
declare class SelectFieldConfig extends BaseFieldConfig {
    options: any[];
    optionLabel: string;
    optionValue: string;
    group: boolean;
    optionGroupLabel: string;
    optionGroupChildren: string;
    multiple: boolean;
    filter: boolean;
    filterBy: string;
    filterPlaceholder: string;
    showClear: boolean;
    emptyMessage: string;
    size: string;
    hasPlaceholderPrefix: boolean;
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
        options: any[];
        optionLabel?: string;
        optionValue?: string;
        group?: boolean;
        optionGroupLabel?: string;
        optionGroupChildren?: string;
        multiple?: boolean;
        filter?: boolean;
        filterBy?: string;
        filterPlaceholder?: string;
        showClear?: boolean;
        emptyMessage?: string;
        size?: string;
        hasPlaceholderPrefix?: boolean;
    });
}
declare class RadioButtonFieldConfig extends BaseFieldConfig {
    options: any[];
    optionLabel: string;
    optionValue: string;
    orientation: 'vertical' | 'horizontal';
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
        options: any[];
        optionLabel?: string;
        optionValue?: string;
        orientation?: 'vertical' | 'horizontal';
    });
}
declare class RadioCardsFieldConfig extends BaseFieldConfig {
    options: any[];
    optionLabel: string;
    optionValue: string;
    size: string;
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
        options: any[];
        optionLabel?: string;
        optionValue?: string;
        size?: string;
    });
}
declare class UserSearchFieldConfig extends BaseFieldConfig {
    optionLabel: string;
    optionValue: string;
    size: string;
    apiUrl: string;
    context: HttpContext | undefined;
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
        optionLabel?: string;
        optionValue?: string;
        size?: string;
        hint?: string;
        apiUrl?: string;
        context?: HttpContext | undefined;
        placeholder?: string;
    });
}
declare class UploadFileFieldConfig extends BaseFieldConfig {
    size: string;
    endPoint?: string;
    userImgClass?: string;
    shape?: string;
    multiple?: boolean;
    accept?: string;
    fileSizeLimit?: number | undefined;
    context: HttpContext | undefined;
    title: string;
    description: string;
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
        size?: string;
        endPoint?: string;
        userImgClass?: string;
        shape?: string;
        multiple?: boolean;
        accept?: string;
        fileSizeLimit?: number | undefined;
        context?: HttpContext | undefined;
        title?: string;
        description?: string;
    });
}
declare class DateFieldConfig extends BaseFieldConfig {
    dateFormat: string;
    showTime: boolean;
    showSeconds: boolean;
    hourFormat: '12' | '24';
    minDate?: Date;
    maxDate?: Date;
    disabledDates: Date[];
    disabledDays: number[];
    yearRange: string;
    showIcon: boolean;
    icon: string;
    showButtonBar: boolean;
    showClear: boolean;
    inline: boolean;
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
        dateFormat?: string;
        showTime?: boolean;
        showSeconds?: boolean;
        hourFormat?: '12' | '24';
        minDate?: Date;
        maxDate?: Date;
        disabledDates?: Date[];
        disabledDays?: number[];
        yearRange?: string;
        showIcon?: boolean;
        icon?: string;
        showButtonBar?: boolean;
        showClear?: boolean;
        inline?: boolean;
    });
}
declare class NumberFieldConfig extends BaseFieldConfig {
    min?: number;
    max?: number;
    step?: number;
    prefix?: string;
    suffix?: string;
    currency?: string;
    locale?: string;
    minFractionDigits?: number;
    maxFractionDigits?: number;
    useGrouping?: boolean;
    showButtons?: boolean;
    buttonLayout?: 'stacked' | 'horizontal';
    incrementButtonClass?: string;
    decrementButtonClass?: string;
    incrementButtonIcon?: string;
    decrementButtonIcon?: string;
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
        min?: number;
        max?: number;
        step?: number;
        prefix?: string;
        suffix?: string;
        currency?: string;
        locale?: string;
        minFractionDigits?: number;
        maxFractionDigits?: number;
        useGrouping?: boolean;
        showButtons?: boolean;
        buttonLayout?: 'stacked' | 'horizontal';
        incrementButtonClass?: string;
        decrementButtonClass?: string;
        incrementButtonIcon?: string;
        decrementButtonIcon?: string;
    });
}
declare class SliderFieldConfig extends BaseFieldConfig {
    min?: number;
    max?: number;
    step?: number;
    orientation?: 'horizontal' | 'vertical';
    range?: boolean;
    animate?: boolean;
    unit?: string;
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
        min?: number;
        max?: number;
        step?: number;
        orientation?: 'horizontal' | 'vertical';
        range?: boolean;
        animate?: boolean;
        unit?: string;
    });
}
declare class MultiSelectFieldConfig extends BaseFieldConfig {
    options: any[];
    optionLabel: string;
    optionValue: string;
    filter: boolean;
    filterBy: string;
    filterPlaceholder: string;
    showClear: boolean;
    emptyMessage: string;
    display?: 'comma' | 'chip';
    maxSelectedLabels?: number;
    selectedItemsLabel?: string;
    showToggleAll?: boolean;
    resetFilterOnHide?: boolean;
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
        options: any[];
        optionLabel?: string;
        optionValue?: string;
        filter?: boolean;
        filterBy?: string;
        filterPlaceholder?: string;
        showClear?: boolean;
        emptyMessage?: string;
        display?: 'comma' | 'chip';
        maxSelectedLabels?: number;
        selectedItemsLabel?: string;
        showToggleAll?: boolean;
        resetFilterOnHide?: boolean;
    });
}
declare class PickListFieldConfig extends BaseFieldConfig {
    options: any[];
    optionLabel: string;
    optionValue: string;
    sourceHeader: string;
    targetHeader: string;
    showSourceControls: boolean;
    showTargetControls: boolean;
    showSourceFilter: boolean;
    showTargetFilter: boolean;
    filterBy: string;
    dataKey?: string;
    dragdrop: boolean;
    responsive: boolean;
    breakpoint: string;
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
        options: any[];
        optionLabel?: string;
        optionValue?: string;
        sourceHeader?: string;
        targetHeader?: string;
        showSourceControls?: boolean;
        showTargetControls?: boolean;
        showSourceFilter?: boolean;
        showTargetFilter?: boolean;
        filterBy?: string;
        dataKey?: string;
        dragdrop?: boolean;
        responsive?: boolean;
    });
}
declare class CheckboxFieldConfig extends BaseFieldConfig {
    binary?: boolean;
    trueValue?: any;
    falseValue?: any;
    checkboxIcon?: string;
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
        binary?: boolean;
        trueValue?: any;
        falseValue?: any;
        checkboxIcon?: string;
    });
}
declare class ToggleFieldConfig extends BaseFieldConfig {
    toggleShape?: 'toggle' | 'card';
    icon?: string;
    descriptionCard?: string;
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
        toggleShape?: 'toggle' | 'card';
        icon?: string;
        descriptionCard?: string;
    });
}
declare class EditorFieldConfig extends BaseFieldConfig {
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'>);
}
declare class ColorPickerFieldConfig extends BaseFieldConfig {
    format?: 'hex' | 'rgb' | 'hsb';
    inline?: boolean;
    appendTo?: any;
    variant?: 'outlined' | 'filled';
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
        format?: 'hex' | 'rgb' | 'hsb';
        inline?: boolean;
        appendTo?: any;
        variant?: 'outlined' | 'filled';
    });
}
declare class IconFieldConfig extends BaseFieldConfig {
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {});
}
declare class SpacerFieldConfig extends BaseFieldConfig {
    constructor(config: Omit<BaseFieldConstructorConfig, 'type' | 'key' | 'label'> & {
        key?: string;
        label?: string;
    });
}
interface LookupOptionItemConfig {
    id?: number | string;
    key?: string;
    label: string;
    value: any;
    color?: string | null;
    description?: string;
}
interface LookupMatrixCellConfig {
    row: number;
    column: number;
    xLookupItemId: number | string;
    yLookupItemId: number | string;
    zLookupItemId?: number | string | null;
    label: string;
    color?: string | null;
}
declare class LookupMatrixFieldConfig extends BaseFieldConfig {
    xFieldKey: string;
    yFieldKey: string;
    xAxisLabel: string;
    yAxisLabel: string;
    xOptions: LookupOptionItemConfig[];
    yOptions: LookupOptionItemConfig[];
    cells: LookupMatrixCellConfig[];
    emptyMessage: string;
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
        xFieldKey: string;
        yFieldKey: string;
        xAxisLabel?: string;
        yAxisLabel?: string;
        xOptions?: LookupOptionItemConfig[];
        yOptions?: LookupOptionItemConfig[];
        cells?: LookupMatrixCellConfig[];
        emptyMessage?: string;
    });
}
declare class SchemaConnectionFieldConfig extends BaseFieldConfig {
    configuration: any;
    context: HttpContext | undefined;
    filter: boolean;
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
        configuration: any;
        context?: HttpContext | undefined;
        filter?: boolean;
    });
}
interface SchedulePredecessorFieldRuntimeContext {
    levelId?: number | string | null;
    levelDataId?: number | string | null;
    moduleDataId?: number | string | null;
}
declare class SchedulePredecessorFieldConfig extends BaseFieldConfig {
    configuration: any;
    runtimeContext: SchedulePredecessorFieldRuntimeContext | null;
    constructor(config: Omit<BaseFieldConstructorConfig, 'type'> & {
        configuration?: any;
        runtimeContext?: SchedulePredecessorFieldRuntimeContext | null;
    });
}
type DynamicFieldConfig = {
    [K in keyof (TextFieldConfig & TextareaFieldConfig & SelectFieldConfig & DateFieldConfig & NumberFieldConfig & SliderFieldConfig & MultiSelectFieldConfig & PickListFieldConfig & CheckboxFieldConfig & ToggleFieldConfig & ColorPickerFieldConfig & IconFieldConfig & SpacerFieldConfig & LookupMatrixFieldConfig & SchemaConnectionFieldConfig & SchedulePredecessorFieldConfig & BaseFieldConfig)]?: (TextFieldConfig & TextareaFieldConfig & SelectFieldConfig & DateFieldConfig & NumberFieldConfig & SliderFieldConfig & MultiSelectFieldConfig & PickListFieldConfig & CheckboxFieldConfig & ToggleFieldConfig & ColorPickerFieldConfig & IconFieldConfig & SpacerFieldConfig & LookupMatrixFieldConfig & SchemaConnectionFieldConfig & SchedulePredecessorFieldConfig & BaseFieldConfig)[K];
};
interface LayoutConfig {
    containerClass?: string;
    sectionClass?: string;
    fieldClass?: string;
}
interface DynamicFormConfig {
    sections: SectionConfig[];
    layout?: LayoutConfig;
    validationRules?: FormulaValidationRuleConfig[];
}
interface SectionConfig {
    key?: string;
    label?: string;
    type: 'none' | 'header';
    cssClass?: string;
    bodyClass?: string;
    headerClass?: string;
    columns?: number;
    order?: number;
    fields: DynamicFieldConfig[];
}
interface FieldState {
    hidden: boolean;
    disabled: boolean;
}
declare function createCustomValidator(customValidator: (value: any) => boolean | Promise<boolean>, message?: string): ValidatorFn;
declare function wrapValidatorWithMessage(validator: ValidatorFn, errorKey: string, message: string): ValidatorFn;

/**
 * Query result with separate signals for each property
 */
interface QueryResult<T> {
    data: Signal<T | null>;
    isPending: Signal<boolean>;
    isSuccess: Signal<boolean>;
    isError: Signal<boolean>;
    error: Signal<string | null>;
}
/**
 * @deprecated Use direct `select()` + `computed()` pattern instead for better performance.
 *
 * **Problem with BaseFacade:**
 * - All computed signals depend on the full state, causing unnecessary recomputations
 * - Bypasses NGXS selector memoization
 * - Uses `as any` casting, losing type safety
 *
 * **New Pattern - Use slice-based selectors:**
 *
 * ```typescript
 * // In your State class - add slice selectors:
 * @Selector()
 * static getLoadingActive(state: MyStateModel): string[] {
 *   return state.loadingActive;
 * }
 *
 * @Selector()
 * static getErrors(state: MyStateModel): Record<string, string | null> {
 *   return state.errors;
 * }
 *
 * // In your Facade - don't extend BaseFacade:
 * @Injectable({ providedIn: 'root' })
 * export class MyFacade {
 *   private readonly store = inject(Store);
 *
 *   // Data selectors - memoized by NGXS
 *   readonly items = select(MyState.getItems);
 *
 *   // Loading/Error slices - memoized by NGXS
 *   private readonly loadingActive = select(MyState.getLoadingActive);
 *   private readonly errors = select(MyState.getErrors);
 *
 *   // Loading signals - computed from slice (minimal reactivity)
 *   readonly isLoadingItems = computed(() =>
 *     this.loadingActive().includes(MyActionKey.GetItems)
 *   );
 *
 *   // Error signals - computed from slice (minimal reactivity)
 *   readonly itemsError = computed(() =>
 *     this.errors()[MyActionKey.GetItems] ?? null
 *   );
 *
 *   // Dispatchers
 *   loadItems() {
 *     return this.store.dispatch(new GetItems());
 *   }
 * }
 * ```
 *
 * **Template Usage:**
 * ```html
 * @if (facade.isLoadingItems()) {
 *   <loading-spinner />
 * } @else if (facade.itemsError(); as error) {
 *   <error-alert>{{ error }}</error-alert>
 * } @else {
 *   @for (item of facade.items(); track item.id) {
 *     <item-card [item]="item" />
 *   }
 * }
 * ```
 */
declare abstract class BaseFacade<TState, TLoadingName extends string> {
    /**
     * Override in child facade to provide the state selector
     */
    protected abstract state(): Signal<TState>;
    /**
     * Creates a query object with separate signals for data, loading, and error states
     * Each property is its own signal for granular reactivity
     *
     * @example
     * readonly modulesQuery = this.query(
     *   'getModulesLoading',
     *   (state) => state.allModules
     * );
     *
     * // In template - each is a separate signal:
     * @if (modulesQuery.isPending()) { Loading... }
     * @if (modulesQuery.error(); as error) { Error: {{ error }} }
     * @if (modulesQuery.data(); as modules) {
     *   <div *ngFor="let m of modules">{{ m.title }}</div>
     * }
     */
    protected query<T>(loadingKey: TLoadingName, dataSelector: (state: TState) => T): QueryResult<T>;
    /**
     * Creates a loading signal for a specific operation
     */
    protected loading(loadingKey: TLoadingName): Signal<boolean>;
    /**
     * Creates an error signal for a specific operation
     */
    protected errorSignal(loadingKey: TLoadingName): Signal<string | null>;
}

interface LoadingStateShape<L extends string = string> {
    loadingActive: L[];
    errors: Partial<Record<L, string>>;
}
type LoadingName<T extends LoadingStateShape<string>> = T['loadingActive'][number];
declare function startLoading<T extends LoadingStateShape<string>>(ctx: StateContext<T>, loadingName: LoadingName<T>): void;
declare function endLoading<T extends LoadingStateShape<string>>(ctx: StateContext<T>, loadingName: LoadingName<T>): void;
declare function setLoadingError<T extends LoadingStateShape<string>>(ctx: StateContext<T>, loadingName: LoadingName<T>, message: string): void;

interface Response<T> {
    endpoint: string;
    status: number;
    code: number;
    locale: string;
    message?: string | null;
    errors?: unknown | null;
    data: T;
    cacheSession?: string;
}
interface CrudLoadConfig<T, TState, TData = T[]> {
    key: string;
    request$: Observable<Response<TData>>;
    stateProperty?: (state: TState) => T[];
    /**
     * @deprecated Use `handleApiRequest` with `onSuccess` for complex state updates.
     * CRUD methods should only be used for simple array operations with `stateProperty`.
     */
    updateState?: (state: TState, data: TData) => Partial<TState>;
    /**
     * @deprecated Use `handleApiRequest` with `onSuccess` for data transformation.
     * CRUD methods should only be used for simple array operations.
     */
    transform?: (data: TData) => TData;
    onError?: (error: any, state: TState) => Partial<TState> | void;
    errorMessage?: string;
}
interface CrudCreateConfig<T, TState> {
    key: string;
    request$: Observable<Response<T>>;
    stateProperty: (state: TState) => T[];
    /**
     * @deprecated Use `handleApiRequest` with `onSuccess` for complex state updates.
     * CRUD methods should only be used for simple array operations with `stateProperty`.
     */
    updateState?: (state: TState, items: T[]) => Partial<TState>;
    /**
     * @deprecated Use `handleApiRequest` with `onSuccess` for data transformation.
     * CRUD methods should only be used for simple array operations.
     */
    transform?: (data: T) => T;
    onError?: (error: any, state: TState) => Partial<TState> | void;
    errorMessage?: string;
}
interface CrudUpdateConfig<T, TState> {
    key: string;
    request$: Observable<Response<T>>;
    uniqueKey: keyof T;
    id: string | number;
    stateProperty: (state: TState) => T[];
    /**
     * @deprecated Use `handleApiRequest` with `onSuccess` for complex state updates.
     * CRUD methods should only be used for simple array operations with `stateProperty`.
     */
    updateState?: (state: TState, items: T[]) => Partial<TState>;
    /**
     * @deprecated Use `handleApiRequest` with `onSuccess` for data transformation.
     * CRUD methods should only be used for simple array operations.
     */
    transform?: (data: T) => T;
    onError?: (error: any, state: TState) => Partial<TState> | void;
    errorMessage?: string;
}
interface CrudDeleteConfig<T, TState> {
    key: string;
    request$: Observable<Response<void>>;
    uniqueKey: keyof T;
    id: string | number;
    stateProperty: (state: TState) => T[];
    /**
     * @deprecated Use `handleApiRequest` with `onSuccess` for complex state updates.
     * CRUD methods should only be used for simple array operations with `stateProperty`.
     */
    updateState?: (state: TState, items: T[]) => Partial<TState>;
    onError?: (error: any, state: TState) => Partial<TState> | void;
    errorMessage?: string;
}
/**
 * T      = entity type (Module, User, ...)
 * TState = full state model (must include LoadingStateShape)
 * TLoad  = union type of loading keys for this feature
 */
declare abstract class CrudStateBase<T, TState extends LoadingStateShape<TLoad>, TLoad extends string> {
    protected adapter: _masterteam_components.EntityAdapter<T>;
    /**
     * Helper to create default updateState function
     */
    private getDefaultUpdateState;
    /**
     * @deprecated Use `handleApiRequest` directly with `onSuccess` callback.
     * The `load()` method provides no significant benefit over `handleApiRequest`.
     *
     * @example
     * // Instead of this.load(), use:
     * return handleApiRequest({
     *   ctx,
     *   key: ActionKey.GetItems,
     *   request$: req$,
     *   onSuccess: (response) => ({
     *     items: response.data ?? [],
     *   }),
     * });
     */
    protected load<TData = T[]>(ctx: StateContext<TState>, config: CrudLoadConfig<T, TState, TData>): Observable<Response<TData>>;
    /**
     * Create one entity with config object
     */
    protected create(ctx: StateContext<TState>, config: CrudCreateConfig<T, TState>): Observable<Response<T>>;
    /**
     * Update one entity with config object
     */
    protected update(ctx: StateContext<TState>, config: CrudUpdateConfig<T, TState>): Observable<Response<T>>;
    /**
     * Delete one entity with config object
     */
    protected delete(ctx: StateContext<TState>, config: CrudDeleteConfig<T, TState>): Observable<Response<void>>;
}

type TailwindColorPalette = {
    [key: string]: string;
};
/**
 * Generates a Tailwind-like color palette (50-950) from a primary color (assumed to be 500).
 *
 * @param primaryColor500 - The hex string of the primary color (e.g., "#0284c7").
 * @returns An object representing the color palette, where keys are color numbers (e.g., "50", "100")
 * and values are hex color strings.
 */
type PaletteShade = '0' | '50' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | '950';
/**
 * Generates a Tailwind-like color palette (50-950) from any given base color.
 *
 * @param baseColorHex - The hex string of the base color (e.g., "#0284c7").
 * @param baseColorShade - The shade of the base color (e.g., "500", "700").
 * @returns An object representing the full color palette.
 */
declare function generateTailwindPalette(baseColorHex: string, baseColorShade?: PaletteShade): TailwindColorPalette;

declare function isInvalid(control: AbstractControl | null): boolean;

interface ApiRequestConfig<TState, TResponse> {
    ctx: StateContext<TState>;
    key: string;
    request$: Observable<TResponse>;
    onSuccess: (response: TResponse, state: TState) => Partial<TState> | void;
    onError?: (error: any, state: TState) => Partial<TState> | void;
    errorMessage?: string;
}
declare function handleApiRequest<TState extends LoadingStateShape<string>, TResponse>(config: ApiRequestConfig<TState, TResponse>): Observable<TResponse>;

interface EntityAdapter<T> {
    addOne(state: T[], entity: T): T[];
    upsertOne(state: T[], entity: T, uniqueKey?: keyof T): T[];
    updateOne(state: T[], id: string | number, changes: Partial<T>, uniqueKey?: keyof T): T[];
    removeOne(state: T[], id: string | number, uniqueKey?: keyof T): T[];
    setAll(state: T[], entities: T[]): T[];
}
declare function createEntityAdapter<T>(): EntityAdapter<T>;

/**
 * HTTP context configuration for request handling
 */
interface RequestContextConfig {
    /** Use base URL instead of gateway URL */
    useBaseUrl?: boolean;
}
/**
 * Shared HTTP context token for request configuration.
 * Used by interceptors to determine base URL routing.
 *
 * @example
 * ```typescript
 * import { REQUEST_CONTEXT } from '@masterteam/components';
 *
 * // In a service
 * private context = new HttpContext().set(REQUEST_CONTEXT, { useBaseUrl: true });
 *
 * getMetadata(): Observable<any> {
 *   return this.http.get('metadata', { context: this.context });
 * }
 *
 * // In interceptor
 * const config = req.context.get(REQUEST_CONTEXT);
 * if (config?.useBaseUrl) {
 *   // Use base URL
 * }
 * ```
 */
declare const REQUEST_CONTEXT: HttpContextToken<RequestContextConfig>;

/**
 * Color utility functions for brand display.
 */
/**
 * Converts a hex color to a light shade (equivalent to primary-100 in Tailwind).
 * This creates a color with ~10% opacity or a very light tint by mixing with white.
 */
declare function getLightColor(hexColor: string): string;
declare function getContrastColor(bgColor: string): string;

export { BaseFacade, BaseFieldConfig, CheckboxFieldConfig, ColorPickerFieldConfig, CrudStateBase, DateFieldConfig, EditorFieldConfig, IconFieldConfig, LookupMatrixFieldConfig, MultiSelectFieldConfig, NumberFieldConfig, PickListFieldConfig, REQUEST_CONTEXT, RadioButtonFieldConfig, RadioCardsFieldConfig, SchedulePredecessorFieldConfig, SchemaConnectionFieldConfig, SelectFieldConfig, SliderFieldConfig, SpacerFieldConfig, TextFieldConfig, TextareaFieldConfig, ToggleFieldConfig, UploadFileFieldConfig, UserSearchFieldConfig, ValidatorConfig, changeBackgroundColor, changePrimaryColor, changeTextColor, createCustomValidator, createEntityAdapter, endLoading, generateTailwindPalette, getContrastColor, getLightColor, handleApiRequest, isInvalid, provideMTComponents, provideMTConfirmation, provideMTMessages, setLoadingError, startLoading, wrapValidatorWithMessage };
export type { ApiRequestConfig, BaseFieldConstructorConfig, CrudCreateConfig, CrudDeleteConfig, CrudLoadConfig, CrudUpdateConfig, DynamicFieldConfig, DynamicFormConfig, EntityAdapter, FieldRelationAction, FieldRelationConfig, FieldState, FieldType, FormulaConditionConfig, FormulaConditionMode, FormulaRuntimeMessage, FormulaRuntimeMessageCode, FormulaValidationRuleConfig, FormulaValidationSeverity, LayoutConfig, LoadingStateShape, LookupMatrixCellConfig, LookupOptionItemConfig, MTThemeOptions, PaletteShade, QueryResult, RequestContextConfig, Response, ResponsiveColSpan, SchedulePredecessorFieldRuntimeContext, SectionConfig, ValidatorType };
