@plasmicapp/host
Advanced tools
Comparing version 1.0.27 to 1.0.28
@@ -27,7 +27,7 @@ /// <reference types="react" /> | ||
} | ||
declare type DefaultValueOrExpr<T> = { | ||
declare type DefaultValueOrExpr<P, T> = { | ||
defaultExpr?: undefined; | ||
defaultExprHint?: undefined; | ||
defaultValue?: T; | ||
defaultValueHint?: T; | ||
defaultValueHint?: T | ContextDependentConfig<P, T | undefined>; | ||
} | { | ||
@@ -39,3 +39,3 @@ defaultValue?: undefined; | ||
}; | ||
declare type StringTypeBase<P> = PropTypeBase<P> & DefaultValueOrExpr<string>; | ||
declare type StringTypeBase<P> = PropTypeBase<P> & DefaultValueOrExpr<P, string>; | ||
export declare type StringType<P> = "string" | (({ | ||
@@ -50,4 +50,4 @@ type: "string"; | ||
type: "boolean"; | ||
} & DefaultValueOrExpr<boolean> & PropTypeBase<P>); | ||
declare type NumberTypeBase<P> = PropTypeBase<P> & DefaultValueOrExpr<number> & { | ||
} & DefaultValueOrExpr<P, boolean> & PropTypeBase<P>); | ||
declare type NumberTypeBase<P> = PropTypeBase<P> & DefaultValueOrExpr<P, number> & { | ||
type: "number"; | ||
@@ -70,5 +70,5 @@ }; | ||
type: "object"; | ||
} & DefaultValueOrExpr<any> & PropTypeBase<P>) | ({ | ||
} & DefaultValueOrExpr<P, any> & PropTypeBase<P>) | ({ | ||
type: "array"; | ||
} & DefaultValueOrExpr<any[]> & PropTypeBase<P>); | ||
} & DefaultValueOrExpr<P, any[]> & PropTypeBase<P>); | ||
interface ChoiceTypeBase<P> extends PropTypeBase<P> { | ||
@@ -86,5 +86,5 @@ type: "choice"; | ||
multiSelect?: false; | ||
} & DefaultValueOrExpr<string>) | ({ | ||
} & DefaultValueOrExpr<P, string>) | ({ | ||
multiSelect: true; | ||
} & DefaultValueOrExpr<string[]>)) & ChoiceTypeBase<P>; | ||
} & DefaultValueOrExpr<P, string[]>)) & ChoiceTypeBase<P>; | ||
export interface ModalProps { | ||
@@ -125,4 +125,4 @@ show?: boolean; | ||
control: CustomControl<P>; | ||
} & PropTypeBase<P> & DefaultValueOrExpr<any>); | ||
declare type SlotType = "slot" | ({ | ||
} & PropTypeBase<P> & DefaultValueOrExpr<P, any>); | ||
declare type SlotType<P> = "slot" | ({ | ||
type: "slot"; | ||
@@ -142,6 +142,6 @@ /** | ||
isRepeated?: boolean; | ||
} & Omit<DefaultValueOrExpr<PlasmicElement | PlasmicElement[]>, "defaultValueHint" | "defaultExpr" | "defaultExprHint">); | ||
} & Omit<DefaultValueOrExpr<P, PlasmicElement | PlasmicElement[]>, "defaultValueHint" | "defaultExpr" | "defaultExprHint">); | ||
declare type ImageUrlType<P> = "imageUrl" | ({ | ||
type: "imageUrl"; | ||
} & DefaultValueOrExpr<string> & PropTypeBase<P>); | ||
} & DefaultValueOrExpr<P, string> & PropTypeBase<P>); | ||
export declare type PrimitiveType<P = any> = Extract<StringType<P> | BooleanType<P> | NumberType<P> | JSONLikeType<P>, String>; | ||
@@ -158,3 +158,3 @@ declare type ControlTypeBase = { | ||
export declare type SupportControlled<T> = Extract<T, String | CustomControl<any>> | (Exclude<T, String | CustomControl<any>> & ControlTypeBase); | ||
export declare type PropType<P> = SupportControlled<StringType<P> | BooleanType<P> | NumberType<P> | JSONLikeType<P> | ChoiceType<P> | ImageUrlType<P> | CustomType<P>> | SlotType; | ||
export declare type PropType<P> = SupportControlled<StringType<P> | BooleanType<P> | NumberType<P> | JSONLikeType<P> | ChoiceType<P> | ImageUrlType<P> | CustomType<P>> | SlotType<P>; | ||
declare type RestrictPropType<T, P> = T extends string ? SupportControlled<StringType<P> | ChoiceType<P> | JSONLikeType<P> | ImageUrlType<P> | CustomType<P>> : T extends boolean ? SupportControlled<BooleanType<P> | JSONLikeType<P> | CustomType<P>> : T extends number ? SupportControlled<NumberType<P> | JSONLikeType<P> | CustomType<P>> : PropType<P>; | ||
@@ -161,0 +161,0 @@ declare type DistributedKeyOf<T> = T extends any ? keyof T : never; |
{ | ||
"name": "@plasmicapp/host", | ||
"version": "1.0.27", | ||
"version": "1.0.28", | ||
"description": "plasmic library for app hosting", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -27,7 +27,7 @@ /// <reference types="react" /> | ||
} | ||
declare type DefaultValueOrExpr<T> = { | ||
declare type DefaultValueOrExpr<P, T> = { | ||
defaultExpr?: undefined; | ||
defaultExprHint?: undefined; | ||
defaultValue?: T; | ||
defaultValueHint?: T; | ||
defaultValueHint?: T | ContextDependentConfig<P, T | undefined>; | ||
} | { | ||
@@ -39,3 +39,3 @@ defaultValue?: undefined; | ||
}; | ||
declare type StringTypeBase<P> = PropTypeBase<P> & DefaultValueOrExpr<string>; | ||
declare type StringTypeBase<P> = PropTypeBase<P> & DefaultValueOrExpr<P, string>; | ||
export declare type StringType<P> = "string" | (({ | ||
@@ -50,4 +50,4 @@ type: "string"; | ||
type: "boolean"; | ||
} & DefaultValueOrExpr<boolean> & PropTypeBase<P>); | ||
declare type NumberTypeBase<P> = PropTypeBase<P> & DefaultValueOrExpr<number> & { | ||
} & DefaultValueOrExpr<P, boolean> & PropTypeBase<P>); | ||
declare type NumberTypeBase<P> = PropTypeBase<P> & DefaultValueOrExpr<P, number> & { | ||
type: "number"; | ||
@@ -70,5 +70,5 @@ }; | ||
type: "object"; | ||
} & DefaultValueOrExpr<any> & PropTypeBase<P>) | ({ | ||
} & DefaultValueOrExpr<P, any> & PropTypeBase<P>) | ({ | ||
type: "array"; | ||
} & DefaultValueOrExpr<any[]> & PropTypeBase<P>); | ||
} & DefaultValueOrExpr<P, any[]> & PropTypeBase<P>); | ||
interface ChoiceTypeBase<P> extends PropTypeBase<P> { | ||
@@ -86,5 +86,5 @@ type: "choice"; | ||
multiSelect?: false; | ||
} & DefaultValueOrExpr<string>) | ({ | ||
} & DefaultValueOrExpr<P, string>) | ({ | ||
multiSelect: true; | ||
} & DefaultValueOrExpr<string[]>)) & ChoiceTypeBase<P>; | ||
} & DefaultValueOrExpr<P, string[]>)) & ChoiceTypeBase<P>; | ||
export interface ModalProps { | ||
@@ -125,4 +125,4 @@ show?: boolean; | ||
control: CustomControl<P>; | ||
} & PropTypeBase<P> & DefaultValueOrExpr<any>); | ||
declare type SlotType = "slot" | ({ | ||
} & PropTypeBase<P> & DefaultValueOrExpr<P, any>); | ||
declare type SlotType<P> = "slot" | ({ | ||
type: "slot"; | ||
@@ -142,6 +142,6 @@ /** | ||
isRepeated?: boolean; | ||
} & Omit<DefaultValueOrExpr<PlasmicElement | PlasmicElement[]>, "defaultValueHint" | "defaultExpr" | "defaultExprHint">); | ||
} & Omit<DefaultValueOrExpr<P, PlasmicElement | PlasmicElement[]>, "defaultValueHint" | "defaultExpr" | "defaultExprHint">); | ||
declare type ImageUrlType<P> = "imageUrl" | ({ | ||
type: "imageUrl"; | ||
} & DefaultValueOrExpr<string> & PropTypeBase<P>); | ||
} & DefaultValueOrExpr<P, string> & PropTypeBase<P>); | ||
export declare type PrimitiveType<P = any> = Extract<StringType<P> | BooleanType<P> | NumberType<P> | JSONLikeType<P>, String>; | ||
@@ -158,3 +158,3 @@ declare type ControlTypeBase = { | ||
export declare type SupportControlled<T> = Extract<T, String | CustomControl<any>> | (Exclude<T, String | CustomControl<any>> & ControlTypeBase); | ||
export declare type PropType<P> = SupportControlled<StringType<P> | BooleanType<P> | NumberType<P> | JSONLikeType<P> | ChoiceType<P> | ImageUrlType<P> | CustomType<P>> | SlotType; | ||
export declare type PropType<P> = SupportControlled<StringType<P> | BooleanType<P> | NumberType<P> | JSONLikeType<P> | ChoiceType<P> | ImageUrlType<P> | CustomType<P>> | SlotType<P>; | ||
declare type RestrictPropType<T, P> = T extends string ? SupportControlled<StringType<P> | ChoiceType<P> | JSONLikeType<P> | ImageUrlType<P> | CustomType<P>> : T extends boolean ? SupportControlled<BooleanType<P> | JSONLikeType<P> | CustomType<P>> : T extends number ? SupportControlled<NumberType<P> | JSONLikeType<P> | CustomType<P>> : PropType<P>; | ||
@@ -161,0 +161,0 @@ declare type DistributedKeyOf<T> = T extends any ? keyof T : never; |
@@ -27,7 +27,7 @@ /// <reference types="react" /> | ||
} | ||
declare type DefaultValueOrExpr<T> = { | ||
declare type DefaultValueOrExpr<P, T> = { | ||
defaultExpr?: undefined; | ||
defaultExprHint?: undefined; | ||
defaultValue?: T; | ||
defaultValueHint?: T; | ||
defaultValueHint?: T | ContextDependentConfig<P, T | undefined>; | ||
} | { | ||
@@ -39,3 +39,3 @@ defaultValue?: undefined; | ||
}; | ||
declare type StringTypeBase<P> = PropTypeBase<P> & DefaultValueOrExpr<string>; | ||
declare type StringTypeBase<P> = PropTypeBase<P> & DefaultValueOrExpr<P, string>; | ||
export declare type StringType<P> = "string" | (({ | ||
@@ -50,4 +50,4 @@ type: "string"; | ||
type: "boolean"; | ||
} & DefaultValueOrExpr<boolean> & PropTypeBase<P>); | ||
declare type NumberTypeBase<P> = PropTypeBase<P> & DefaultValueOrExpr<number> & { | ||
} & DefaultValueOrExpr<P, boolean> & PropTypeBase<P>); | ||
declare type NumberTypeBase<P> = PropTypeBase<P> & DefaultValueOrExpr<P, number> & { | ||
type: "number"; | ||
@@ -70,5 +70,5 @@ }; | ||
type: "object"; | ||
} & DefaultValueOrExpr<any> & PropTypeBase<P>) | ({ | ||
} & DefaultValueOrExpr<P, any> & PropTypeBase<P>) | ({ | ||
type: "array"; | ||
} & DefaultValueOrExpr<any[]> & PropTypeBase<P>); | ||
} & DefaultValueOrExpr<P, any[]> & PropTypeBase<P>); | ||
interface ChoiceTypeBase<P> extends PropTypeBase<P> { | ||
@@ -86,5 +86,5 @@ type: "choice"; | ||
multiSelect?: false; | ||
} & DefaultValueOrExpr<string>) | ({ | ||
} & DefaultValueOrExpr<P, string>) | ({ | ||
multiSelect: true; | ||
} & DefaultValueOrExpr<string[]>)) & ChoiceTypeBase<P>; | ||
} & DefaultValueOrExpr<P, string[]>)) & ChoiceTypeBase<P>; | ||
export interface ModalProps { | ||
@@ -125,4 +125,4 @@ show?: boolean; | ||
control: CustomControl<P>; | ||
} & PropTypeBase<P> & DefaultValueOrExpr<any>); | ||
declare type SlotType = "slot" | ({ | ||
} & PropTypeBase<P> & DefaultValueOrExpr<P, any>); | ||
declare type SlotType<P> = "slot" | ({ | ||
type: "slot"; | ||
@@ -142,6 +142,6 @@ /** | ||
isRepeated?: boolean; | ||
} & Omit<DefaultValueOrExpr<PlasmicElement | PlasmicElement[]>, "defaultValueHint" | "defaultExpr" | "defaultExprHint">); | ||
} & Omit<DefaultValueOrExpr<P, PlasmicElement | PlasmicElement[]>, "defaultValueHint" | "defaultExpr" | "defaultExprHint">); | ||
declare type ImageUrlType<P> = "imageUrl" | ({ | ||
type: "imageUrl"; | ||
} & DefaultValueOrExpr<string> & PropTypeBase<P>); | ||
} & DefaultValueOrExpr<P, string> & PropTypeBase<P>); | ||
export declare type PrimitiveType<P = any> = Extract<StringType<P> | BooleanType<P> | NumberType<P> | JSONLikeType<P>, String>; | ||
@@ -158,3 +158,3 @@ declare type ControlTypeBase = { | ||
export declare type SupportControlled<T> = Extract<T, String | CustomControl<any>> | (Exclude<T, String | CustomControl<any>> & ControlTypeBase); | ||
export declare type PropType<P> = SupportControlled<StringType<P> | BooleanType<P> | NumberType<P> | JSONLikeType<P> | ChoiceType<P> | ImageUrlType<P> | CustomType<P>> | SlotType; | ||
export declare type PropType<P> = SupportControlled<StringType<P> | BooleanType<P> | NumberType<P> | JSONLikeType<P> | ChoiceType<P> | ImageUrlType<P> | CustomType<P>> | SlotType<P>; | ||
declare type RestrictPropType<T, P> = T extends string ? SupportControlled<StringType<P> | ChoiceType<P> | JSONLikeType<P> | ImageUrlType<P> | CustomType<P>> : T extends boolean ? SupportControlled<BooleanType<P> | JSONLikeType<P> | CustomType<P>> : T extends number ? SupportControlled<NumberType<P> | JSONLikeType<P> | CustomType<P>> : PropType<P>; | ||
@@ -161,0 +161,0 @@ declare type DistributedKeyOf<T> = T extends any ? keyof T : never; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
228036