import type { ValueOf } from 'clientnode'; import type BasePropertyTypes from 'clientnode/property-types'; import type { GenericEvent } from 'react-generic-tools/type'; import type { ComponentAdapter, PropertiesValidationMap } from 'web-component-wrapper/type'; import type { IconProperties } from '../../implementations/type'; import type { Component as BaseComponent, ModelState as BaseModelState } from '../../type'; import type { AdapterWithReferences as TextInputAdapterWithReferences, Model as TextInputModel, Properties as TextInputProperties, Props as TextInputProps } from '../TextInput/type'; export type DateTimeRepresentation = number | string; export interface Value { end?: DateTimeRepresentation | null; start?: DateTimeRepresentation | null; } export type IntervalTextInputModel = Omit, 'maximum' | 'minimum'> & { maximum: DateTimeRepresentation; minimum: DateTimeRepresentation; }; export type IntervalTextInputProps = Omit, 'maximum' | 'minimum'> & { maximum: DateTimeRepresentation; minimum: DateTimeRepresentation; }; export interface Configuration { end: Partial | Partial; start: Partial | Partial; } export type ModelState = BaseModelState; export interface Model { name: string; state?: ModelState; value: { end: IntervalTextInputModel; start: IntervalTextInputModel; }; } export interface Properties extends Omit, 'icon' | 'model' | 'onChange' | 'onChangeValue' | 'value'> { icon: IconProperties; model: Model; onChange: (properties: this, event?: GenericEvent) => void; onChangeValue: (value: Value | null, event?: GenericEvent) => void; value: Configuration; } type PartialValue = Partial, 'value'>> & { value: DateTimeRepresentation | null; }; export type PartialModel = Partial> & { value?: { end?: PartialValue; start?: PartialValue; }; state?: Partial; }; export type Props = Omit, 'icon' | 'model' | 'onChange' | 'onChangeValue' | 'value'> & Partial<{ end: Partial, 'maximum' | 'minimum'> & { maximum: DateTimeRepresentation; minimum: DateTimeRepresentation; }>; start: Partial, 'maximum' | 'minimum'> & { maximum: DateTimeRepresentation; minimum: DateTimeRepresentation; }>; icon: IconProperties | string; model?: PartialModel; onChange: Properties['onChange']; onChangeValue: Properties['onChangeValue']; value?: Configuration | Value | null; }>; export type DefaultProperties = Omit & { model: Model; }; export type PropertyTypes = { [key in keyof Properties]: ValueOf; }; export type Adapter = ComponentAdapter; export interface AdapterWithReferences extends Adapter { references: { end: (TextInputAdapterWithReferences | null); start: (TextInputAdapterWithReferences | null); }; } export type Component = BaseComponent; export declare const propertyTypes: PropertiesValidationMap; export declare const defaultProperties: DefaultProperties; export {};