@plasmicapp/host 1.0.227 → 1.0.229
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/host.esm.js +1 -1
- package/dist/host.esm.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/types/component-types.d.ts +10 -17
- package/dist/types/function-types.d.ts +26 -21
- package/dist/types/query-builder-types.d.ts +51 -0
- package/dist/types/shared-controls.d.ts +17 -7
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
- package/registerComponent/dist/types/component-types.d.ts +10 -17
- package/registerComponent/dist/types/function-types.d.ts +26 -21
- package/registerComponent/dist/types/query-builder-types.d.ts +51 -0
- package/registerComponent/dist/types/shared-controls.d.ts +17 -7
- package/registerComponent/dist/version.d.ts +1 -1
- package/registerFunction/dist/types/component-types.d.ts +10 -17
- package/registerFunction/dist/types/function-types.d.ts +26 -21
- package/registerFunction/dist/types/query-builder-types.d.ts +51 -0
- package/registerFunction/dist/types/shared-controls.d.ts +17 -7
- package/registerFunction/dist/version.d.ts +1 -1
- package/registerGlobalContext/dist/types/component-types.d.ts +10 -17
- package/registerGlobalContext/dist/types/function-types.d.ts +26 -21
- package/registerGlobalContext/dist/types/query-builder-types.d.ts +51 -0
- package/registerGlobalContext/dist/types/shared-controls.d.ts +17 -7
- package/registerGlobalContext/dist/version.d.ts +1 -1
- package/registerToken/dist/types/component-types.d.ts +10 -17
- package/registerToken/dist/types/function-types.d.ts +26 -21
- package/registerToken/dist/types/query-builder-types.d.ts +51 -0
- package/registerToken/dist/types/shared-controls.d.ts +17 -7
- package/registerToken/dist/version.d.ts +1 -1
- package/registerTrait/dist/types/component-types.d.ts +10 -17
- package/registerTrait/dist/types/function-types.d.ts +26 -21
- package/registerTrait/dist/types/query-builder-types.d.ts +51 -0
- package/registerTrait/dist/types/shared-controls.d.ts +17 -7
- package/registerTrait/dist/version.d.ts +1 -1
|
@@ -2,49 +2,51 @@ import { ChoiceCore, ChoiceValue } from "./choice-type";
|
|
|
2
2
|
import { ArrayTypeBaseCore, ObjectTypeBaseCore } from "./container-types";
|
|
3
3
|
import { DynamicCore, GraphQLCore, GraphQLValue } from "./misc-types";
|
|
4
4
|
import { DateRangeStringsCore, DateStringCore, NumberTypeBaseCore, RichBooleanCore } from "./primitive-types";
|
|
5
|
-
import {
|
|
5
|
+
import { QueryBuilderCore } from "./query-builder-types";
|
|
6
|
+
import { CommonTypeBase, ContextDependentConfig, Defaultable, GenericContext } from "./shared-controls";
|
|
6
7
|
import { Nullish } from "./type-utils";
|
|
7
8
|
export type FunctionControlContext<P> = GenericContext<Partial<P>, // Partial function props
|
|
8
9
|
any>;
|
|
9
10
|
export type FunctionContextConfig<Args extends any[], R> = ContextDependentConfig<FunctionControlContext<Args>, R>;
|
|
10
|
-
export interface
|
|
11
|
+
export interface ParamTypeBase extends CommonTypeBase {
|
|
11
12
|
name: string;
|
|
12
|
-
description?: string;
|
|
13
13
|
isOptional?: boolean;
|
|
14
14
|
isRestParameter?: boolean;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export type ParamTypeBaseDefault<Ctx extends any[], T> = ParamTypeBase & Defaultable<Ctx, T>;
|
|
17
|
+
export interface FunctionMeta extends CommonTypeBase {
|
|
17
18
|
name: string;
|
|
18
19
|
rest?: boolean;
|
|
19
20
|
}
|
|
20
|
-
export interface PlainStringType<T extends Nullish<string> = string> extends
|
|
21
|
+
export interface PlainStringType<T extends Nullish<string> = string> extends ParamTypeBaseDefault<any[], T> {
|
|
21
22
|
type: "string" | `'${T}'`;
|
|
22
23
|
}
|
|
23
24
|
export type StringType<P, T extends string = string> = "string" | PlainStringType<T> | ChoiceType<P, T> | DateStringType | DateRangeStringsType | AnyType;
|
|
24
|
-
export interface PlainNumberType<T extends Nullish<number> = number> extends
|
|
25
|
+
export interface PlainNumberType<T extends Nullish<number> = number> extends ParamTypeBaseDefault<any[], T> {
|
|
25
26
|
type: "number" | `${number extends T ? number : T}`;
|
|
26
27
|
}
|
|
27
|
-
export type NumberType<P, T extends number = number> = PlainNumberType<T> | (
|
|
28
|
-
export interface PlainBooleanType<T extends Nullish<boolean> = boolean> extends
|
|
28
|
+
export type NumberType<P, T extends number = number> = PlainNumberType<T> | (ParamTypeBaseDefault<FunctionControlContext<P>, T> & NumberTypeBaseCore<FunctionControlContext<P>>) | ChoiceType<P, T> | AnyType;
|
|
29
|
+
export interface PlainBooleanType<T extends Nullish<boolean> = boolean> extends ParamTypeBaseDefault<any[], T> {
|
|
29
30
|
type: "boolean" | `${boolean extends T ? boolean : T}`;
|
|
30
31
|
}
|
|
31
|
-
export type BooleanType<P, T extends boolean = boolean> = PlainBooleanType<T> | (
|
|
32
|
-
export type GraphQLType<P> =
|
|
33
|
-
export interface PlainNullType extends
|
|
32
|
+
export type BooleanType<P, T extends boolean = boolean> = PlainBooleanType<T> | (ParamTypeBaseDefault<FunctionControlContext<P>, T> & RichBooleanCore) | ChoiceType<P, T> | AnyType;
|
|
33
|
+
export type GraphQLType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, any> & GraphQLCore<FunctionControlContext<P>>;
|
|
34
|
+
export interface PlainNullType extends ParamTypeBaseDefault<any[], null> {
|
|
34
35
|
type: "null";
|
|
35
36
|
}
|
|
36
37
|
export type NullType = PlainNullType | AnyType;
|
|
37
|
-
export interface PlainUndefinedType extends
|
|
38
|
+
export interface PlainUndefinedType extends ParamTypeBaseDefault<any[], undefined> {
|
|
38
39
|
type: "undefined";
|
|
39
40
|
}
|
|
40
41
|
export type UndefinedType = PlainUndefinedType | AnyType;
|
|
41
|
-
export type ObjectType<P> =
|
|
42
|
-
export type ArrayType<P> =
|
|
43
|
-
export
|
|
42
|
+
export type ObjectType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, Record<string, any>> & ObjectTypeBaseCore<FunctionControlContext<P>, AnyTyping<P, any>>;
|
|
43
|
+
export type ArrayType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, any[]> & ArrayTypeBaseCore<FunctionControlContext<P>, AnyTyping<P, any>>;
|
|
44
|
+
export type QueryBuilderType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, any> & QueryBuilderCore<FunctionControlContext<P>>;
|
|
45
|
+
export interface PlainAnyType extends ParamTypeBaseDefault<FunctionControlContext<any>, any> {
|
|
44
46
|
type: "any";
|
|
45
47
|
}
|
|
46
48
|
export type AnyType = PlainAnyType;
|
|
47
|
-
export interface PlainVoidType extends
|
|
49
|
+
export interface PlainVoidType extends ParamTypeBase {
|
|
48
50
|
type: "void";
|
|
49
51
|
}
|
|
50
52
|
export type VoidType = PlainVoidType | AnyType;
|
|
@@ -52,7 +54,7 @@ type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
|
52
54
|
type CommonType<P, T> = T extends GraphQLValue ? GraphQLType<P> : T extends null ? NullType : T extends undefined ? UndefinedType : T extends Array<any> ? ArrayType<P> : T extends object ? ObjectType<P> : AnyType;
|
|
53
55
|
type AnyTyping<P, T> = T extends string ? StringType<P, T> : T extends number ? NumberType<P, T> : T extends boolean ? BooleanType<P, T> : CommonType<P, T>;
|
|
54
56
|
export type ToTuple<T> = T extends any[] ? T : never;
|
|
55
|
-
export type FunctionChoiceType<Args, Opt extends ChoiceValue = ChoiceValue> = FunctionMeta<ToTuple<Args
|
|
57
|
+
export type FunctionChoiceType<Args, Opt extends ChoiceValue = ChoiceValue> = FunctionMeta & Defaultable<FunctionControlContext<ToTuple<Args>>, Opt | Opt[]> & ChoiceCore<FunctionControlContext<ToTuple<Args>>, Opt>;
|
|
56
58
|
export interface SingleChoiceType<P, Opt extends ChoiceValue = ChoiceValue> extends FunctionChoiceType<P, Opt> {
|
|
57
59
|
multiSelect?: false;
|
|
58
60
|
}
|
|
@@ -63,14 +65,17 @@ export interface CustomChoiceType<P, Opt extends ChoiceValue = ChoiceValue> exte
|
|
|
63
65
|
multiSelect: FunctionContextConfig<ToTuple<P>, boolean>;
|
|
64
66
|
}
|
|
65
67
|
export type ChoiceType<P, T extends ChoiceValue = ChoiceValue> = SingleChoiceType<P, T> | MultiChoiceType<P, T> | CustomChoiceType<P, T>;
|
|
66
|
-
export type DateStringType =
|
|
67
|
-
export type DateRangeStringsType =
|
|
68
|
-
|
|
68
|
+
export type DateStringType = ParamTypeBaseDefault<FunctionControlContext<string>, string> & DateStringCore;
|
|
69
|
+
export type DateRangeStringsType = ParamTypeBaseDefault<FunctionControlContext<[string, string]>, [
|
|
70
|
+
string,
|
|
71
|
+
string
|
|
72
|
+
]> & DateRangeStringsCore;
|
|
73
|
+
export interface DynamicType<P> extends ParamTypeBase, DynamicCore<FunctionControlContext<ToTuple<P>>, ParamType<P, any>> {
|
|
69
74
|
}
|
|
70
75
|
export type RestrictedType<P, T> = IsAny<T> extends true ? AnyTyping<P, T> : [
|
|
71
76
|
T
|
|
72
77
|
] extends [string] ? StringType<P, T> : [T] extends [number] ? NumberType<P, T> : [T] extends [boolean] ? BooleanType<P, T> : T extends string | null | undefined ? Exclude<T, null | undefined> extends string ? StringType<P, T extends string ? T : string> : CommonType<P, T> : T extends number | null | undefined ? Exclude<T, null | undefined> extends number ? NumberType<P, T extends number ? T : number> : CommonType<P, T> : T extends boolean | null | undefined ? Exclude<T, null | undefined> extends boolean ? BooleanType<P, T extends boolean ? T : boolean> : CommonType<P, T> : CommonType<P, T>;
|
|
73
|
-
export type ParamType<P, T> = RestrictedType<P, T> | DynamicType<P>;
|
|
78
|
+
export type ParamType<P, T> = RestrictedType<P, T> | DynamicType<P> | QueryBuilderType<P>;
|
|
74
79
|
export type RequiredParam<P, T> = ParamType<P, T> & {
|
|
75
80
|
isOptional?: false;
|
|
76
81
|
isRestParameter?: false;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ContextDependentConfig } from "./shared-controls";
|
|
2
|
+
/**
|
|
3
|
+
* Control type for building a custom query format.
|
|
4
|
+
*
|
|
5
|
+
* This control is based on react-awesome-query-builder
|
|
6
|
+
* and returns data in JsonLogic format.
|
|
7
|
+
*
|
|
8
|
+
* If using this control type, it's recommended to install
|
|
9
|
+
* @react-awesome-query-builder/core and json-logic-js as devDependencies
|
|
10
|
+
* so that you can reference their types.
|
|
11
|
+
*
|
|
12
|
+
* References:
|
|
13
|
+
* - https://github.com/ukrbublik/react-awesome-query-builder
|
|
14
|
+
* - https://github.com/jwadhams/json-logic-js
|
|
15
|
+
* - https://jsonlogic.com/
|
|
16
|
+
*/
|
|
17
|
+
export interface QueryBuilderCore<Ctx extends any[]> {
|
|
18
|
+
type: "queryBuilder";
|
|
19
|
+
/**
|
|
20
|
+
* Return a @react-awesome-query-builder/core `Config` that will be merged
|
|
21
|
+
* with Plasmic's built-in config.
|
|
22
|
+
*
|
|
23
|
+
* https://github.com/plasmicapp/plasmic/blob/master/platform/wab/src/wab/client/components/QueryBuilder/QueryBuilderConfig.tsx
|
|
24
|
+
*
|
|
25
|
+
* At a minimum, this should return fields and their types.
|
|
26
|
+
* For configuration options, see react-awesome-query-builder docs.
|
|
27
|
+
*/
|
|
28
|
+
config: ContextDependentConfig<Ctx, SimplifiedConfig>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A simplified subset of @react-awesome-query-builder/core `Config`.
|
|
32
|
+
*/
|
|
33
|
+
interface SimplifiedConfig {
|
|
34
|
+
fields: SimplifiedFields;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A simplified subset of @react-awesome-query-builder/core `Fields`.
|
|
38
|
+
*/
|
|
39
|
+
interface SimplifiedFields {
|
|
40
|
+
[key: string]: SimplifiedField;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A simplified subset of @react-awesome-query-builder/core `FieldOrGroup`.
|
|
44
|
+
*/
|
|
45
|
+
interface SimplifiedField {
|
|
46
|
+
type: "text" | "number" | "boolean" | "date" | "time" | "datetime" | "select" | "multiselect" | "treeselect" | "treemultiselect" | string;
|
|
47
|
+
label?: string;
|
|
48
|
+
defaultValue?: unknown;
|
|
49
|
+
fieldSettings?: {};
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
@@ -17,10 +17,14 @@ export type ControlExtras = {
|
|
|
17
17
|
item?: any;
|
|
18
18
|
};
|
|
19
19
|
export type InferDataType<P> = P extends CanvasComponentProps<infer Data> ? Data : any;
|
|
20
|
-
export interface CommonTypeBase
|
|
20
|
+
export interface CommonTypeBase {
|
|
21
21
|
description?: string;
|
|
22
22
|
helpText?: string;
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* If true, will hide the prop in a collapsed section; good for props that
|
|
25
|
+
* should not usually be used.
|
|
26
|
+
*/
|
|
27
|
+
advanced?: boolean;
|
|
24
28
|
/**
|
|
25
29
|
* If the user has chosen to use a dynamic expression for this prop, provide
|
|
26
30
|
* a hint as to the expected values that the expression should evaluate to.
|
|
@@ -28,13 +32,19 @@ export interface CommonTypeBase<Ctx extends any[]> {
|
|
|
28
32
|
* markdown in the text here.
|
|
29
33
|
*/
|
|
30
34
|
exprHint?: string;
|
|
31
|
-
/**
|
|
32
|
-
* Function for whether this prop should be hidden in the right panel,
|
|
33
|
-
* given the current props for this component
|
|
34
|
-
*/
|
|
35
|
-
hidden?: ContextDependentConfig<Ctx, boolean>;
|
|
36
35
|
/**
|
|
37
36
|
* If true, does not allow the user to use a dynamic expression for this prop
|
|
38
37
|
*/
|
|
39
38
|
disableDynamicValue?: boolean;
|
|
40
39
|
}
|
|
40
|
+
export interface Defaultable<Ctx extends any[], T> {
|
|
41
|
+
/**
|
|
42
|
+
* Default value to set for this prop when the component is instantiated
|
|
43
|
+
*/
|
|
44
|
+
defaultValue?: T;
|
|
45
|
+
/**
|
|
46
|
+
* Specify that default when no prop/param is provided,
|
|
47
|
+
* so the Plasmic user can see it in the studio UI
|
|
48
|
+
*/
|
|
49
|
+
defaultValueHint?: T | ContextDependentConfig<Ctx, T | undefined>;
|
|
50
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const hostVersion = "1.0.
|
|
1
|
+
export declare const hostVersion = "1.0.229";
|
|
@@ -4,20 +4,16 @@ import { ChoiceCore, ChoiceValue } from "./choice-type";
|
|
|
4
4
|
import { ArrayTypeBaseCore, ObjectTypeBaseCore } from "./container-types";
|
|
5
5
|
import { DataPickerValueType, DataSourceCore, DynamicCore, GraphQLCore, GraphQLValue, RichDataPickerCore, RichExprEditorCore } from "./misc-types";
|
|
6
6
|
import { CardPickerCore, ClassCore, CodeStringCore, ColorCore, DateRangeStringsCore, DateStringCore, HrefCore, NumberTypeBaseCore, PlainNumberCore, PlainStringCore, RichBooleanCore, RichTextCore, SliderNumberCore, ThemeResetClassCore } from "./primitive-types";
|
|
7
|
-
import { CommonTypeBase, ContextDependentConfig, ControlExtras, GenericContext, InferDataType } from "./shared-controls";
|
|
7
|
+
import { CommonTypeBase, ContextDependentConfig, ControlExtras, Defaultable, GenericContext, InferDataType } from "./shared-controls";
|
|
8
8
|
export type ComponentControlContext<P> = GenericContext<P, // Full component props
|
|
9
9
|
// Full component props
|
|
10
10
|
InferDataType<P> | null, // Canvas data
|
|
11
11
|
ControlExtras>;
|
|
12
12
|
export type ComponentContextConfig<Props, R> = ContextDependentConfig<ComponentControlContext<Props>, R>;
|
|
13
|
-
export interface PropTypeBase<Ctx extends any[]> extends CommonTypeBase
|
|
13
|
+
export interface PropTypeBase<Ctx extends any[]> extends CommonTypeBase {
|
|
14
14
|
displayName?: string;
|
|
15
|
+
required?: boolean;
|
|
15
16
|
readOnly?: boolean | ContextDependentConfig<Ctx, boolean>;
|
|
16
|
-
/**
|
|
17
|
-
* If true, will hide the prop in a collapsed section; good for props that
|
|
18
|
-
* should not usually be used.
|
|
19
|
-
*/
|
|
20
|
-
advanced?: boolean;
|
|
21
17
|
/**
|
|
22
18
|
* If set to true, the component will be remounted when the prop value is updated.
|
|
23
19
|
* (This behavior only applies to canvas)
|
|
@@ -27,17 +23,13 @@ export interface PropTypeBase<Ctx extends any[]> extends CommonTypeBase<Ctx> {
|
|
|
27
23
|
* If true, the prop can't be overriden in different variants.
|
|
28
24
|
*/
|
|
29
25
|
invariantable?: boolean;
|
|
30
|
-
}
|
|
31
|
-
export interface Defaultable<Ctx extends any[], T> {
|
|
32
26
|
/**
|
|
33
|
-
*
|
|
34
|
-
|
|
35
|
-
defaultValue?: T;
|
|
36
|
-
/**
|
|
37
|
-
* If no prop is given, the component uses a default; specify what
|
|
38
|
-
* that default is so the Plasmic user can see it in the studio UI
|
|
27
|
+
* Function for whether this prop should be hidden in the right panel,
|
|
28
|
+
* given the current props for this component
|
|
39
29
|
*/
|
|
40
|
-
|
|
30
|
+
hidden?: ContextDependentConfig<Ctx, boolean>;
|
|
31
|
+
}
|
|
32
|
+
interface ExtendedDefaultable<Ctx extends any[], T> extends Defaultable<Ctx, T> {
|
|
41
33
|
/**
|
|
42
34
|
* Use a dynamic value expression as the default instead
|
|
43
35
|
*/
|
|
@@ -65,7 +57,7 @@ export interface Controllable {
|
|
|
65
57
|
*/
|
|
66
58
|
uncontrolledProp?: string;
|
|
67
59
|
}
|
|
68
|
-
export type PropTypeBaseDefault<P, T> = PropTypeBase<ComponentControlContext<P>> &
|
|
60
|
+
export type PropTypeBaseDefault<P, T> = PropTypeBase<ComponentControlContext<P>> & ExtendedDefaultable<ComponentControlContext<P>, T> & Controllable;
|
|
69
61
|
export type PlainStringType<P> = PropTypeBaseDefault<P, string> & PlainStringCore;
|
|
70
62
|
export type CodeStringType<P> = PropTypeBaseDefault<P, string> & CodeStringCore;
|
|
71
63
|
export type RichTextType<P> = PropTypeBaseDefault<P, string> & RichTextCore;
|
|
@@ -256,3 +248,4 @@ export type StringCompatType<P> = DateStringType<P> | StringType<P> | ChoiceType
|
|
|
256
248
|
export type BoolCompatType<P> = BooleanType<P> | CustomType<P> | DataPickerType<P>;
|
|
257
249
|
export type NumberCompatType<P> = NumberType<P> | CustomType<P> | DataPickerType<P>;
|
|
258
250
|
export type RestrictPropType<T, P> = T extends string ? StringCompatType<P> : T extends boolean ? BoolCompatType<P> : T extends number ? NumberCompatType<P> : PropType<P>;
|
|
251
|
+
export {};
|
|
@@ -2,49 +2,51 @@ import { ChoiceCore, ChoiceValue } from "./choice-type";
|
|
|
2
2
|
import { ArrayTypeBaseCore, ObjectTypeBaseCore } from "./container-types";
|
|
3
3
|
import { DynamicCore, GraphQLCore, GraphQLValue } from "./misc-types";
|
|
4
4
|
import { DateRangeStringsCore, DateStringCore, NumberTypeBaseCore, RichBooleanCore } from "./primitive-types";
|
|
5
|
-
import {
|
|
5
|
+
import { QueryBuilderCore } from "./query-builder-types";
|
|
6
|
+
import { CommonTypeBase, ContextDependentConfig, Defaultable, GenericContext } from "./shared-controls";
|
|
6
7
|
import { Nullish } from "./type-utils";
|
|
7
8
|
export type FunctionControlContext<P> = GenericContext<Partial<P>, // Partial function props
|
|
8
9
|
any>;
|
|
9
10
|
export type FunctionContextConfig<Args extends any[], R> = ContextDependentConfig<FunctionControlContext<Args>, R>;
|
|
10
|
-
export interface
|
|
11
|
+
export interface ParamTypeBase extends CommonTypeBase {
|
|
11
12
|
name: string;
|
|
12
|
-
description?: string;
|
|
13
13
|
isOptional?: boolean;
|
|
14
14
|
isRestParameter?: boolean;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export type ParamTypeBaseDefault<Ctx extends any[], T> = ParamTypeBase & Defaultable<Ctx, T>;
|
|
17
|
+
export interface FunctionMeta extends CommonTypeBase {
|
|
17
18
|
name: string;
|
|
18
19
|
rest?: boolean;
|
|
19
20
|
}
|
|
20
|
-
export interface PlainStringType<T extends Nullish<string> = string> extends
|
|
21
|
+
export interface PlainStringType<T extends Nullish<string> = string> extends ParamTypeBaseDefault<any[], T> {
|
|
21
22
|
type: "string" | `'${T}'`;
|
|
22
23
|
}
|
|
23
24
|
export type StringType<P, T extends string = string> = "string" | PlainStringType<T> | ChoiceType<P, T> | DateStringType | DateRangeStringsType | AnyType;
|
|
24
|
-
export interface PlainNumberType<T extends Nullish<number> = number> extends
|
|
25
|
+
export interface PlainNumberType<T extends Nullish<number> = number> extends ParamTypeBaseDefault<any[], T> {
|
|
25
26
|
type: "number" | `${number extends T ? number : T}`;
|
|
26
27
|
}
|
|
27
|
-
export type NumberType<P, T extends number = number> = PlainNumberType<T> | (
|
|
28
|
-
export interface PlainBooleanType<T extends Nullish<boolean> = boolean> extends
|
|
28
|
+
export type NumberType<P, T extends number = number> = PlainNumberType<T> | (ParamTypeBaseDefault<FunctionControlContext<P>, T> & NumberTypeBaseCore<FunctionControlContext<P>>) | ChoiceType<P, T> | AnyType;
|
|
29
|
+
export interface PlainBooleanType<T extends Nullish<boolean> = boolean> extends ParamTypeBaseDefault<any[], T> {
|
|
29
30
|
type: "boolean" | `${boolean extends T ? boolean : T}`;
|
|
30
31
|
}
|
|
31
|
-
export type BooleanType<P, T extends boolean = boolean> = PlainBooleanType<T> | (
|
|
32
|
-
export type GraphQLType<P> =
|
|
33
|
-
export interface PlainNullType extends
|
|
32
|
+
export type BooleanType<P, T extends boolean = boolean> = PlainBooleanType<T> | (ParamTypeBaseDefault<FunctionControlContext<P>, T> & RichBooleanCore) | ChoiceType<P, T> | AnyType;
|
|
33
|
+
export type GraphQLType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, any> & GraphQLCore<FunctionControlContext<P>>;
|
|
34
|
+
export interface PlainNullType extends ParamTypeBaseDefault<any[], null> {
|
|
34
35
|
type: "null";
|
|
35
36
|
}
|
|
36
37
|
export type NullType = PlainNullType | AnyType;
|
|
37
|
-
export interface PlainUndefinedType extends
|
|
38
|
+
export interface PlainUndefinedType extends ParamTypeBaseDefault<any[], undefined> {
|
|
38
39
|
type: "undefined";
|
|
39
40
|
}
|
|
40
41
|
export type UndefinedType = PlainUndefinedType | AnyType;
|
|
41
|
-
export type ObjectType<P> =
|
|
42
|
-
export type ArrayType<P> =
|
|
43
|
-
export
|
|
42
|
+
export type ObjectType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, Record<string, any>> & ObjectTypeBaseCore<FunctionControlContext<P>, AnyTyping<P, any>>;
|
|
43
|
+
export type ArrayType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, any[]> & ArrayTypeBaseCore<FunctionControlContext<P>, AnyTyping<P, any>>;
|
|
44
|
+
export type QueryBuilderType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, any> & QueryBuilderCore<FunctionControlContext<P>>;
|
|
45
|
+
export interface PlainAnyType extends ParamTypeBaseDefault<FunctionControlContext<any>, any> {
|
|
44
46
|
type: "any";
|
|
45
47
|
}
|
|
46
48
|
export type AnyType = PlainAnyType;
|
|
47
|
-
export interface PlainVoidType extends
|
|
49
|
+
export interface PlainVoidType extends ParamTypeBase {
|
|
48
50
|
type: "void";
|
|
49
51
|
}
|
|
50
52
|
export type VoidType = PlainVoidType | AnyType;
|
|
@@ -52,7 +54,7 @@ type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
|
52
54
|
type CommonType<P, T> = T extends GraphQLValue ? GraphQLType<P> : T extends null ? NullType : T extends undefined ? UndefinedType : T extends Array<any> ? ArrayType<P> : T extends object ? ObjectType<P> : AnyType;
|
|
53
55
|
type AnyTyping<P, T> = T extends string ? StringType<P, T> : T extends number ? NumberType<P, T> : T extends boolean ? BooleanType<P, T> : CommonType<P, T>;
|
|
54
56
|
export type ToTuple<T> = T extends any[] ? T : never;
|
|
55
|
-
export type FunctionChoiceType<Args, Opt extends ChoiceValue = ChoiceValue> = FunctionMeta<ToTuple<Args
|
|
57
|
+
export type FunctionChoiceType<Args, Opt extends ChoiceValue = ChoiceValue> = FunctionMeta & Defaultable<FunctionControlContext<ToTuple<Args>>, Opt | Opt[]> & ChoiceCore<FunctionControlContext<ToTuple<Args>>, Opt>;
|
|
56
58
|
export interface SingleChoiceType<P, Opt extends ChoiceValue = ChoiceValue> extends FunctionChoiceType<P, Opt> {
|
|
57
59
|
multiSelect?: false;
|
|
58
60
|
}
|
|
@@ -63,14 +65,17 @@ export interface CustomChoiceType<P, Opt extends ChoiceValue = ChoiceValue> exte
|
|
|
63
65
|
multiSelect: FunctionContextConfig<ToTuple<P>, boolean>;
|
|
64
66
|
}
|
|
65
67
|
export type ChoiceType<P, T extends ChoiceValue = ChoiceValue> = SingleChoiceType<P, T> | MultiChoiceType<P, T> | CustomChoiceType<P, T>;
|
|
66
|
-
export type DateStringType =
|
|
67
|
-
export type DateRangeStringsType =
|
|
68
|
-
|
|
68
|
+
export type DateStringType = ParamTypeBaseDefault<FunctionControlContext<string>, string> & DateStringCore;
|
|
69
|
+
export type DateRangeStringsType = ParamTypeBaseDefault<FunctionControlContext<[string, string]>, [
|
|
70
|
+
string,
|
|
71
|
+
string
|
|
72
|
+
]> & DateRangeStringsCore;
|
|
73
|
+
export interface DynamicType<P> extends ParamTypeBase, DynamicCore<FunctionControlContext<ToTuple<P>>, ParamType<P, any>> {
|
|
69
74
|
}
|
|
70
75
|
export type RestrictedType<P, T> = IsAny<T> extends true ? AnyTyping<P, T> : [
|
|
71
76
|
T
|
|
72
77
|
] extends [string] ? StringType<P, T> : [T] extends [number] ? NumberType<P, T> : [T] extends [boolean] ? BooleanType<P, T> : T extends string | null | undefined ? Exclude<T, null | undefined> extends string ? StringType<P, T extends string ? T : string> : CommonType<P, T> : T extends number | null | undefined ? Exclude<T, null | undefined> extends number ? NumberType<P, T extends number ? T : number> : CommonType<P, T> : T extends boolean | null | undefined ? Exclude<T, null | undefined> extends boolean ? BooleanType<P, T extends boolean ? T : boolean> : CommonType<P, T> : CommonType<P, T>;
|
|
73
|
-
export type ParamType<P, T> = RestrictedType<P, T> | DynamicType<P>;
|
|
78
|
+
export type ParamType<P, T> = RestrictedType<P, T> | DynamicType<P> | QueryBuilderType<P>;
|
|
74
79
|
export type RequiredParam<P, T> = ParamType<P, T> & {
|
|
75
80
|
isOptional?: false;
|
|
76
81
|
isRestParameter?: false;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ContextDependentConfig } from "./shared-controls";
|
|
2
|
+
/**
|
|
3
|
+
* Control type for building a custom query format.
|
|
4
|
+
*
|
|
5
|
+
* This control is based on react-awesome-query-builder
|
|
6
|
+
* and returns data in JsonLogic format.
|
|
7
|
+
*
|
|
8
|
+
* If using this control type, it's recommended to install
|
|
9
|
+
* @react-awesome-query-builder/core and json-logic-js as devDependencies
|
|
10
|
+
* so that you can reference their types.
|
|
11
|
+
*
|
|
12
|
+
* References:
|
|
13
|
+
* - https://github.com/ukrbublik/react-awesome-query-builder
|
|
14
|
+
* - https://github.com/jwadhams/json-logic-js
|
|
15
|
+
* - https://jsonlogic.com/
|
|
16
|
+
*/
|
|
17
|
+
export interface QueryBuilderCore<Ctx extends any[]> {
|
|
18
|
+
type: "queryBuilder";
|
|
19
|
+
/**
|
|
20
|
+
* Return a @react-awesome-query-builder/core `Config` that will be merged
|
|
21
|
+
* with Plasmic's built-in config.
|
|
22
|
+
*
|
|
23
|
+
* https://github.com/plasmicapp/plasmic/blob/master/platform/wab/src/wab/client/components/QueryBuilder/QueryBuilderConfig.tsx
|
|
24
|
+
*
|
|
25
|
+
* At a minimum, this should return fields and their types.
|
|
26
|
+
* For configuration options, see react-awesome-query-builder docs.
|
|
27
|
+
*/
|
|
28
|
+
config: ContextDependentConfig<Ctx, SimplifiedConfig>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A simplified subset of @react-awesome-query-builder/core `Config`.
|
|
32
|
+
*/
|
|
33
|
+
interface SimplifiedConfig {
|
|
34
|
+
fields: SimplifiedFields;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A simplified subset of @react-awesome-query-builder/core `Fields`.
|
|
38
|
+
*/
|
|
39
|
+
interface SimplifiedFields {
|
|
40
|
+
[key: string]: SimplifiedField;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A simplified subset of @react-awesome-query-builder/core `FieldOrGroup`.
|
|
44
|
+
*/
|
|
45
|
+
interface SimplifiedField {
|
|
46
|
+
type: "text" | "number" | "boolean" | "date" | "time" | "datetime" | "select" | "multiselect" | "treeselect" | "treemultiselect" | string;
|
|
47
|
+
label?: string;
|
|
48
|
+
defaultValue?: unknown;
|
|
49
|
+
fieldSettings?: {};
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
@@ -17,10 +17,14 @@ export type ControlExtras = {
|
|
|
17
17
|
item?: any;
|
|
18
18
|
};
|
|
19
19
|
export type InferDataType<P> = P extends CanvasComponentProps<infer Data> ? Data : any;
|
|
20
|
-
export interface CommonTypeBase
|
|
20
|
+
export interface CommonTypeBase {
|
|
21
21
|
description?: string;
|
|
22
22
|
helpText?: string;
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* If true, will hide the prop in a collapsed section; good for props that
|
|
25
|
+
* should not usually be used.
|
|
26
|
+
*/
|
|
27
|
+
advanced?: boolean;
|
|
24
28
|
/**
|
|
25
29
|
* If the user has chosen to use a dynamic expression for this prop, provide
|
|
26
30
|
* a hint as to the expected values that the expression should evaluate to.
|
|
@@ -28,13 +32,19 @@ export interface CommonTypeBase<Ctx extends any[]> {
|
|
|
28
32
|
* markdown in the text here.
|
|
29
33
|
*/
|
|
30
34
|
exprHint?: string;
|
|
31
|
-
/**
|
|
32
|
-
* Function for whether this prop should be hidden in the right panel,
|
|
33
|
-
* given the current props for this component
|
|
34
|
-
*/
|
|
35
|
-
hidden?: ContextDependentConfig<Ctx, boolean>;
|
|
36
35
|
/**
|
|
37
36
|
* If true, does not allow the user to use a dynamic expression for this prop
|
|
38
37
|
*/
|
|
39
38
|
disableDynamicValue?: boolean;
|
|
40
39
|
}
|
|
40
|
+
export interface Defaultable<Ctx extends any[], T> {
|
|
41
|
+
/**
|
|
42
|
+
* Default value to set for this prop when the component is instantiated
|
|
43
|
+
*/
|
|
44
|
+
defaultValue?: T;
|
|
45
|
+
/**
|
|
46
|
+
* Specify that default when no prop/param is provided,
|
|
47
|
+
* so the Plasmic user can see it in the studio UI
|
|
48
|
+
*/
|
|
49
|
+
defaultValueHint?: T | ContextDependentConfig<Ctx, T | undefined>;
|
|
50
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const hostVersion = "1.0.
|
|
1
|
+
export declare const hostVersion = "1.0.229";
|
|
@@ -4,20 +4,16 @@ import { ChoiceCore, ChoiceValue } from "./choice-type";
|
|
|
4
4
|
import { ArrayTypeBaseCore, ObjectTypeBaseCore } from "./container-types";
|
|
5
5
|
import { DataPickerValueType, DataSourceCore, DynamicCore, GraphQLCore, GraphQLValue, RichDataPickerCore, RichExprEditorCore } from "./misc-types";
|
|
6
6
|
import { CardPickerCore, ClassCore, CodeStringCore, ColorCore, DateRangeStringsCore, DateStringCore, HrefCore, NumberTypeBaseCore, PlainNumberCore, PlainStringCore, RichBooleanCore, RichTextCore, SliderNumberCore, ThemeResetClassCore } from "./primitive-types";
|
|
7
|
-
import { CommonTypeBase, ContextDependentConfig, ControlExtras, GenericContext, InferDataType } from "./shared-controls";
|
|
7
|
+
import { CommonTypeBase, ContextDependentConfig, ControlExtras, Defaultable, GenericContext, InferDataType } from "./shared-controls";
|
|
8
8
|
export type ComponentControlContext<P> = GenericContext<P, // Full component props
|
|
9
9
|
// Full component props
|
|
10
10
|
InferDataType<P> | null, // Canvas data
|
|
11
11
|
ControlExtras>;
|
|
12
12
|
export type ComponentContextConfig<Props, R> = ContextDependentConfig<ComponentControlContext<Props>, R>;
|
|
13
|
-
export interface PropTypeBase<Ctx extends any[]> extends CommonTypeBase
|
|
13
|
+
export interface PropTypeBase<Ctx extends any[]> extends CommonTypeBase {
|
|
14
14
|
displayName?: string;
|
|
15
|
+
required?: boolean;
|
|
15
16
|
readOnly?: boolean | ContextDependentConfig<Ctx, boolean>;
|
|
16
|
-
/**
|
|
17
|
-
* If true, will hide the prop in a collapsed section; good for props that
|
|
18
|
-
* should not usually be used.
|
|
19
|
-
*/
|
|
20
|
-
advanced?: boolean;
|
|
21
17
|
/**
|
|
22
18
|
* If set to true, the component will be remounted when the prop value is updated.
|
|
23
19
|
* (This behavior only applies to canvas)
|
|
@@ -27,17 +23,13 @@ export interface PropTypeBase<Ctx extends any[]> extends CommonTypeBase<Ctx> {
|
|
|
27
23
|
* If true, the prop can't be overriden in different variants.
|
|
28
24
|
*/
|
|
29
25
|
invariantable?: boolean;
|
|
30
|
-
}
|
|
31
|
-
export interface Defaultable<Ctx extends any[], T> {
|
|
32
26
|
/**
|
|
33
|
-
*
|
|
34
|
-
|
|
35
|
-
defaultValue?: T;
|
|
36
|
-
/**
|
|
37
|
-
* If no prop is given, the component uses a default; specify what
|
|
38
|
-
* that default is so the Plasmic user can see it in the studio UI
|
|
27
|
+
* Function for whether this prop should be hidden in the right panel,
|
|
28
|
+
* given the current props for this component
|
|
39
29
|
*/
|
|
40
|
-
|
|
30
|
+
hidden?: ContextDependentConfig<Ctx, boolean>;
|
|
31
|
+
}
|
|
32
|
+
interface ExtendedDefaultable<Ctx extends any[], T> extends Defaultable<Ctx, T> {
|
|
41
33
|
/**
|
|
42
34
|
* Use a dynamic value expression as the default instead
|
|
43
35
|
*/
|
|
@@ -65,7 +57,7 @@ export interface Controllable {
|
|
|
65
57
|
*/
|
|
66
58
|
uncontrolledProp?: string;
|
|
67
59
|
}
|
|
68
|
-
export type PropTypeBaseDefault<P, T> = PropTypeBase<ComponentControlContext<P>> &
|
|
60
|
+
export type PropTypeBaseDefault<P, T> = PropTypeBase<ComponentControlContext<P>> & ExtendedDefaultable<ComponentControlContext<P>, T> & Controllable;
|
|
69
61
|
export type PlainStringType<P> = PropTypeBaseDefault<P, string> & PlainStringCore;
|
|
70
62
|
export type CodeStringType<P> = PropTypeBaseDefault<P, string> & CodeStringCore;
|
|
71
63
|
export type RichTextType<P> = PropTypeBaseDefault<P, string> & RichTextCore;
|
|
@@ -256,3 +248,4 @@ export type StringCompatType<P> = DateStringType<P> | StringType<P> | ChoiceType
|
|
|
256
248
|
export type BoolCompatType<P> = BooleanType<P> | CustomType<P> | DataPickerType<P>;
|
|
257
249
|
export type NumberCompatType<P> = NumberType<P> | CustomType<P> | DataPickerType<P>;
|
|
258
250
|
export type RestrictPropType<T, P> = T extends string ? StringCompatType<P> : T extends boolean ? BoolCompatType<P> : T extends number ? NumberCompatType<P> : PropType<P>;
|
|
251
|
+
export {};
|
|
@@ -2,49 +2,51 @@ import { ChoiceCore, ChoiceValue } from "./choice-type";
|
|
|
2
2
|
import { ArrayTypeBaseCore, ObjectTypeBaseCore } from "./container-types";
|
|
3
3
|
import { DynamicCore, GraphQLCore, GraphQLValue } from "./misc-types";
|
|
4
4
|
import { DateRangeStringsCore, DateStringCore, NumberTypeBaseCore, RichBooleanCore } from "./primitive-types";
|
|
5
|
-
import {
|
|
5
|
+
import { QueryBuilderCore } from "./query-builder-types";
|
|
6
|
+
import { CommonTypeBase, ContextDependentConfig, Defaultable, GenericContext } from "./shared-controls";
|
|
6
7
|
import { Nullish } from "./type-utils";
|
|
7
8
|
export type FunctionControlContext<P> = GenericContext<Partial<P>, // Partial function props
|
|
8
9
|
any>;
|
|
9
10
|
export type FunctionContextConfig<Args extends any[], R> = ContextDependentConfig<FunctionControlContext<Args>, R>;
|
|
10
|
-
export interface
|
|
11
|
+
export interface ParamTypeBase extends CommonTypeBase {
|
|
11
12
|
name: string;
|
|
12
|
-
description?: string;
|
|
13
13
|
isOptional?: boolean;
|
|
14
14
|
isRestParameter?: boolean;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export type ParamTypeBaseDefault<Ctx extends any[], T> = ParamTypeBase & Defaultable<Ctx, T>;
|
|
17
|
+
export interface FunctionMeta extends CommonTypeBase {
|
|
17
18
|
name: string;
|
|
18
19
|
rest?: boolean;
|
|
19
20
|
}
|
|
20
|
-
export interface PlainStringType<T extends Nullish<string> = string> extends
|
|
21
|
+
export interface PlainStringType<T extends Nullish<string> = string> extends ParamTypeBaseDefault<any[], T> {
|
|
21
22
|
type: "string" | `'${T}'`;
|
|
22
23
|
}
|
|
23
24
|
export type StringType<P, T extends string = string> = "string" | PlainStringType<T> | ChoiceType<P, T> | DateStringType | DateRangeStringsType | AnyType;
|
|
24
|
-
export interface PlainNumberType<T extends Nullish<number> = number> extends
|
|
25
|
+
export interface PlainNumberType<T extends Nullish<number> = number> extends ParamTypeBaseDefault<any[], T> {
|
|
25
26
|
type: "number" | `${number extends T ? number : T}`;
|
|
26
27
|
}
|
|
27
|
-
export type NumberType<P, T extends number = number> = PlainNumberType<T> | (
|
|
28
|
-
export interface PlainBooleanType<T extends Nullish<boolean> = boolean> extends
|
|
28
|
+
export type NumberType<P, T extends number = number> = PlainNumberType<T> | (ParamTypeBaseDefault<FunctionControlContext<P>, T> & NumberTypeBaseCore<FunctionControlContext<P>>) | ChoiceType<P, T> | AnyType;
|
|
29
|
+
export interface PlainBooleanType<T extends Nullish<boolean> = boolean> extends ParamTypeBaseDefault<any[], T> {
|
|
29
30
|
type: "boolean" | `${boolean extends T ? boolean : T}`;
|
|
30
31
|
}
|
|
31
|
-
export type BooleanType<P, T extends boolean = boolean> = PlainBooleanType<T> | (
|
|
32
|
-
export type GraphQLType<P> =
|
|
33
|
-
export interface PlainNullType extends
|
|
32
|
+
export type BooleanType<P, T extends boolean = boolean> = PlainBooleanType<T> | (ParamTypeBaseDefault<FunctionControlContext<P>, T> & RichBooleanCore) | ChoiceType<P, T> | AnyType;
|
|
33
|
+
export type GraphQLType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, any> & GraphQLCore<FunctionControlContext<P>>;
|
|
34
|
+
export interface PlainNullType extends ParamTypeBaseDefault<any[], null> {
|
|
34
35
|
type: "null";
|
|
35
36
|
}
|
|
36
37
|
export type NullType = PlainNullType | AnyType;
|
|
37
|
-
export interface PlainUndefinedType extends
|
|
38
|
+
export interface PlainUndefinedType extends ParamTypeBaseDefault<any[], undefined> {
|
|
38
39
|
type: "undefined";
|
|
39
40
|
}
|
|
40
41
|
export type UndefinedType = PlainUndefinedType | AnyType;
|
|
41
|
-
export type ObjectType<P> =
|
|
42
|
-
export type ArrayType<P> =
|
|
43
|
-
export
|
|
42
|
+
export type ObjectType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, Record<string, any>> & ObjectTypeBaseCore<FunctionControlContext<P>, AnyTyping<P, any>>;
|
|
43
|
+
export type ArrayType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, any[]> & ArrayTypeBaseCore<FunctionControlContext<P>, AnyTyping<P, any>>;
|
|
44
|
+
export type QueryBuilderType<P> = ParamTypeBaseDefault<FunctionControlContext<P>, any> & QueryBuilderCore<FunctionControlContext<P>>;
|
|
45
|
+
export interface PlainAnyType extends ParamTypeBaseDefault<FunctionControlContext<any>, any> {
|
|
44
46
|
type: "any";
|
|
45
47
|
}
|
|
46
48
|
export type AnyType = PlainAnyType;
|
|
47
|
-
export interface PlainVoidType extends
|
|
49
|
+
export interface PlainVoidType extends ParamTypeBase {
|
|
48
50
|
type: "void";
|
|
49
51
|
}
|
|
50
52
|
export type VoidType = PlainVoidType | AnyType;
|
|
@@ -52,7 +54,7 @@ type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
|
52
54
|
type CommonType<P, T> = T extends GraphQLValue ? GraphQLType<P> : T extends null ? NullType : T extends undefined ? UndefinedType : T extends Array<any> ? ArrayType<P> : T extends object ? ObjectType<P> : AnyType;
|
|
53
55
|
type AnyTyping<P, T> = T extends string ? StringType<P, T> : T extends number ? NumberType<P, T> : T extends boolean ? BooleanType<P, T> : CommonType<P, T>;
|
|
54
56
|
export type ToTuple<T> = T extends any[] ? T : never;
|
|
55
|
-
export type FunctionChoiceType<Args, Opt extends ChoiceValue = ChoiceValue> = FunctionMeta<ToTuple<Args
|
|
57
|
+
export type FunctionChoiceType<Args, Opt extends ChoiceValue = ChoiceValue> = FunctionMeta & Defaultable<FunctionControlContext<ToTuple<Args>>, Opt | Opt[]> & ChoiceCore<FunctionControlContext<ToTuple<Args>>, Opt>;
|
|
56
58
|
export interface SingleChoiceType<P, Opt extends ChoiceValue = ChoiceValue> extends FunctionChoiceType<P, Opt> {
|
|
57
59
|
multiSelect?: false;
|
|
58
60
|
}
|
|
@@ -63,14 +65,17 @@ export interface CustomChoiceType<P, Opt extends ChoiceValue = ChoiceValue> exte
|
|
|
63
65
|
multiSelect: FunctionContextConfig<ToTuple<P>, boolean>;
|
|
64
66
|
}
|
|
65
67
|
export type ChoiceType<P, T extends ChoiceValue = ChoiceValue> = SingleChoiceType<P, T> | MultiChoiceType<P, T> | CustomChoiceType<P, T>;
|
|
66
|
-
export type DateStringType =
|
|
67
|
-
export type DateRangeStringsType =
|
|
68
|
-
|
|
68
|
+
export type DateStringType = ParamTypeBaseDefault<FunctionControlContext<string>, string> & DateStringCore;
|
|
69
|
+
export type DateRangeStringsType = ParamTypeBaseDefault<FunctionControlContext<[string, string]>, [
|
|
70
|
+
string,
|
|
71
|
+
string
|
|
72
|
+
]> & DateRangeStringsCore;
|
|
73
|
+
export interface DynamicType<P> extends ParamTypeBase, DynamicCore<FunctionControlContext<ToTuple<P>>, ParamType<P, any>> {
|
|
69
74
|
}
|
|
70
75
|
export type RestrictedType<P, T> = IsAny<T> extends true ? AnyTyping<P, T> : [
|
|
71
76
|
T
|
|
72
77
|
] extends [string] ? StringType<P, T> : [T] extends [number] ? NumberType<P, T> : [T] extends [boolean] ? BooleanType<P, T> : T extends string | null | undefined ? Exclude<T, null | undefined> extends string ? StringType<P, T extends string ? T : string> : CommonType<P, T> : T extends number | null | undefined ? Exclude<T, null | undefined> extends number ? NumberType<P, T extends number ? T : number> : CommonType<P, T> : T extends boolean | null | undefined ? Exclude<T, null | undefined> extends boolean ? BooleanType<P, T extends boolean ? T : boolean> : CommonType<P, T> : CommonType<P, T>;
|
|
73
|
-
export type ParamType<P, T> = RestrictedType<P, T> | DynamicType<P>;
|
|
78
|
+
export type ParamType<P, T> = RestrictedType<P, T> | DynamicType<P> | QueryBuilderType<P>;
|
|
74
79
|
export type RequiredParam<P, T> = ParamType<P, T> & {
|
|
75
80
|
isOptional?: false;
|
|
76
81
|
isRestParameter?: false;
|