1 | import { ArgType } from '../blocks';
|
2 | export interface ControlProps<T> {
|
3 | name: string;
|
4 | value?: T;
|
5 | defaultValue?: T;
|
6 | argType?: ArgType;
|
7 | onChange: (value: T) => T | void;
|
8 | onFocus?: (evt: any) => void;
|
9 | onBlur?: (evt: any) => void;
|
10 | }
|
11 | export declare type ArrayValue = string[] | readonly string[];
|
12 | export interface ArrayConfig {
|
13 | separator?: string;
|
14 | }
|
15 | export declare type BooleanValue = boolean;
|
16 | export interface BooleanConfig {
|
17 | }
|
18 | export declare type ColorValue = string;
|
19 | export declare type PresetColor = ColorValue | {
|
20 | color: ColorValue;
|
21 | title?: string;
|
22 | };
|
23 | export interface ColorConfig {
|
24 | presetColors?: PresetColor[];
|
25 | startOpen?: boolean;
|
26 | }
|
27 | export declare type DateValue = Date | number;
|
28 | export interface DateConfig {
|
29 | }
|
30 | export declare type NumberValue = number;
|
31 | export interface NumberConfig {
|
32 | min?: number;
|
33 | max?: number;
|
34 | step?: number;
|
35 | }
|
36 | export declare type RangeConfig = NumberConfig;
|
37 | export declare type ObjectValue = any;
|
38 | export interface ObjectConfig {
|
39 | }
|
40 | export declare type OptionsSingleSelection = any;
|
41 | export declare type OptionsMultiSelection = any[];
|
42 | export declare type OptionsSelection = OptionsSingleSelection | OptionsMultiSelection;
|
43 | export declare type OptionsArray = any[];
|
44 | export declare type OptionsObject = Record<string, any>;
|
45 | export declare type Options = OptionsArray | OptionsObject;
|
46 | export declare type OptionsControlType = 'radio' | 'inline-radio' | 'check' | 'inline-check' | 'select' | 'multi-select';
|
47 | export interface OptionsConfig {
|
48 | labels: Record<any, string>;
|
49 | options: Options;
|
50 | type: OptionsControlType;
|
51 | }
|
52 | export interface NormalizedOptionsConfig {
|
53 | options: OptionsObject;
|
54 | }
|
55 | export declare type TextValue = string;
|
56 | export interface TextConfig {
|
57 | }
|
58 | export declare type ControlType = 'array' | 'boolean' | 'color' | 'date' | 'number' | 'range' | 'object' | OptionsControlType | 'text';
|
59 | export declare type Control = ArrayConfig | BooleanConfig | ColorConfig | DateConfig | NumberConfig | ObjectConfig | OptionsConfig | RangeConfig | TextConfig;
|
60 | export declare type Controls = Record<string, Control>;
|