@jfdevelops/react-layout 2.3.0 → 2.5.0
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/create-config/create-defined-resource-layout.cjs.map +1 -1
- package/dist/create-config/create-defined-resource-layout.d.cts +1 -1
- package/dist/create-config/create-defined-resource-layout.d.cts.map +1 -1
- package/dist/create-config/create-defined-resource-layout.d.mts +1 -1
- package/dist/create-config/create-defined-resource-layout.d.mts.map +1 -1
- package/dist/create-config/create-defined-resource-layout.mjs.map +1 -1
- package/dist/create-config/create-reusable.cjs +198 -21
- package/dist/create-config/create-reusable.cjs.map +1 -1
- package/dist/create-config/create-reusable.d.cts +2 -41
- package/dist/create-config/create-reusable.d.mts +2 -41
- package/dist/create-config/create-reusable.mjs +198 -21
- package/dist/create-config/create-reusable.mjs.map +1 -1
- package/dist/create-config/index.d.cts +2 -1
- package/dist/create-config/index.d.mts +2 -1
- package/dist/create-config/merge-layout-props.cjs.map +1 -1
- package/dist/create-config/merge-layout-props.mjs.map +1 -1
- package/dist/create-config/reusable-resource-input.cjs +22 -0
- package/dist/create-config/reusable-resource-input.cjs.map +1 -0
- package/dist/create-config/reusable-resource-input.d.cts +16 -0
- package/dist/create-config/reusable-resource-input.d.cts.map +1 -0
- package/dist/create-config/reusable-resource-input.d.mts +16 -0
- package/dist/create-config/reusable-resource-input.d.mts.map +1 -0
- package/dist/create-config/reusable-resource-input.mjs +19 -0
- package/dist/create-config/reusable-resource-input.mjs.map +1 -0
- package/dist/create-config/reusable-types.d.cts +139 -0
- package/dist/create-config/reusable-types.d.cts.map +1 -0
- package/dist/create-config/reusable-types.d.mts +139 -0
- package/dist/create-config/reusable-types.d.mts.map +1 -0
- package/dist/index.d.cts +4 -3
- package/dist/index.d.mts +4 -3
- package/dist/props.cjs.map +1 -1
- package/dist/props.d.cts +6 -1
- package/dist/props.d.cts.map +1 -1
- package/dist/props.d.mts +6 -1
- package/dist/props.d.mts.map +1 -1
- package/dist/props.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/create-config/create-reusable.d.cts.map +0 -1
- package/dist/create-config/create-reusable.d.mts.map +0 -1
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { Show } from "../utils.cjs";
|
|
2
|
+
import { ResourceDefinition, ResourceEnum, ResourcePath } from "../resource.cjs";
|
|
3
|
+
import { InPropsDefinition, InPropsObject, InferredInProps, PropsContract } from "../props.cjs";
|
|
4
|
+
import { LayoutResourcesAccessor } from "./define-layout.cjs";
|
|
5
|
+
import { ReusableResourcesAccessor, SingleResourceInput } from "./reusable-resource-input.cjs";
|
|
6
|
+
import { AnyBuiltPropDefinition, ExtractDefinitionValue, ResolvedBuiltPropShape } from "@jfdevelops/react-layout-validator";
|
|
7
|
+
|
|
8
|
+
//#region src/create-config/reusable-types.d.ts
|
|
9
|
+
type Selector<Source> = (source: Source) => unknown;
|
|
10
|
+
type OptionValue<Definition extends AnyBuiltPropDefinition> = ExtractDefinitionValue<Definition> | (Definition['visibility'] extends 'optional' ? undefined : never);
|
|
11
|
+
/** Select or transform resolved option values, or drill into object values. */
|
|
12
|
+
type ReusableOptionSelection<Props extends InPropsObject> = { [Key in keyof Props]?: Props[Key] extends {
|
|
13
|
+
type: 'object';
|
|
14
|
+
properties: infer Shape extends InPropsObject;
|
|
15
|
+
} ? true | Selector<OptionValue<Props[Key]>> | ReusableOptionSelection<Shape> : true | Selector<OptionValue<Props[Key]>> };
|
|
16
|
+
type ResolvedResourceSelection<Resources extends readonly ResourceDefinition[], Result> = Result extends SingleResourceInput<readonly ResourceDefinition[]> ? ResourcePath<Resources> : Result;
|
|
17
|
+
type ResourceCallerInput<Resources extends readonly ResourceDefinition[], Contract> = Contract extends {
|
|
18
|
+
resources: (...args: any[]) => infer Result;
|
|
19
|
+
} ? Extract<Result, SingleResourceInput<readonly ResourceDefinition[]>> extends never ? {} : {
|
|
20
|
+
resources: ResourcePath<Resources>;
|
|
21
|
+
} : {};
|
|
22
|
+
type OptionDefinitions<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>> = InferredInProps<Resources, Options> extends infer Props extends InPropsObject ? Props : never;
|
|
23
|
+
/** Only data sources declared by the factory are available for selection. */
|
|
24
|
+
type ReusableInclude<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>> = {
|
|
25
|
+
resources?: true | Selector<ReusableResourcesAccessor<Resources>>;
|
|
26
|
+
} & (keyof OptionDefinitions<Resources, Options> extends never ? {} : {
|
|
27
|
+
options?: true | Selector<ResolvedBuiltPropShape<OptionDefinitions<Resources, Options>>> | ReusableOptionSelection<OptionDefinitions<Resources, Options>>;
|
|
28
|
+
});
|
|
29
|
+
type SelectedOptionValue<Definition extends AnyBuiltPropDefinition, Selection> = Selection extends true ? ExtractDefinitionValue<Definition> : Selection extends ((...args: any[]) => infer Result) ? Result : Definition extends {
|
|
30
|
+
properties: infer Shape extends InPropsObject;
|
|
31
|
+
} ? SelectedOptionProps<Shape, Selection> : never;
|
|
32
|
+
type SelectedOptionProps<Props extends InPropsObject, Selection> = { [Key in keyof Props & keyof Selection as Selection[Key] extends Selector<any> ? Key : Props[Key]['visibility'] extends 'required' ? Key : never]: SelectedOptionValue<Props[Key], Selection[Key]> } & { [Key in keyof Props & keyof Selection as Selection[Key] extends Selector<any> ? never : Props[Key]['visibility'] extends 'optional' ? Key : never]?: SelectedOptionValue<Props[Key], Selection[Key]> };
|
|
33
|
+
/** Options are flattened one level, so `options: { meta: true }` supplies `meta`. */
|
|
34
|
+
type ReusableProps<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>, Include, Custom extends InPropsObject> = (Include extends {
|
|
35
|
+
resources: true;
|
|
36
|
+
} ? {
|
|
37
|
+
resources: ResourceEnum<Resources>[number][];
|
|
38
|
+
} : Include extends {
|
|
39
|
+
resources: (...args: any[]) => infer Result;
|
|
40
|
+
} ? {
|
|
41
|
+
resources: ResolvedResourceSelection<Resources, Result>;
|
|
42
|
+
} : {}) & (Include extends {
|
|
43
|
+
options: infer Selection;
|
|
44
|
+
} ? Selection extends ((...args: any[]) => infer Result) ? {
|
|
45
|
+
options: Result;
|
|
46
|
+
} : Selection extends true ? ResolvedBuiltPropShape<OptionDefinitions<Resources, Options>> : SelectedOptionProps<OptionDefinitions<Resources, Options>, Selection> : {}) & ResolvedBuiltPropShape<Custom>;
|
|
47
|
+
/** Data selected for the reusable's single callback argument. */
|
|
48
|
+
type ReusableSelected<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>, Selection> = (Selection extends {
|
|
49
|
+
resources: infer Value;
|
|
50
|
+
} ? {
|
|
51
|
+
resources: Value extends ((...args: any[]) => infer Result) ? ResolvedResourceSelection<Resources, Result> : LayoutResourcesAccessor<Resources>;
|
|
52
|
+
} : {}) & (Selection extends {
|
|
53
|
+
options: infer Value;
|
|
54
|
+
} ? Value extends ((...args: any[]) => infer Result) ? {
|
|
55
|
+
options: Result;
|
|
56
|
+
} : SelectedValues<OptionDefinitions<Resources, Options>, Value> : {});
|
|
57
|
+
type ReusableOverlap = 'preferProps' | 'preferSelect';
|
|
58
|
+
type SelectionShape<Props extends InPropsObject, Selection> = Selection extends Selector<any> ? 'value' : { [Key in keyof Props & (Selection extends true ? keyof Props : keyof Selection)]: SelectionAt<Selection, Key> extends Selector<any> ? 'value' : Props[Key] extends {
|
|
59
|
+
properties: infer Shape extends InPropsObject;
|
|
60
|
+
} ? SelectionShape<Shape, SelectionAt<Selection, Key>> : 'value' };
|
|
61
|
+
type ContractShape<Props extends InPropsObject, Contract, Custom> = (Contract extends {
|
|
62
|
+
resources: unknown;
|
|
63
|
+
} ? {
|
|
64
|
+
resources: 'value';
|
|
65
|
+
} : {}) & (Contract extends {
|
|
66
|
+
options: infer Selection;
|
|
67
|
+
} ? Selection extends Selector<any> ? {
|
|
68
|
+
options: 'value';
|
|
69
|
+
} : SelectionShape<Props, Selection> : {}) & { [Key in keyof Custom]: 'value' };
|
|
70
|
+
type MergeValue<Left, Right, Overlap, LeftShape, RightShape> = LeftShape extends object ? RightShape extends object ? MergeValues<NonNullable<Left>, NonNullable<Right>, Overlap, LeftShape, RightShape> : Overlap extends 'preferSelect' ? Right : Left : Overlap extends 'preferSelect' ? Right : Left;
|
|
71
|
+
type SharedKeys<Left, Right> = keyof Left & keyof Right;
|
|
72
|
+
type OptionalSharedKeys<Left, Right, Overlap, LeftShape, RightShape> = { [Key in SharedKeys<Left, Right>]: Key extends keyof LeftShape ? Key extends keyof RightShape ? LeftShape[Key] extends object ? RightShape[Key] extends object ? {} extends Pick<Left, Key> ? {} extends Pick<Right, Key> ? Key : never : never : Overlap extends 'preferSelect' ? {} extends Pick<Right, Key> ? Key : never : {} extends Pick<Left, Key> ? Key : never : Overlap extends 'preferSelect' ? {} extends Pick<Right, Key> ? Key : never : {} extends Pick<Left, Key> ? Key : never : never : never }[SharedKeys<Left, Right>];
|
|
73
|
+
type MergeValues<Left, Right, Overlap, LeftShape, RightShape> = Omit<Left, keyof Right> & Omit<Right, keyof Left> & { [Key in Exclude<SharedKeys<Left, Right>, OptionalSharedKeys<Left, Right, Overlap, LeftShape, RightShape>>]: MergeValue<Left[Key], Right[Key], Overlap, Key extends keyof LeftShape ? LeftShape[Key] : 'value', Key extends keyof RightShape ? RightShape[Key] : 'value'> } & { [Key in OptionalSharedKeys<Left, Right, Overlap, LeftShape, RightShape>]?: MergeValue<Left[Key], Right[Key], Overlap, Key extends keyof LeftShape ? LeftShape[Key] : 'value', Key extends keyof RightShape ? RightShape[Key] : 'value'> };
|
|
74
|
+
type IndependentSources<Props extends InPropsObject, Include, Select> = keyof CallerOptions<Props, Include, Select> extends never ? false : keyof (SourceValues<Props, Include, true> & SourceValues<Props, Select, false>) extends never ? false : true;
|
|
75
|
+
type BranchSelection<Selection> = Selection extends Selector<any> ? {} : Selection;
|
|
76
|
+
type GuardedFields<Value, Props extends InPropsObject, Include, Select, Shape, Independent extends boolean> = { [Key in keyof Value]: Key extends keyof Props ? Key extends keyof Shape ? Shape[Key] extends object ? Props[Key] extends {
|
|
77
|
+
properties: infer Nested extends InPropsObject;
|
|
78
|
+
} ? GuardedObject<NonNullable<Value[Key]>, Nested, BranchSelection<SelectionAt<Include, Key>>, BranchSelection<SelectionAt<Select, Key>>, Shape[Key], IndependentSources<Nested, BranchSelection<SelectionAt<Include, Key>>, BranchSelection<SelectionAt<Select, Key>>> extends true ? Independent extends true ? true : Props[Key]['visibility'] extends 'optional' ? true : false : false> | Extract<Value[Key], undefined> : Value[Key] : Value[Key] : Value[Key] : Value[Key] };
|
|
79
|
+
type GuardedObject<Value, Props extends InPropsObject, Include, Select, Shape, Independent extends boolean = false> = Independent extends true ? Partial<GuardedFields<Value, Props, Include, Select, Shape, Independent>> : GuardedFields<Value, Props, Include, Select, Shape, Independent>;
|
|
80
|
+
type MergedShape<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>, Include, Custom, Select, Overlap> = MergeValues<ContractShape<OptionDefinitions<Resources, Options>, Include, Custom>, ContractShape<OptionDefinitions<Resources, Options>, Select, {}>, Overlap, ContractShape<OptionDefinitions<Resources, Options>, Include, Custom>, ContractShape<OptionDefinitions<Resources, Options>, Select, {}>>;
|
|
81
|
+
type ReusableResolved<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>, Include, Custom extends InPropsObject, Select, Overlap = undefined> = Expanded<GuardedObject<MergeValues<ReusableProps<Resources, Options, Include, Custom>, ReusableSelected<Resources, Options, Select>, Overlap, ContractShape<OptionDefinitions<Resources, Options>, Include, Custom>, ContractShape<OptionDefinitions<Resources, Options>, Select, {}>>, OptionDefinitions<Resources, Options>, Include extends {
|
|
82
|
+
options: infer Selection;
|
|
83
|
+
} ? Selection : {}, Select extends {
|
|
84
|
+
options: infer Selection;
|
|
85
|
+
} ? Selection : {}, MergedShape<Resources, Options, Include, Custom, Select, Overlap>>>;
|
|
86
|
+
type SelectedValues<Props extends InPropsObject, Selection> = Selection extends ((...args: any[]) => infer Result) ? Result : Selection extends true ? ResolvedBuiltPropShape<Props> : SelectedOptionProps<Props, Selection>;
|
|
87
|
+
/** Sources are derived against the finite definition tree, not arbitrary input keys. */
|
|
88
|
+
type SourceValue<Definition extends AnyBuiltPropDefinition, Selection, CallbacksOnly extends boolean> = Selection extends Selector<any> ? OptionValue<Definition> : Selection extends true ? CallbacksOnly extends true ? never : OptionValue<Definition> : Definition extends {
|
|
89
|
+
properties: infer Shape extends InPropsObject;
|
|
90
|
+
} ? SourceValues<Shape, Selection, CallbacksOnly> : never;
|
|
91
|
+
type SourceKeys<Props extends InPropsObject, Selection, CallbacksOnly extends boolean> = { [Key in keyof Props & keyof Selection]: Selection[Key] extends Selector<any> ? Key : Selection[Key] extends true ? CallbacksOnly extends true ? never : Key : Props[Key] extends {
|
|
92
|
+
properties: infer Shape extends InPropsObject;
|
|
93
|
+
} ? keyof SourceValues<Shape, Selection[Key], CallbacksOnly> extends never ? never : Key : never }[keyof Props & keyof Selection];
|
|
94
|
+
type SourceValues<Props extends InPropsObject, Selection, CallbacksOnly extends boolean> = Selection extends Selector<any> ? ResolvedBuiltPropShape<Props> : Selection extends true ? CallbacksOnly extends true ? {} : ResolvedBuiltPropShape<Props> : { [Key in SourceKeys<Props, Selection, CallbacksOnly> as Props[Key]['visibility'] extends 'required' ? Key : never]: SourceValue<Props[Key], Selection[Key], CallbacksOnly> } & { [Key in SourceKeys<Props, Selection, CallbacksOnly> as Props[Key]['visibility'] extends 'optional' ? Key : never]?: SourceValue<Props[Key], Selection[Key], CallbacksOnly> };
|
|
95
|
+
type OptionSource<Props extends InPropsObject, Contract, CallbacksOnly extends boolean> = Contract extends {
|
|
96
|
+
options: infer Selection;
|
|
97
|
+
} ? SourceValues<Props, Selection, CallbacksOnly> : {};
|
|
98
|
+
/** Expand object intersections for readable public helper signatures. */
|
|
99
|
+
type Expanded<Value> = Value extends Promise<infer Result> ? Promise<Expanded<Result>> : Value extends ((...args: any[]) => any) ? Value : Value extends readonly unknown[] ? Value : Value extends object ? { [Key in keyof Value]: Expanded<Value[Key]> } : Value;
|
|
100
|
+
type SourceInput<Values> = keyof Values extends never ? {} : {} extends Values ? {
|
|
101
|
+
options?: Values;
|
|
102
|
+
} : {
|
|
103
|
+
options: Values;
|
|
104
|
+
};
|
|
105
|
+
type ReusableInput<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>, Include, Custom extends InPropsObject, Select> = Expanded<ReusableProps<Resources, Options, CallerContract<Resources, Options, Include, Select>, Custom> & ResourceCallerInput<Resources, Include> & ResourceCallerInput<Resources, Select> & SourceInput<OptionSource<OptionDefinitions<Resources, Options>, Include, true> & OptionSource<OptionDefinitions<Resources, Options>, Select, false>>>;
|
|
106
|
+
type SelectionAt<Selection, Key extends PropertyKey> = Selection extends true ? true : Key extends keyof Selection ? Selection[Key] : undefined;
|
|
107
|
+
type CallerOptions<Props extends InPropsObject, Include, Select> = { [Key in keyof Props as SelectionAt<Include, Key> extends infer Value ? Value extends Selector<any> | undefined ? never : Value extends true ? SelectionAt<Select, Key> extends true ? never : Props[Key] extends {
|
|
108
|
+
properties: infer Shape extends InPropsObject;
|
|
109
|
+
} ? SelectionAt<Select, Key> extends object ? keyof CallerOptions<Shape, true, SelectionAt<Select, Key>> extends never ? never : Key : Key : Key : Props[Key] extends {
|
|
110
|
+
properties: infer Shape extends InPropsObject;
|
|
111
|
+
} ? keyof CallerOptions<Shape, Value, SelectionAt<Select, Key>> extends never ? never : Key : never : never]: Props[Key] extends {
|
|
112
|
+
properties: infer Shape extends InPropsObject;
|
|
113
|
+
} ? SelectionAt<Include, Key> extends true ? SelectionAt<Select, Key> extends object ? CallerOptions<Shape, true, SelectionAt<Select, Key>> : true : CallerOptions<Shape, SelectionAt<Include, Key>, SelectionAt<Select, Key>> : true };
|
|
114
|
+
type CallerContract<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>, Include, Select> = (Include extends {
|
|
115
|
+
resources: true;
|
|
116
|
+
} ? {
|
|
117
|
+
resources: true;
|
|
118
|
+
} : {}) & (Include extends {
|
|
119
|
+
options: infer Value;
|
|
120
|
+
} ? Value extends Selector<any> ? {} : {
|
|
121
|
+
options: CallerOptions<OptionDefinitions<Resources, Options>, Value, Select extends {
|
|
122
|
+
options: infer Other;
|
|
123
|
+
} ? Other : {}>;
|
|
124
|
+
} : {});
|
|
125
|
+
type ExactSelection<Selection, Allowed> = { [Key in keyof Selection]: Key extends keyof Allowed ? Selection[Key] extends Selector<any> ? Allowed[Key] : Selection[Key] extends object ? ExactSelection<Selection[Key], Exclude<Allowed[Key], true | undefined | Selector<any>>> : Allowed[Key] : never };
|
|
126
|
+
/** Configuration accepted by the bound reusable factory. */
|
|
127
|
+
type ReusableDefinition<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>, Include extends ReusableInclude<Resources, Options>, Custom extends InPropsObject, Select extends ReusableInclude<Resources, Options>, Result, Overlap extends ReusableOverlap | undefined = undefined> = {
|
|
128
|
+
props?: PropsContract<ReusableInclude<Resources, Options> & Include & ExactSelection<Include, ReusableInclude<Resources, Options>>, Custom>;
|
|
129
|
+
select?: ReusableInclude<Resources, Options> & Select & ExactSelection<Select, ReusableInclude<Resources, Options>>; /** Resolve ambiguous leaf collisions explicitly; the default rejects them. */
|
|
130
|
+
overlap?: Overlap;
|
|
131
|
+
fn: (props: ReusableResolved<Resources, Options, Include, Custom, Select, Overlap>) => Result;
|
|
132
|
+
};
|
|
133
|
+
type ReusableArguments<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>, Include, Custom extends InPropsObject, Select> = {} extends ReusableInput<Resources, Options, Include, Custom, Select> ? [props?: ReusableInput<Resources, Options, Include, Custom, Select>] : [props: ReusableInput<Resources, Options, Include, Custom, Select>];
|
|
134
|
+
type ReusableFunction<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>, Include, Custom extends InPropsObject, Select, Result> = (...args: ReusableArguments<Resources, Options, Include, Custom, Select>) => Expanded<Result>;
|
|
135
|
+
/** Creates a validated function with one merged callback argument. */
|
|
136
|
+
type CreateReusable<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>> = <const Include extends ReusableInclude<Resources, Options> = {}, const Custom extends InPropsObject = {}, const Select extends ReusableInclude<Resources, Options> = {}, Result = unknown, const Overlap extends ReusableOverlap | undefined = undefined>(definition: ReusableDefinition<Resources, Options, Include, Custom, Select, Result, Overlap>) => Show<ReusableFunction<Resources, Options, Include, Custom, Select, Result>>;
|
|
137
|
+
//#endregion
|
|
138
|
+
export { CreateReusable, ReusableArguments, ReusableDefinition, ReusableFunction, ReusableInclude, ReusableInput, ReusableOptionSelection, ReusableOverlap, ReusableProps, ReusableResolved, ReusableSelected };
|
|
139
|
+
//# sourceMappingURL=reusable-types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reusable-types.d.cts","names":[],"sources":["../../src/create-config/reusable-types.ts"],"mappings":";;;;;;;;KA2BK,QAAA,YAAoB,MAAA,EAAQ,MAAM;AAAA,KAClC,WAAA,oBAA+B,sBAAA,IAChC,sBAAA,CAAuB,UAAA,KACtB,UAAA;;KAGO,uBAAA,eAAsC,aAAA,oBAClC,KAAA,IAAS,KAAA,CAAM,GAAA;EAC3B,IAAA;EACA,UAAA,sBAAgC,aAAA;AAAA,WAEvB,QAAA,CAAS,WAAA,CAAY,KAAA,CAAM,GAAA,MAAS,uBAAA,CAAwB,KAAA,WAC5D,QAAA,CAAS,WAAA,CAAY,KAAA,CAAM,GAAA;AAAA,KAGnC,yBAAA,4BACwB,kBAAA,cAEzB,MAAA,SAAe,mBAAA,UAA6B,kBAAA,MAC5C,YAAA,CAAa,SAAA,IACb,MAAA;AAAA,KAEC,mBAAA,4BACwB,kBAAA,gBAEzB,QAAA;EAAmB,SAAA,MAAe,IAAA;AAAA,IAClC,OAAA,CACE,MAAA,EACA,mBAAA,UAA6B,kBAAA;EAG3B,SAAA,EAAW,YAAA,CAAa,SAAA;AAAA;AAAA,KAG3B,iBAAA,4BACwB,kBAAA,oBACX,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Q,MAAA,MAC3D,KAAA,EAAO,aAAA,CAAc,SAAA,EAAW,OAAA,EAAS,OAAA,EAAS,MAAA,EAAQ,MAAA;AAAA,KAEnD,gBAAA,4BACiB,kBAAA,oBACX,iBAAA,CAAkB,SAAA,2BAEnB,aAAA,wBAIZ,IAAA,EAAM,iBAAA,CAAkB,SAAA,EAAW,OAAA,EAAS,OAAA,EAAS,MAAA,EAAQ,MAAA,MAC7D,QAAA,CAAS,MAAA;;KAGF,cAAA,4BACiB,kBAAA,oBACX,iBAAA,CAAkB,SAAA,4BAEZ,eAAA,CAAgB,SAAA,EAAW,OAAA,6BAC5B,aAAA,4BACA,eAAA,CAAgB,SAAA,EAAW,OAAA,gDAE1B,eAAA,0BAEtB,UAAA,EAAY,kBAAA,CACV,SAAA,EACA,OAAA,EACA,OAAA,EACA,MAAA,EACA,MAAA,EACA,MAAA,EACA,OAAA,MAEC,IAAA,CACH,gBAAA,CAAiB,SAAA,EAAW,OAAA,EAAS,OAAA,EAAS,MAAA,EAAQ,MAAA,EAAQ,MAAA"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { Show } from "../utils.mjs";
|
|
2
|
+
import { ResourceDefinition, ResourceEnum, ResourcePath } from "../resource.mjs";
|
|
3
|
+
import { InPropsDefinition, InPropsObject, InferredInProps, PropsContract } from "../props.mjs";
|
|
4
|
+
import { LayoutResourcesAccessor } from "./define-layout.mjs";
|
|
5
|
+
import { ReusableResourcesAccessor, SingleResourceInput } from "./reusable-resource-input.mjs";
|
|
6
|
+
import { AnyBuiltPropDefinition, ExtractDefinitionValue, ResolvedBuiltPropShape } from "@jfdevelops/react-layout-validator";
|
|
7
|
+
|
|
8
|
+
//#region src/create-config/reusable-types.d.ts
|
|
9
|
+
type Selector<Source> = (source: Source) => unknown;
|
|
10
|
+
type OptionValue<Definition extends AnyBuiltPropDefinition> = ExtractDefinitionValue<Definition> | (Definition['visibility'] extends 'optional' ? undefined : never);
|
|
11
|
+
/** Select or transform resolved option values, or drill into object values. */
|
|
12
|
+
type ReusableOptionSelection<Props extends InPropsObject> = { [Key in keyof Props]?: Props[Key] extends {
|
|
13
|
+
type: 'object';
|
|
14
|
+
properties: infer Shape extends InPropsObject;
|
|
15
|
+
} ? true | Selector<OptionValue<Props[Key]>> | ReusableOptionSelection<Shape> : true | Selector<OptionValue<Props[Key]>> };
|
|
16
|
+
type ResolvedResourceSelection<Resources extends readonly ResourceDefinition[], Result> = Result extends SingleResourceInput<readonly ResourceDefinition[]> ? ResourcePath<Resources> : Result;
|
|
17
|
+
type ResourceCallerInput<Resources extends readonly ResourceDefinition[], Contract> = Contract extends {
|
|
18
|
+
resources: (...args: any[]) => infer Result;
|
|
19
|
+
} ? Extract<Result, SingleResourceInput<readonly ResourceDefinition[]>> extends never ? {} : {
|
|
20
|
+
resources: ResourcePath<Resources>;
|
|
21
|
+
} : {};
|
|
22
|
+
type OptionDefinitions<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>> = InferredInProps<Resources, Options> extends infer Props extends InPropsObject ? Props : never;
|
|
23
|
+
/** Only data sources declared by the factory are available for selection. */
|
|
24
|
+
type ReusableInclude<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>> = {
|
|
25
|
+
resources?: true | Selector<ReusableResourcesAccessor<Resources>>;
|
|
26
|
+
} & (keyof OptionDefinitions<Resources, Options> extends never ? {} : {
|
|
27
|
+
options?: true | Selector<ResolvedBuiltPropShape<OptionDefinitions<Resources, Options>>> | ReusableOptionSelection<OptionDefinitions<Resources, Options>>;
|
|
28
|
+
});
|
|
29
|
+
type SelectedOptionValue<Definition extends AnyBuiltPropDefinition, Selection> = Selection extends true ? ExtractDefinitionValue<Definition> : Selection extends ((...args: any[]) => infer Result) ? Result : Definition extends {
|
|
30
|
+
properties: infer Shape extends InPropsObject;
|
|
31
|
+
} ? SelectedOptionProps<Shape, Selection> : never;
|
|
32
|
+
type SelectedOptionProps<Props extends InPropsObject, Selection> = { [Key in keyof Props & keyof Selection as Selection[Key] extends Selector<any> ? Key : Props[Key]['visibility'] extends 'required' ? Key : never]: SelectedOptionValue<Props[Key], Selection[Key]> } & { [Key in keyof Props & keyof Selection as Selection[Key] extends Selector<any> ? never : Props[Key]['visibility'] extends 'optional' ? Key : never]?: SelectedOptionValue<Props[Key], Selection[Key]> };
|
|
33
|
+
/** Options are flattened one level, so `options: { meta: true }` supplies `meta`. */
|
|
34
|
+
type ReusableProps<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>, Include, Custom extends InPropsObject> = (Include extends {
|
|
35
|
+
resources: true;
|
|
36
|
+
} ? {
|
|
37
|
+
resources: ResourceEnum<Resources>[number][];
|
|
38
|
+
} : Include extends {
|
|
39
|
+
resources: (...args: any[]) => infer Result;
|
|
40
|
+
} ? {
|
|
41
|
+
resources: ResolvedResourceSelection<Resources, Result>;
|
|
42
|
+
} : {}) & (Include extends {
|
|
43
|
+
options: infer Selection;
|
|
44
|
+
} ? Selection extends ((...args: any[]) => infer Result) ? {
|
|
45
|
+
options: Result;
|
|
46
|
+
} : Selection extends true ? ResolvedBuiltPropShape<OptionDefinitions<Resources, Options>> : SelectedOptionProps<OptionDefinitions<Resources, Options>, Selection> : {}) & ResolvedBuiltPropShape<Custom>;
|
|
47
|
+
/** Data selected for the reusable's single callback argument. */
|
|
48
|
+
type ReusableSelected<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>, Selection> = (Selection extends {
|
|
49
|
+
resources: infer Value;
|
|
50
|
+
} ? {
|
|
51
|
+
resources: Value extends ((...args: any[]) => infer Result) ? ResolvedResourceSelection<Resources, Result> : LayoutResourcesAccessor<Resources>;
|
|
52
|
+
} : {}) & (Selection extends {
|
|
53
|
+
options: infer Value;
|
|
54
|
+
} ? Value extends ((...args: any[]) => infer Result) ? {
|
|
55
|
+
options: Result;
|
|
56
|
+
} : SelectedValues<OptionDefinitions<Resources, Options>, Value> : {});
|
|
57
|
+
type ReusableOverlap = 'preferProps' | 'preferSelect';
|
|
58
|
+
type SelectionShape<Props extends InPropsObject, Selection> = Selection extends Selector<any> ? 'value' : { [Key in keyof Props & (Selection extends true ? keyof Props : keyof Selection)]: SelectionAt<Selection, Key> extends Selector<any> ? 'value' : Props[Key] extends {
|
|
59
|
+
properties: infer Shape extends InPropsObject;
|
|
60
|
+
} ? SelectionShape<Shape, SelectionAt<Selection, Key>> : 'value' };
|
|
61
|
+
type ContractShape<Props extends InPropsObject, Contract, Custom> = (Contract extends {
|
|
62
|
+
resources: unknown;
|
|
63
|
+
} ? {
|
|
64
|
+
resources: 'value';
|
|
65
|
+
} : {}) & (Contract extends {
|
|
66
|
+
options: infer Selection;
|
|
67
|
+
} ? Selection extends Selector<any> ? {
|
|
68
|
+
options: 'value';
|
|
69
|
+
} : SelectionShape<Props, Selection> : {}) & { [Key in keyof Custom]: 'value' };
|
|
70
|
+
type MergeValue<Left, Right, Overlap, LeftShape, RightShape> = LeftShape extends object ? RightShape extends object ? MergeValues<NonNullable<Left>, NonNullable<Right>, Overlap, LeftShape, RightShape> : Overlap extends 'preferSelect' ? Right : Left : Overlap extends 'preferSelect' ? Right : Left;
|
|
71
|
+
type SharedKeys<Left, Right> = keyof Left & keyof Right;
|
|
72
|
+
type OptionalSharedKeys<Left, Right, Overlap, LeftShape, RightShape> = { [Key in SharedKeys<Left, Right>]: Key extends keyof LeftShape ? Key extends keyof RightShape ? LeftShape[Key] extends object ? RightShape[Key] extends object ? {} extends Pick<Left, Key> ? {} extends Pick<Right, Key> ? Key : never : never : Overlap extends 'preferSelect' ? {} extends Pick<Right, Key> ? Key : never : {} extends Pick<Left, Key> ? Key : never : Overlap extends 'preferSelect' ? {} extends Pick<Right, Key> ? Key : never : {} extends Pick<Left, Key> ? Key : never : never : never }[SharedKeys<Left, Right>];
|
|
73
|
+
type MergeValues<Left, Right, Overlap, LeftShape, RightShape> = Omit<Left, keyof Right> & Omit<Right, keyof Left> & { [Key in Exclude<SharedKeys<Left, Right>, OptionalSharedKeys<Left, Right, Overlap, LeftShape, RightShape>>]: MergeValue<Left[Key], Right[Key], Overlap, Key extends keyof LeftShape ? LeftShape[Key] : 'value', Key extends keyof RightShape ? RightShape[Key] : 'value'> } & { [Key in OptionalSharedKeys<Left, Right, Overlap, LeftShape, RightShape>]?: MergeValue<Left[Key], Right[Key], Overlap, Key extends keyof LeftShape ? LeftShape[Key] : 'value', Key extends keyof RightShape ? RightShape[Key] : 'value'> };
|
|
74
|
+
type IndependentSources<Props extends InPropsObject, Include, Select> = keyof CallerOptions<Props, Include, Select> extends never ? false : keyof (SourceValues<Props, Include, true> & SourceValues<Props, Select, false>) extends never ? false : true;
|
|
75
|
+
type BranchSelection<Selection> = Selection extends Selector<any> ? {} : Selection;
|
|
76
|
+
type GuardedFields<Value, Props extends InPropsObject, Include, Select, Shape, Independent extends boolean> = { [Key in keyof Value]: Key extends keyof Props ? Key extends keyof Shape ? Shape[Key] extends object ? Props[Key] extends {
|
|
77
|
+
properties: infer Nested extends InPropsObject;
|
|
78
|
+
} ? GuardedObject<NonNullable<Value[Key]>, Nested, BranchSelection<SelectionAt<Include, Key>>, BranchSelection<SelectionAt<Select, Key>>, Shape[Key], IndependentSources<Nested, BranchSelection<SelectionAt<Include, Key>>, BranchSelection<SelectionAt<Select, Key>>> extends true ? Independent extends true ? true : Props[Key]['visibility'] extends 'optional' ? true : false : false> | Extract<Value[Key], undefined> : Value[Key] : Value[Key] : Value[Key] : Value[Key] };
|
|
79
|
+
type GuardedObject<Value, Props extends InPropsObject, Include, Select, Shape, Independent extends boolean = false> = Independent extends true ? Partial<GuardedFields<Value, Props, Include, Select, Shape, Independent>> : GuardedFields<Value, Props, Include, Select, Shape, Independent>;
|
|
80
|
+
type MergedShape<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>, Include, Custom, Select, Overlap> = MergeValues<ContractShape<OptionDefinitions<Resources, Options>, Include, Custom>, ContractShape<OptionDefinitions<Resources, Options>, Select, {}>, Overlap, ContractShape<OptionDefinitions<Resources, Options>, Include, Custom>, ContractShape<OptionDefinitions<Resources, Options>, Select, {}>>;
|
|
81
|
+
type ReusableResolved<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>, Include, Custom extends InPropsObject, Select, Overlap = undefined> = Expanded<GuardedObject<MergeValues<ReusableProps<Resources, Options, Include, Custom>, ReusableSelected<Resources, Options, Select>, Overlap, ContractShape<OptionDefinitions<Resources, Options>, Include, Custom>, ContractShape<OptionDefinitions<Resources, Options>, Select, {}>>, OptionDefinitions<Resources, Options>, Include extends {
|
|
82
|
+
options: infer Selection;
|
|
83
|
+
} ? Selection : {}, Select extends {
|
|
84
|
+
options: infer Selection;
|
|
85
|
+
} ? Selection : {}, MergedShape<Resources, Options, Include, Custom, Select, Overlap>>>;
|
|
86
|
+
type SelectedValues<Props extends InPropsObject, Selection> = Selection extends ((...args: any[]) => infer Result) ? Result : Selection extends true ? ResolvedBuiltPropShape<Props> : SelectedOptionProps<Props, Selection>;
|
|
87
|
+
/** Sources are derived against the finite definition tree, not arbitrary input keys. */
|
|
88
|
+
type SourceValue<Definition extends AnyBuiltPropDefinition, Selection, CallbacksOnly extends boolean> = Selection extends Selector<any> ? OptionValue<Definition> : Selection extends true ? CallbacksOnly extends true ? never : OptionValue<Definition> : Definition extends {
|
|
89
|
+
properties: infer Shape extends InPropsObject;
|
|
90
|
+
} ? SourceValues<Shape, Selection, CallbacksOnly> : never;
|
|
91
|
+
type SourceKeys<Props extends InPropsObject, Selection, CallbacksOnly extends boolean> = { [Key in keyof Props & keyof Selection]: Selection[Key] extends Selector<any> ? Key : Selection[Key] extends true ? CallbacksOnly extends true ? never : Key : Props[Key] extends {
|
|
92
|
+
properties: infer Shape extends InPropsObject;
|
|
93
|
+
} ? keyof SourceValues<Shape, Selection[Key], CallbacksOnly> extends never ? never : Key : never }[keyof Props & keyof Selection];
|
|
94
|
+
type SourceValues<Props extends InPropsObject, Selection, CallbacksOnly extends boolean> = Selection extends Selector<any> ? ResolvedBuiltPropShape<Props> : Selection extends true ? CallbacksOnly extends true ? {} : ResolvedBuiltPropShape<Props> : { [Key in SourceKeys<Props, Selection, CallbacksOnly> as Props[Key]['visibility'] extends 'required' ? Key : never]: SourceValue<Props[Key], Selection[Key], CallbacksOnly> } & { [Key in SourceKeys<Props, Selection, CallbacksOnly> as Props[Key]['visibility'] extends 'optional' ? Key : never]?: SourceValue<Props[Key], Selection[Key], CallbacksOnly> };
|
|
95
|
+
type OptionSource<Props extends InPropsObject, Contract, CallbacksOnly extends boolean> = Contract extends {
|
|
96
|
+
options: infer Selection;
|
|
97
|
+
} ? SourceValues<Props, Selection, CallbacksOnly> : {};
|
|
98
|
+
/** Expand object intersections for readable public helper signatures. */
|
|
99
|
+
type Expanded<Value> = Value extends Promise<infer Result> ? Promise<Expanded<Result>> : Value extends ((...args: any[]) => any) ? Value : Value extends readonly unknown[] ? Value : Value extends object ? { [Key in keyof Value]: Expanded<Value[Key]> } : Value;
|
|
100
|
+
type SourceInput<Values> = keyof Values extends never ? {} : {} extends Values ? {
|
|
101
|
+
options?: Values;
|
|
102
|
+
} : {
|
|
103
|
+
options: Values;
|
|
104
|
+
};
|
|
105
|
+
type ReusableInput<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>, Include, Custom extends InPropsObject, Select> = Expanded<ReusableProps<Resources, Options, CallerContract<Resources, Options, Include, Select>, Custom> & ResourceCallerInput<Resources, Include> & ResourceCallerInput<Resources, Select> & SourceInput<OptionSource<OptionDefinitions<Resources, Options>, Include, true> & OptionSource<OptionDefinitions<Resources, Options>, Select, false>>>;
|
|
106
|
+
type SelectionAt<Selection, Key extends PropertyKey> = Selection extends true ? true : Key extends keyof Selection ? Selection[Key] : undefined;
|
|
107
|
+
type CallerOptions<Props extends InPropsObject, Include, Select> = { [Key in keyof Props as SelectionAt<Include, Key> extends infer Value ? Value extends Selector<any> | undefined ? never : Value extends true ? SelectionAt<Select, Key> extends true ? never : Props[Key] extends {
|
|
108
|
+
properties: infer Shape extends InPropsObject;
|
|
109
|
+
} ? SelectionAt<Select, Key> extends object ? keyof CallerOptions<Shape, true, SelectionAt<Select, Key>> extends never ? never : Key : Key : Key : Props[Key] extends {
|
|
110
|
+
properties: infer Shape extends InPropsObject;
|
|
111
|
+
} ? keyof CallerOptions<Shape, Value, SelectionAt<Select, Key>> extends never ? never : Key : never : never]: Props[Key] extends {
|
|
112
|
+
properties: infer Shape extends InPropsObject;
|
|
113
|
+
} ? SelectionAt<Include, Key> extends true ? SelectionAt<Select, Key> extends object ? CallerOptions<Shape, true, SelectionAt<Select, Key>> : true : CallerOptions<Shape, SelectionAt<Include, Key>, SelectionAt<Select, Key>> : true };
|
|
114
|
+
type CallerContract<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>, Include, Select> = (Include extends {
|
|
115
|
+
resources: true;
|
|
116
|
+
} ? {
|
|
117
|
+
resources: true;
|
|
118
|
+
} : {}) & (Include extends {
|
|
119
|
+
options: infer Value;
|
|
120
|
+
} ? Value extends Selector<any> ? {} : {
|
|
121
|
+
options: CallerOptions<OptionDefinitions<Resources, Options>, Value, Select extends {
|
|
122
|
+
options: infer Other;
|
|
123
|
+
} ? Other : {}>;
|
|
124
|
+
} : {});
|
|
125
|
+
type ExactSelection<Selection, Allowed> = { [Key in keyof Selection]: Key extends keyof Allowed ? Selection[Key] extends Selector<any> ? Allowed[Key] : Selection[Key] extends object ? ExactSelection<Selection[Key], Exclude<Allowed[Key], true | undefined | Selector<any>>> : Allowed[Key] : never };
|
|
126
|
+
/** Configuration accepted by the bound reusable factory. */
|
|
127
|
+
type ReusableDefinition<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>, Include extends ReusableInclude<Resources, Options>, Custom extends InPropsObject, Select extends ReusableInclude<Resources, Options>, Result, Overlap extends ReusableOverlap | undefined = undefined> = {
|
|
128
|
+
props?: PropsContract<ReusableInclude<Resources, Options> & Include & ExactSelection<Include, ReusableInclude<Resources, Options>>, Custom>;
|
|
129
|
+
select?: ReusableInclude<Resources, Options> & Select & ExactSelection<Select, ReusableInclude<Resources, Options>>; /** Resolve ambiguous leaf collisions explicitly; the default rejects them. */
|
|
130
|
+
overlap?: Overlap;
|
|
131
|
+
fn: (props: ReusableResolved<Resources, Options, Include, Custom, Select, Overlap>) => Result;
|
|
132
|
+
};
|
|
133
|
+
type ReusableArguments<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>, Include, Custom extends InPropsObject, Select> = {} extends ReusableInput<Resources, Options, Include, Custom, Select> ? [props?: ReusableInput<Resources, Options, Include, Custom, Select>] : [props: ReusableInput<Resources, Options, Include, Custom, Select>];
|
|
134
|
+
type ReusableFunction<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>, Include, Custom extends InPropsObject, Select, Result> = (...args: ReusableArguments<Resources, Options, Include, Custom, Select>) => Expanded<Result>;
|
|
135
|
+
/** Creates a validated function with one merged callback argument. */
|
|
136
|
+
type CreateReusable<Resources extends readonly ResourceDefinition[], Options extends InPropsDefinition<Resources>> = <const Include extends ReusableInclude<Resources, Options> = {}, const Custom extends InPropsObject = {}, const Select extends ReusableInclude<Resources, Options> = {}, Result = unknown, const Overlap extends ReusableOverlap | undefined = undefined>(definition: ReusableDefinition<Resources, Options, Include, Custom, Select, Result, Overlap>) => Show<ReusableFunction<Resources, Options, Include, Custom, Select, Result>>;
|
|
137
|
+
//#endregion
|
|
138
|
+
export { CreateReusable, ReusableArguments, ReusableDefinition, ReusableFunction, ReusableInclude, ReusableInput, ReusableOptionSelection, ReusableOverlap, ReusableProps, ReusableResolved, ReusableSelected };
|
|
139
|
+
//# sourceMappingURL=reusable-types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reusable-types.d.mts","names":[],"sources":["../../src/create-config/reusable-types.ts"],"mappings":";;;;;;;;KA2BK,QAAA,YAAoB,MAAA,EAAQ,MAAM;AAAA,KAClC,WAAA,oBAA+B,sBAAA,IAChC,sBAAA,CAAuB,UAAA,KACtB,UAAA;;KAG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|
@@ -5,7 +5,7 @@ import { LazyResourceError, LazyResourceErrorMap, LazyResourceModuleShapeError,
|
|
|
5
5
|
import { CreateLazyErrorComponent, LazyErrorHandlers, LazyHandle, LazyOptions, LazyResourceErrorComponent, LazyResourceErrorProps, LazyResourceLoadingComponent, LazyResourceStates, LoadStatus } from "./lazy/types.cjs";
|
|
6
6
|
import { BaseComponent, MergeIntersection, Show, UnionToIntersection, pick } from "./utils.cjs";
|
|
7
7
|
import { LayoutResourceKey, NormalizeResource, NormalizeResources, NormalizedResourceDefinition, NormalizedResourceDefinitions, ResourceDefinition, ResourceDefinitionValue, ResourceEnum, ResourceLayoutComponentProps, ResourcePath, ResourceTree, normalizeResource, normalizeResourceDefinitions, normalizeResources, toResourceEnum } from "./resource.cjs";
|
|
8
|
-
import { InPropsDefinition, InPropsFunction, InPropsObject, InPropsOptions, IncludedComponentPropDefinitions, IncludedPropBehavior, IncludedProps, InferredInProps, LayoutRenderProps, MergedLayoutInProps, PropsContextRender, PropsRenderDefinition, ResolvedIncludedComponentProps, ResolvedIncludedConfigProps, ResolvedIncludedProps, ResolvedIncludedPropsAsDefined } from "./props.cjs";
|
|
8
|
+
import { InPropsDefinition, InPropsFunction, InPropsObject, InPropsOptions, IncludedComponentPropDefinitions, IncludedPropBehavior, IncludedProps, InferredInProps, LayoutRenderProps, MergedLayoutInProps, PropsContextRender, PropsContract, PropsRenderDefinition, ResolvedIncludedComponentProps, ResolvedIncludedConfigProps, ResolvedIncludedProps, ResolvedIncludedPropsAsDefined } from "./props.cjs";
|
|
9
9
|
import { AsStateComposable, StateComposable, StateComposableOptions } from "./create-config/state-composable.cjs";
|
|
10
10
|
import { AnyRenderStateDefinition, BuiltinRenderStateName, CreateLayoutBuildingBlocks, CreateLayoutBuildingBlocksArguments, CreateLayoutBuildingBlocksResult, CreateRenderState, CreateRenderStateBuilderArguments, CreateRenderStateBuilderResult, CreateRenderStateFromState, DeferredRenderState, DefineLayoutComposables, LayoutComposablesDefinition, LazyRenderState, RenderStateCallProps, RenderStateCallback, RenderStateComposablesDefinition, RenderStateContext, RenderStateFragment, RenderStateName, RenderStateOverloads, RenderStateProps, RenderStateReferences, TypedRenderStateCallback } from "./create-config/render-state.cjs";
|
|
11
11
|
import { LayoutNameCallback, LayoutNameContext, LayoutNameFactory, LayoutNameInput, LayoutNameOptions, LayoutNamePartDefinitions, LayoutNamePartType, LayoutNamePartValues, LayoutNameParts, LayoutNameResolver, ResolvedLayoutName, defineLayoutName } from "./create-config/layout-name.cjs";
|
|
@@ -17,7 +17,8 @@ import { ComponentTypes, CreateResourceConfigFn, CreateResourceConfigForResource
|
|
|
17
17
|
import { CreateResourceMap, CreateResourceMapFn } from "./create-config/create-resource-links.cjs";
|
|
18
18
|
import { ScopedComponentRenderFn } from "./lazy/scoped-content.cjs";
|
|
19
19
|
import { ContextualInlineRenderState, ContextualInlineRenderStates, CreateResourceLayoutWithLayoutOptions, CreateViewMapBuiltInRenderStatesOptions, CreateViewMapFunctionRenderOptions, CreateViewMapInlineRenderStatesOptions, CreateViewMapRenderStatesOptions, DefineResourceLayoutWithLayoutFn, DefineResourcesFn, DefinedResourceLayoutWithShell, LayoutRenderResourcesAccessor, LayoutResourcesAccessor, ResourceLayoutProvider, ResourceLayoutProviderProps, ResourceLayoutShellComponent, ResourceLayoutShellProps, ResourceSelection, ShellLayoutDefinition, ShellRenderContext, TypedBuiltInRenderStates, TypedInlineRenderState, defineResourceLayout } from "./create-config/define-layout.cjs";
|
|
20
|
-
import {
|
|
20
|
+
import { ReusableResourcesAccessor, SingleResourceInput } from "./create-config/reusable-resource-input.cjs";
|
|
21
|
+
import { CreateReusable, ReusableArguments, ReusableDefinition, ReusableFunction, ReusableInclude, ReusableInput, ReusableOptionSelection, ReusableOverlap, ReusableProps, ReusableResolved, ReusableSelected } from "./create-config/reusable-types.cjs";
|
|
21
22
|
import { CreateLazyRenderState, LazyDefaultState } from "./lazy/create-render-state.cjs";
|
|
22
23
|
import { LazyResourceLayoutComponent, LazyResourceLayoutOptions } from "./create-config/lazy-resource-layout.cjs";
|
|
23
24
|
import { BoundDefineResourceLayout, CreateDefinedResourceLayoutOptions, CreateDefinedResourceLayoutResult, DefineLazyDefaults, DefinedResourceLayoutInput, NonEmptyResources, createDefinedResourceLayout } from "./create-config/create-defined-resource-layout.cjs";
|
|
@@ -35,4 +36,4 @@ import { MissingPathVariableContext, MissingPathVariableError } from "./errors/m
|
|
|
35
36
|
import { MissingResourceProviderError } from "./errors/missing-resource-provider.cjs";
|
|
36
37
|
import { AnyComposableComponent, ComposableComponent, ComposableComponentCallable, ComposableComponents, ComposableNameContext, ComposablePresetComponent, ComposablePresetComponentCallProps, ComposablePresetMeta, ComposablePresetProps, ComposableResourceLayout, CreateLayoutComposable, DefinedComposableComponentRecord, LayoutComposablePresetProvider, LayoutComposablesFactory, MakeComposable, MakeComposableOptions, MergePresetProps, PresetPropsFromComposable, RequiredPresetLayoutProps, RequiredPresetRenderProps, ResolveLayoutComposables, collectComposablePresetEntries, createComposableComponent, createLayoutComposableFactory, defineComposableComponent, makeComposable, resolveComposablePresetProps, resolveLayoutComposables } from "@jfdevelops/react-layout-composables";
|
|
37
38
|
import { AnyBuiltPropDefinition, ExtractDefinitionValue, PropError, PropErrorOptions, ResolveLayoutProps, ResolveLayoutPropsAsDefined, ResolveProps, ResolvedBuiltPropShape, createPrimitivePropBuilder, createProp, isPropDefinitionShape, resolvePropDefinitionValues, validateProps } from "@jfdevelops/react-layout-validator";
|
|
38
|
-
export { type AnyBuiltPropDefinition, type AnyComposableComponent, type AnyRenderStateDefinition, type AsStateComposable, type BaseComponent, type BoundDefineResourceLayout, type BuiltinRenderStateName, type ChildrenRequirement, type ComponentTypes, type ComposableComponent, type ComposableComponentCallable, type ComposableComponents, type ComposableNameContext, type ComposablePresetComponent, type ComposablePresetComponentCallProps, type ComposablePresetMeta, type ComposablePresetProps, type ComposableResourceLayout, type ContextualInlineRenderState, type ContextualInlineRenderStates, type CreateDefinedResourceLayoutOptions, type CreateDefinedResourceLayoutResult, type CreateGetComponentForPath, type CreateLayoutBuildingBlocks, type CreateLayoutBuildingBlocksArguments, type CreateLayoutBuildingBlocksResult, type CreateLayoutComposable, type CreateLazyErrorComponent, type CreateLazyRenderState, type CreateRenderState, type CreateRenderStateBuilderArguments, type CreateRenderStateBuilderResult, type CreateRenderStateFromState, type CreateResourceConfigFn, type CreateResourceConfigForResource, type CreateResourceLayoutWithLayoutOptions, type CreateResourceMap, type CreateResourceMapFn, type CreateReusable, type CreateViewMapBuiltInRenderStatesOptions, type CreateViewMapFunctionRenderOptions, type CreateViewMapInlineRenderStatesOptions, type CreateViewMapRenderStatesOptions, type CreatedResourceConfig, type CustomPropsObject, type DeferredRenderState, type DefineLayoutComposables, type DefineLazyDefaults, type DefineResourceLayoutWithLayoutFn, type DefineResourcesFn, type DefinedComposableComponentRecord, type DefinedResourceLayoutInput, type DefinedResourceLayoutWithShell, type ExtractDefinitionValue, type ForPaths, type ForPathsRenderContext, type GetComponentForPath, type InPropsDefinition, type InPropsFunction, type InPropsObject, type InPropsOptions, type IncludedComponentPropDefinitions, type IncludedPropBehavior, type IncludedProps, type InferredInProps, type InvalidComponentContext, InvalidComponentError, type InvalidConfigContext, InvalidConfigError, type InvalidPartContext, InvalidPartError, type InvalidPartTypeContext, InvalidPartTypeError, type InvalidPathContext, InvalidPathError, type InvalidResourceContext, InvalidResourceError, type InvalidSubResourceContext, InvalidSubResourceError, type IsSubResourceKey, LayoutComposablePresetProvider, type LayoutComposablesDefinition, type LayoutComposablesFactory, LayoutConfigurationError, type LayoutConfigurationErrorContext, type LayoutNameCallback, type LayoutNameContext, type LayoutNameFactory, type LayoutNameInput, type LayoutNameOptions, type LayoutNamePartDefinitions, type LayoutNamePartType, type LayoutNamePartValues, type LayoutNameParts, type LayoutNameResolver, type LayoutPreviewProps, type LayoutRenderProps, type LayoutRenderResourcesAccessor, type LayoutResourceKey, type LayoutResourcesAccessor, type LazyDefaultState, type LazyErrorHandlers, type LazyHandle, type LazyOptions, type LazyRenderState, type LazyResourceError, type LazyResourceErrorComponent, type LazyResourceErrorMap, type LazyResourceErrorProps, type LazyResourceLayoutComponent, type LazyResourceLayoutOptions, type LazyResourceLoadingComponent, LazyResourceModuleShapeError, LazyResourceStateNotFoundError, type LazyResourceStates, type LoadStatus, type MakeComposable, type MakeComposableOptions, type MergeIntersection, type MergePresetProps, type MergedLayoutInProps, type MissingPathVariableContext, MissingPathVariableError, MissingResourceProviderError, type NonEmptyResources, type NormalizeResource, type NormalizeResources, type NormalizedResourceDefinition, type NormalizedResourceDefinitions, type ParameterizedResourcePath, type PathVariables, type PresetPropsFromComposable, PropError, type PropErrorOptions, type PropsContextRender, type PropsRenderDefinition, ReactLayoutError, type RenderStateCallProps, type RenderStateCallback, type RenderStateComposablesDefinition, type RenderStateContext, type RenderStateFragment, type RenderStateName, type RenderStateOverloads, type RenderStateProps, type RenderStateReferences, type RenderedPathComponent, type RenderedPathComponentHOF, type RequiredPresetLayoutProps, type RequiredPresetRenderProps, type ResolveLayoutComposables, type ResolveLayoutProps, type ResolveLayoutPropsAsDefined, type ResolveProps, type ResolvedBuiltPropShape, type ResolvedIncludedComponentProps, type ResolvedIncludedConfigProps, type ResolvedIncludedProps, type ResolvedIncludedPropsAsDefined, type ResolvedLayoutName, type ResolvedPathValue, type ResourceConfigFragment, type ResourceDefinition, type ResourceDefinitionValue, type ResourceEnum, type ResourceLayoutComponentProps, type ResourceLayoutProvider, type ResourceLayoutProviderProps, type ResourceLayoutShellComponent, type ResourceLayoutShellProps, type ResourceLayoutShellPublisher, ResourceModuleLoadError, type ResourcePath, ResourceRenderError, type ResourceSelection, type ResourceStateError, type ResourceTree, type ReusableInclude, type ReusableOptionSelection, type ReusableProps, type ScopedComponentRenderFn, type ShellLayoutDefinition, type ShellRenderContext, type Show, type StateComposable, type StateComposableOptions, type TargetPathBuilder, type TypedBuiltInRenderStates, type TypedInlineRenderState, type TypedRenderStateCallback, type UnionToIntersection, collectComposablePresetEntries, createComposableComponent, createDefinedResourceLayout, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, defineComposableComponent, defineLayoutName, defineLayoutPreview, defineResourceLayout, isLazyResourceError, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResourceDefinitions, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|
|
39
|
+
export { type AnyBuiltPropDefinition, type AnyComposableComponent, type AnyRenderStateDefinition, type AsStateComposable, type BaseComponent, type BoundDefineResourceLayout, type BuiltinRenderStateName, type ChildrenRequirement, type ComponentTypes, type ComposableComponent, type ComposableComponentCallable, type ComposableComponents, type ComposableNameContext, type ComposablePresetComponent, type ComposablePresetComponentCallProps, type ComposablePresetMeta, type ComposablePresetProps, type ComposableResourceLayout, type ContextualInlineRenderState, type ContextualInlineRenderStates, type CreateDefinedResourceLayoutOptions, type CreateDefinedResourceLayoutResult, type CreateGetComponentForPath, type CreateLayoutBuildingBlocks, type CreateLayoutBuildingBlocksArguments, type CreateLayoutBuildingBlocksResult, type CreateLayoutComposable, type CreateLazyErrorComponent, type CreateLazyRenderState, type CreateRenderState, type CreateRenderStateBuilderArguments, type CreateRenderStateBuilderResult, type CreateRenderStateFromState, type CreateResourceConfigFn, type CreateResourceConfigForResource, type CreateResourceLayoutWithLayoutOptions, type CreateResourceMap, type CreateResourceMapFn, type CreateReusable, type CreateViewMapBuiltInRenderStatesOptions, type CreateViewMapFunctionRenderOptions, type CreateViewMapInlineRenderStatesOptions, type CreateViewMapRenderStatesOptions, type CreatedResourceConfig, type CustomPropsObject, type DeferredRenderState, type DefineLayoutComposables, type DefineLazyDefaults, type DefineResourceLayoutWithLayoutFn, type DefineResourcesFn, type DefinedComposableComponentRecord, type DefinedResourceLayoutInput, type DefinedResourceLayoutWithShell, type ExtractDefinitionValue, type ForPaths, type ForPathsRenderContext, type GetComponentForPath, type InPropsDefinition, type InPropsFunction, type InPropsObject, type InPropsOptions, type IncludedComponentPropDefinitions, type IncludedPropBehavior, type IncludedProps, type InferredInProps, type InvalidComponentContext, InvalidComponentError, type InvalidConfigContext, InvalidConfigError, type InvalidPartContext, InvalidPartError, type InvalidPartTypeContext, InvalidPartTypeError, type InvalidPathContext, InvalidPathError, type InvalidResourceContext, InvalidResourceError, type InvalidSubResourceContext, InvalidSubResourceError, type IsSubResourceKey, LayoutComposablePresetProvider, type LayoutComposablesDefinition, type LayoutComposablesFactory, LayoutConfigurationError, type LayoutConfigurationErrorContext, type LayoutNameCallback, type LayoutNameContext, type LayoutNameFactory, type LayoutNameInput, type LayoutNameOptions, type LayoutNamePartDefinitions, type LayoutNamePartType, type LayoutNamePartValues, type LayoutNameParts, type LayoutNameResolver, type LayoutPreviewProps, type LayoutRenderProps, type LayoutRenderResourcesAccessor, type LayoutResourceKey, type LayoutResourcesAccessor, type LazyDefaultState, type LazyErrorHandlers, type LazyHandle, type LazyOptions, type LazyRenderState, type LazyResourceError, type LazyResourceErrorComponent, type LazyResourceErrorMap, type LazyResourceErrorProps, type LazyResourceLayoutComponent, type LazyResourceLayoutOptions, type LazyResourceLoadingComponent, LazyResourceModuleShapeError, LazyResourceStateNotFoundError, type LazyResourceStates, type LoadStatus, type MakeComposable, type MakeComposableOptions, type MergeIntersection, type MergePresetProps, type MergedLayoutInProps, type MissingPathVariableContext, MissingPathVariableError, MissingResourceProviderError, type NonEmptyResources, type NormalizeResource, type NormalizeResources, type NormalizedResourceDefinition, type NormalizedResourceDefinitions, type ParameterizedResourcePath, type PathVariables, type PresetPropsFromComposable, PropError, type PropErrorOptions, type PropsContextRender, type PropsContract, type PropsRenderDefinition, ReactLayoutError, type RenderStateCallProps, type RenderStateCallback, type RenderStateComposablesDefinition, type RenderStateContext, type RenderStateFragment, type RenderStateName, type RenderStateOverloads, type RenderStateProps, type RenderStateReferences, type RenderedPathComponent, type RenderedPathComponentHOF, type RequiredPresetLayoutProps, type RequiredPresetRenderProps, type ResolveLayoutComposables, type ResolveLayoutProps, type ResolveLayoutPropsAsDefined, type ResolveProps, type ResolvedBuiltPropShape, type ResolvedIncludedComponentProps, type ResolvedIncludedConfigProps, type ResolvedIncludedProps, type ResolvedIncludedPropsAsDefined, type ResolvedLayoutName, type ResolvedPathValue, type ResourceConfigFragment, type ResourceDefinition, type ResourceDefinitionValue, type ResourceEnum, type ResourceLayoutComponentProps, type ResourceLayoutProvider, type ResourceLayoutProviderProps, type ResourceLayoutShellComponent, type ResourceLayoutShellProps, type ResourceLayoutShellPublisher, ResourceModuleLoadError, type ResourcePath, ResourceRenderError, type ResourceSelection, type ResourceStateError, type ResourceTree, type ReusableArguments, type ReusableDefinition, type ReusableFunction, type ReusableInclude, type ReusableInput, type ReusableOptionSelection, type ReusableOverlap, type ReusableProps, type ReusableResolved, type ReusableResourcesAccessor, type ReusableSelected, type ScopedComponentRenderFn, type ShellLayoutDefinition, type ShellRenderContext, type Show, type SingleResourceInput, type StateComposable, type StateComposableOptions, type TargetPathBuilder, type TypedBuiltInRenderStates, type TypedInlineRenderState, type TypedRenderStateCallback, type UnionToIntersection, collectComposablePresetEntries, createComposableComponent, createDefinedResourceLayout, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, defineComposableComponent, defineLayoutName, defineLayoutPreview, defineResourceLayout, isLazyResourceError, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResourceDefinitions, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|
package/dist/index.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ import { LazyResourceError, LazyResourceErrorMap, LazyResourceModuleShapeError,
|
|
|
5
5
|
import { CreateLazyErrorComponent, LazyErrorHandlers, LazyHandle, LazyOptions, LazyResourceErrorComponent, LazyResourceErrorProps, LazyResourceLoadingComponent, LazyResourceStates, LoadStatus } from "./lazy/types.mjs";
|
|
6
6
|
import { BaseComponent, MergeIntersection, Show, UnionToIntersection, pick } from "./utils.mjs";
|
|
7
7
|
import { LayoutResourceKey, NormalizeResource, NormalizeResources, NormalizedResourceDefinition, NormalizedResourceDefinitions, ResourceDefinition, ResourceDefinitionValue, ResourceEnum, ResourceLayoutComponentProps, ResourcePath, ResourceTree, normalizeResource, normalizeResourceDefinitions, normalizeResources, toResourceEnum } from "./resource.mjs";
|
|
8
|
-
import { InPropsDefinition, InPropsFunction, InPropsObject, InPropsOptions, IncludedComponentPropDefinitions, IncludedPropBehavior, IncludedProps, InferredInProps, LayoutRenderProps, MergedLayoutInProps, PropsContextRender, PropsRenderDefinition, ResolvedIncludedComponentProps, ResolvedIncludedConfigProps, ResolvedIncludedProps, ResolvedIncludedPropsAsDefined } from "./props.mjs";
|
|
8
|
+
import { InPropsDefinition, InPropsFunction, InPropsObject, InPropsOptions, IncludedComponentPropDefinitions, IncludedPropBehavior, IncludedProps, InferredInProps, LayoutRenderProps, MergedLayoutInProps, PropsContextRender, PropsContract, PropsRenderDefinition, ResolvedIncludedComponentProps, ResolvedIncludedConfigProps, ResolvedIncludedProps, ResolvedIncludedPropsAsDefined } from "./props.mjs";
|
|
9
9
|
import { AsStateComposable, StateComposable, StateComposableOptions } from "./create-config/state-composable.mjs";
|
|
10
10
|
import { AnyRenderStateDefinition, BuiltinRenderStateName, CreateLayoutBuildingBlocks, CreateLayoutBuildingBlocksArguments, CreateLayoutBuildingBlocksResult, CreateRenderState, CreateRenderStateBuilderArguments, CreateRenderStateBuilderResult, CreateRenderStateFromState, DeferredRenderState, DefineLayoutComposables, LayoutComposablesDefinition, LazyRenderState, RenderStateCallProps, RenderStateCallback, RenderStateComposablesDefinition, RenderStateContext, RenderStateFragment, RenderStateName, RenderStateOverloads, RenderStateProps, RenderStateReferences, TypedRenderStateCallback } from "./create-config/render-state.mjs";
|
|
11
11
|
import { LayoutNameCallback, LayoutNameContext, LayoutNameFactory, LayoutNameInput, LayoutNameOptions, LayoutNamePartDefinitions, LayoutNamePartType, LayoutNamePartValues, LayoutNameParts, LayoutNameResolver, ResolvedLayoutName, defineLayoutName } from "./create-config/layout-name.mjs";
|
|
@@ -17,7 +17,8 @@ import { ComponentTypes, CreateResourceConfigFn, CreateResourceConfigForResource
|
|
|
17
17
|
import { CreateResourceMap, CreateResourceMapFn } from "./create-config/create-resource-links.mjs";
|
|
18
18
|
import { ScopedComponentRenderFn } from "./lazy/scoped-content.mjs";
|
|
19
19
|
import { ContextualInlineRenderState, ContextualInlineRenderStates, CreateResourceLayoutWithLayoutOptions, CreateViewMapBuiltInRenderStatesOptions, CreateViewMapFunctionRenderOptions, CreateViewMapInlineRenderStatesOptions, CreateViewMapRenderStatesOptions, DefineResourceLayoutWithLayoutFn, DefineResourcesFn, DefinedResourceLayoutWithShell, LayoutRenderResourcesAccessor, LayoutResourcesAccessor, ResourceLayoutProvider, ResourceLayoutProviderProps, ResourceLayoutShellComponent, ResourceLayoutShellProps, ResourceSelection, ShellLayoutDefinition, ShellRenderContext, TypedBuiltInRenderStates, TypedInlineRenderState, defineResourceLayout } from "./create-config/define-layout.mjs";
|
|
20
|
-
import {
|
|
20
|
+
import { ReusableResourcesAccessor, SingleResourceInput } from "./create-config/reusable-resource-input.mjs";
|
|
21
|
+
import { CreateReusable, ReusableArguments, ReusableDefinition, ReusableFunction, ReusableInclude, ReusableInput, ReusableOptionSelection, ReusableOverlap, ReusableProps, ReusableResolved, ReusableSelected } from "./create-config/reusable-types.mjs";
|
|
21
22
|
import { CreateLazyRenderState, LazyDefaultState } from "./lazy/create-render-state.mjs";
|
|
22
23
|
import { LazyResourceLayoutComponent, LazyResourceLayoutOptions } from "./create-config/lazy-resource-layout.mjs";
|
|
23
24
|
import { BoundDefineResourceLayout, CreateDefinedResourceLayoutOptions, CreateDefinedResourceLayoutResult, DefineLazyDefaults, DefinedResourceLayoutInput, NonEmptyResources, createDefinedResourceLayout } from "./create-config/create-defined-resource-layout.mjs";
|
|
@@ -35,4 +36,4 @@ import { MissingPathVariableContext, MissingPathVariableError } from "./errors/m
|
|
|
35
36
|
import { MissingResourceProviderError } from "./errors/missing-resource-provider.mjs";
|
|
36
37
|
import { AnyComposableComponent, ComposableComponent, ComposableComponentCallable, ComposableComponents, ComposableNameContext, ComposablePresetComponent, ComposablePresetComponentCallProps, ComposablePresetMeta, ComposablePresetProps, ComposableResourceLayout, CreateLayoutComposable, DefinedComposableComponentRecord, LayoutComposablePresetProvider, LayoutComposablesFactory, MakeComposable, MakeComposableOptions, MergePresetProps, PresetPropsFromComposable, RequiredPresetLayoutProps, RequiredPresetRenderProps, ResolveLayoutComposables, collectComposablePresetEntries, createComposableComponent, createLayoutComposableFactory, defineComposableComponent, makeComposable, resolveComposablePresetProps, resolveLayoutComposables } from "@jfdevelops/react-layout-composables";
|
|
37
38
|
import { AnyBuiltPropDefinition, ExtractDefinitionValue, PropError, PropErrorOptions, ResolveLayoutProps, ResolveLayoutPropsAsDefined, ResolveProps, ResolvedBuiltPropShape, createPrimitivePropBuilder, createProp, isPropDefinitionShape, resolvePropDefinitionValues, validateProps } from "@jfdevelops/react-layout-validator";
|
|
38
|
-
export { type AnyBuiltPropDefinition, type AnyComposableComponent, type AnyRenderStateDefinition, type AsStateComposable, type BaseComponent, type BoundDefineResourceLayout, type BuiltinRenderStateName, type ChildrenRequirement, type ComponentTypes, type ComposableComponent, type ComposableComponentCallable, type ComposableComponents, type ComposableNameContext, type ComposablePresetComponent, type ComposablePresetComponentCallProps, type ComposablePresetMeta, type ComposablePresetProps, type ComposableResourceLayout, type ContextualInlineRenderState, type ContextualInlineRenderStates, type CreateDefinedResourceLayoutOptions, type CreateDefinedResourceLayoutResult, type CreateGetComponentForPath, type CreateLayoutBuildingBlocks, type CreateLayoutBuildingBlocksArguments, type CreateLayoutBuildingBlocksResult, type CreateLayoutComposable, type CreateLazyErrorComponent, type CreateLazyRenderState, type CreateRenderState, type CreateRenderStateBuilderArguments, type CreateRenderStateBuilderResult, type CreateRenderStateFromState, type CreateResourceConfigFn, type CreateResourceConfigForResource, type CreateResourceLayoutWithLayoutOptions, type CreateResourceMap, type CreateResourceMapFn, type CreateReusable, type CreateViewMapBuiltInRenderStatesOptions, type CreateViewMapFunctionRenderOptions, type CreateViewMapInlineRenderStatesOptions, type CreateViewMapRenderStatesOptions, type CreatedResourceConfig, type CustomPropsObject, type DeferredRenderState, type DefineLayoutComposables, type DefineLazyDefaults, type DefineResourceLayoutWithLayoutFn, type DefineResourcesFn, type DefinedComposableComponentRecord, type DefinedResourceLayoutInput, type DefinedResourceLayoutWithShell, type ExtractDefinitionValue, type ForPaths, type ForPathsRenderContext, type GetComponentForPath, type InPropsDefinition, type InPropsFunction, type InPropsObject, type InPropsOptions, type IncludedComponentPropDefinitions, type IncludedPropBehavior, type IncludedProps, type InferredInProps, type InvalidComponentContext, InvalidComponentError, type InvalidConfigContext, InvalidConfigError, type InvalidPartContext, InvalidPartError, type InvalidPartTypeContext, InvalidPartTypeError, type InvalidPathContext, InvalidPathError, type InvalidResourceContext, InvalidResourceError, type InvalidSubResourceContext, InvalidSubResourceError, type IsSubResourceKey, LayoutComposablePresetProvider, type LayoutComposablesDefinition, type LayoutComposablesFactory, LayoutConfigurationError, type LayoutConfigurationErrorContext, type LayoutNameCallback, type LayoutNameContext, type LayoutNameFactory, type LayoutNameInput, type LayoutNameOptions, type LayoutNamePartDefinitions, type LayoutNamePartType, type LayoutNamePartValues, type LayoutNameParts, type LayoutNameResolver, type LayoutPreviewProps, type LayoutRenderProps, type LayoutRenderResourcesAccessor, type LayoutResourceKey, type LayoutResourcesAccessor, type LazyDefaultState, type LazyErrorHandlers, type LazyHandle, type LazyOptions, type LazyRenderState, type LazyResourceError, type LazyResourceErrorComponent, type LazyResourceErrorMap, type LazyResourceErrorProps, type LazyResourceLayoutComponent, type LazyResourceLayoutOptions, type LazyResourceLoadingComponent, LazyResourceModuleShapeError, LazyResourceStateNotFoundError, type LazyResourceStates, type LoadStatus, type MakeComposable, type MakeComposableOptions, type MergeIntersection, type MergePresetProps, type MergedLayoutInProps, type MissingPathVariableContext, MissingPathVariableError, MissingResourceProviderError, type NonEmptyResources, type NormalizeResource, type NormalizeResources, type NormalizedResourceDefinition, type NormalizedResourceDefinitions, type ParameterizedResourcePath, type PathVariables, type PresetPropsFromComposable, PropError, type PropErrorOptions, type PropsContextRender, type PropsRenderDefinition, ReactLayoutError, type RenderStateCallProps, type RenderStateCallback, type RenderStateComposablesDefinition, type RenderStateContext, type RenderStateFragment, type RenderStateName, type RenderStateOverloads, type RenderStateProps, type RenderStateReferences, type RenderedPathComponent, type RenderedPathComponentHOF, type RequiredPresetLayoutProps, type RequiredPresetRenderProps, type ResolveLayoutComposables, type ResolveLayoutProps, type ResolveLayoutPropsAsDefined, type ResolveProps, type ResolvedBuiltPropShape, type ResolvedIncludedComponentProps, type ResolvedIncludedConfigProps, type ResolvedIncludedProps, type ResolvedIncludedPropsAsDefined, type ResolvedLayoutName, type ResolvedPathValue, type ResourceConfigFragment, type ResourceDefinition, type ResourceDefinitionValue, type ResourceEnum, type ResourceLayoutComponentProps, type ResourceLayoutProvider, type ResourceLayoutProviderProps, type ResourceLayoutShellComponent, type ResourceLayoutShellProps, type ResourceLayoutShellPublisher, ResourceModuleLoadError, type ResourcePath, ResourceRenderError, type ResourceSelection, type ResourceStateError, type ResourceTree, type ReusableInclude, type ReusableOptionSelection, type ReusableProps, type ScopedComponentRenderFn, type ShellLayoutDefinition, type ShellRenderContext, type Show, type StateComposable, type StateComposableOptions, type TargetPathBuilder, type TypedBuiltInRenderStates, type TypedInlineRenderState, type TypedRenderStateCallback, type UnionToIntersection, collectComposablePresetEntries, createComposableComponent, createDefinedResourceLayout, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, defineComposableComponent, defineLayoutName, defineLayoutPreview, defineResourceLayout, isLazyResourceError, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResourceDefinitions, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|
|
39
|
+
export { type AnyBuiltPropDefinition, type AnyComposableComponent, type AnyRenderStateDefinition, type AsStateComposable, type BaseComponent, type BoundDefineResourceLayout, type BuiltinRenderStateName, type ChildrenRequirement, type ComponentTypes, type ComposableComponent, type ComposableComponentCallable, type ComposableComponents, type ComposableNameContext, type ComposablePresetComponent, type ComposablePresetComponentCallProps, type ComposablePresetMeta, type ComposablePresetProps, type ComposableResourceLayout, type ContextualInlineRenderState, type ContextualInlineRenderStates, type CreateDefinedResourceLayoutOptions, type CreateDefinedResourceLayoutResult, type CreateGetComponentForPath, type CreateLayoutBuildingBlocks, type CreateLayoutBuildingBlocksArguments, type CreateLayoutBuildingBlocksResult, type CreateLayoutComposable, type CreateLazyErrorComponent, type CreateLazyRenderState, type CreateRenderState, type CreateRenderStateBuilderArguments, type CreateRenderStateBuilderResult, type CreateRenderStateFromState, type CreateResourceConfigFn, type CreateResourceConfigForResource, type CreateResourceLayoutWithLayoutOptions, type CreateResourceMap, type CreateResourceMapFn, type CreateReusable, type CreateViewMapBuiltInRenderStatesOptions, type CreateViewMapFunctionRenderOptions, type CreateViewMapInlineRenderStatesOptions, type CreateViewMapRenderStatesOptions, type CreatedResourceConfig, type CustomPropsObject, type DeferredRenderState, type DefineLayoutComposables, type DefineLazyDefaults, type DefineResourceLayoutWithLayoutFn, type DefineResourcesFn, type DefinedComposableComponentRecord, type DefinedResourceLayoutInput, type DefinedResourceLayoutWithShell, type ExtractDefinitionValue, type ForPaths, type ForPathsRenderContext, type GetComponentForPath, type InPropsDefinition, type InPropsFunction, type InPropsObject, type InPropsOptions, type IncludedComponentPropDefinitions, type IncludedPropBehavior, type IncludedProps, type InferredInProps, type InvalidComponentContext, InvalidComponentError, type InvalidConfigContext, InvalidConfigError, type InvalidPartContext, InvalidPartError, type InvalidPartTypeContext, InvalidPartTypeError, type InvalidPathContext, InvalidPathError, type InvalidResourceContext, InvalidResourceError, type InvalidSubResourceContext, InvalidSubResourceError, type IsSubResourceKey, LayoutComposablePresetProvider, type LayoutComposablesDefinition, type LayoutComposablesFactory, LayoutConfigurationError, type LayoutConfigurationErrorContext, type LayoutNameCallback, type LayoutNameContext, type LayoutNameFactory, type LayoutNameInput, type LayoutNameOptions, type LayoutNamePartDefinitions, type LayoutNamePartType, type LayoutNamePartValues, type LayoutNameParts, type LayoutNameResolver, type LayoutPreviewProps, type LayoutRenderProps, type LayoutRenderResourcesAccessor, type LayoutResourceKey, type LayoutResourcesAccessor, type LazyDefaultState, type LazyErrorHandlers, type LazyHandle, type LazyOptions, type LazyRenderState, type LazyResourceError, type LazyResourceErrorComponent, type LazyResourceErrorMap, type LazyResourceErrorProps, type LazyResourceLayoutComponent, type LazyResourceLayoutOptions, type LazyResourceLoadingComponent, LazyResourceModuleShapeError, LazyResourceStateNotFoundError, type LazyResourceStates, type LoadStatus, type MakeComposable, type MakeComposableOptions, type MergeIntersection, type MergePresetProps, type MergedLayoutInProps, type MissingPathVariableContext, MissingPathVariableError, MissingResourceProviderError, type NonEmptyResources, type NormalizeResource, type NormalizeResources, type NormalizedResourceDefinition, type NormalizedResourceDefinitions, type ParameterizedResourcePath, type PathVariables, type PresetPropsFromComposable, PropError, type PropErrorOptions, type PropsContextRender, type PropsContract, type PropsRenderDefinition, ReactLayoutError, type RenderStateCallProps, type RenderStateCallback, type RenderStateComposablesDefinition, type RenderStateContext, type RenderStateFragment, type RenderStateName, type RenderStateOverloads, type RenderStateProps, type RenderStateReferences, type RenderedPathComponent, type RenderedPathComponentHOF, type RequiredPresetLayoutProps, type RequiredPresetRenderProps, type ResolveLayoutComposables, type ResolveLayoutProps, type ResolveLayoutPropsAsDefined, type ResolveProps, type ResolvedBuiltPropShape, type ResolvedIncludedComponentProps, type ResolvedIncludedConfigProps, type ResolvedIncludedProps, type ResolvedIncludedPropsAsDefined, type ResolvedLayoutName, type ResolvedPathValue, type ResourceConfigFragment, type ResourceDefinition, type ResourceDefinitionValue, type ResourceEnum, type ResourceLayoutComponentProps, type ResourceLayoutProvider, type ResourceLayoutProviderProps, type ResourceLayoutShellComponent, type ResourceLayoutShellProps, type ResourceLayoutShellPublisher, ResourceModuleLoadError, type ResourcePath, ResourceRenderError, type ResourceSelection, type ResourceStateError, type ResourceTree, type ReusableArguments, type ReusableDefinition, type ReusableFunction, type ReusableInclude, type ReusableInput, type ReusableOptionSelection, type ReusableOverlap, type ReusableProps, type ReusableResolved, type ReusableResourcesAccessor, type ReusableSelected, type ScopedComponentRenderFn, type ShellLayoutDefinition, type ShellRenderContext, type Show, type SingleResourceInput, type StateComposable, type StateComposableOptions, type TargetPathBuilder, type TypedBuiltInRenderStates, type TypedInlineRenderState, type TypedRenderStateCallback, type UnionToIntersection, collectComposablePresetEntries, createComposableComponent, createDefinedResourceLayout, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, defineComposableComponent, defineLayoutName, defineLayoutPreview, defineResourceLayout, isLazyResourceError, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResourceDefinitions, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|
package/dist/props.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.cjs","names":["LayoutConfigurationError"],"sources":["../src/props.ts"],"sourcesContent":["import type { WithChildren } from '@jfdevelops/react-layout-composables';\nimport type { CustomPropsObject, ResolveRenderProps } from './custom-props';\nimport { LayoutConfigurationError } from './errors';\nimport type {\n ComposableComponents,\n MergePresetProps,\n} from '@jfdevelops/react-layout-composables';\nimport type { InPropsObject } from '@jfdevelops/react-layout-composables';\nimport {\n EnumWrappedProp,\n LiteralWrappedProp,\n ResolveLayoutProps,\n ResolveLayoutPropsAsDefined,\n ResolveProps,\n} from '@jfdevelops/react-layout-validator';\nimport { ResourceDefinition, ResourceEnum } from './resource';\nimport { Show } from './utils';\n\nexport type { InPropsObject };\n\n/**\n * Two-argument `render(props, context)` used by createComponent and scoped\n * resource components. `Context` is sibling components (scoped) or the\n * resource render context (top-level).\n */\nexport type PropsContextRender<RenderProps, Context, Result = unknown> = (\n props: WithChildren<RenderProps>,\n context: Context,\n) => Result;\n\n/**\n * Shared `{ props?, render }` shape used by createComponent, scoped\n * components, and anywhere else a value declares props and a two-arg render.\n *\n * @typeParam Props - Declared on the entry (`props`). Often an\n * {@link InPropsObject}, or a layout include/custom bag.\n * @typeParam RenderProps - First argument to `render` (defaults to\n * {@link ResolveProps}<Props> when Props is an {@link InPropsObject})\n * @typeParam Result - `render` return type\n * @typeParam Context - Second argument to `render`\n */\nexport interface PropsRenderDefinition<\n Props = InPropsObject,\n RenderProps = Props extends InPropsObject ? ResolveProps<Props> : unknown,\n Result = unknown,\n Context = unknown,\n> {\n props?: Props;\n render: PropsContextRender<RenderProps, Context, Result>;\n}\n\nexport type InPropsOptions<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Name extends string,\n> = {\n name: LiteralWrappedProp<Name, 'string', 'required'>;\n resource: EnumWrappedProp<ResourceEnum<Resources>, 'string', 'required'>;\n};\nexport type InPropsFunction<\n Resources extends ReadonlyArray<ResourceDefinition>,\n> = <Name extends string>(\n props: Show<InPropsOptions<Resources, Name>>,\n) => InPropsObject;\nexport type InPropsDefinition<\n Resources extends ReadonlyArray<ResourceDefinition>,\n> = InPropsObject | InPropsFunction<Resources>;\nexport type InferredInProps<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Options extends InPropsDefinition<Resources>,\n> = Options extends InPropsFunction<Resources> ? ReturnType<Options> : Options;\nexport type MergedLayoutInProps<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Options extends InPropsDefinition<Resources>,\n Composables extends ComposableComponents,\n> =\n InferredInProps<Resources, Options> extends InPropsObject\n ? InferredInProps<Resources, Options> & MergePresetProps<Composables>\n : never;\nexport type RequiredVariant = true | 'required';\n/**\n * @typeParam RequiredVariant How the required props are selected. In application code,\n * it will always be `true`, but internally we need to support `'required'` as well.\n */\ntype PropsType<Variant extends RequiredVariant = true> = Variant | 'optional';\ntype InternalPropsType = PropsType<'required'>;\ntype IncludedPropSource = 'component' | 'config';\n/** Controls whether an included prop is required and where it is supplied. */\nexport type IncludedPropBehavior = {\n required: boolean;\n suppliedVia: IncludedPropSource;\n};\n\ntype IncludedPropType = PropsType | IncludedPropBehavior;\n/**\n * A map of props to include in the layout.\n */\nexport type IncludedProps<T extends object> = {\n [K in keyof T & string]?: IncludedPropType;\n};\n\ntype PropsKeys<Props extends InPropsObject, T> = T & keyof Props;\nexport type IncludedPropVisibility<Value> = Value extends { required: boolean }\n ? Value['required'] extends true\n ? 'required'\n : 'optional'\n : Value extends true | 'required'\n ? 'required'\n : Value extends 'optional'\n ? 'optional'\n : never;\nexport type IncludedPropSupplySource<Value> = Value extends {\n suppliedVia: IncludedPropSource;\n}\n ? Value['suppliedVia']\n : never;\n/**\n * Internal representation of the supported include behavior.\n */\nexport type NormalizedIncludedPropBehavior<Value> = Value extends\n | { required: boolean }\n | { suppliedVia: IncludedPropSource }\n ? {\n visibility: IncludedPropVisibility<Value>;\n passthrough: IncludedPropSupplySource<Value>;\n }\n : Value;\n\nexport type IncludedPropPassthrough<Value> = Value extends\n | { required: boolean }\n | { suppliedVia: IncludedPropSource }\n ? IncludedPropSupplySource<Value> extends 'component'\n ? IncludedPropVisibility<Value> extends 'optional'\n ? 'component' | 'config'\n : 'component'\n : IncludedPropSupplySource<Value>\n : Value extends true | 'required'\n ? 'config'\n : Value extends 'optional'\n ? 'component' | 'config'\n : never;\n\ntype GetPropsKey<\n IncludeProps extends object,\n Visibility extends InternalPropsType,\n Passthrough extends IncludedPropSource | 'render' = 'render',\n> = {\n [Key in keyof IncludeProps]: IncludedPropVisibility<\n IncludeProps[Key]\n > extends Visibility\n ? Passthrough extends 'render'\n ? Key\n : Passthrough extends IncludedPropPassthrough<IncludeProps[Key]>\n ? Key\n : never\n : never;\n}[keyof IncludeProps];\ntype SelectedIncludedProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n Visibility extends InternalPropsType,\n Passthrough extends IncludedPropSource | 'render' = 'render',\n> = Pick<\n Props,\n PropsKeys<Props, GetPropsKey<IncludeProps, Visibility, Passthrough>>\n>;\n\ntype OptionalPropDefinition<Definition> = Definition extends {\n optional(): infer OptionalDefinition;\n}\n ? OptionalDefinition\n : Definition;\n\n/** Raw validator definitions accepted by a generated component call. */\nexport type IncludedComponentPropDefinitions<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = SelectedIncludedProps<Props, IncludeProps, 'required', 'component'> & {\n [Key in keyof SelectedIncludedProps<\n Props,\n IncludeProps,\n 'optional',\n 'component'\n >]: OptionalPropDefinition<\n SelectedIncludedProps<Props, IncludeProps, 'optional', 'component'>[Key]\n >;\n};\n\nexport type ResolvedIncludedProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutProps<SelectedIncludedProps<Props, IncludeProps, 'required'>> &\n Partial<\n ResolveLayoutProps<SelectedIncludedProps<Props, IncludeProps, 'optional'>>\n >;\n\nexport type ResolvedIncludedConfigProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'required', 'config'>\n> &\n Partial<\n ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'optional', 'config'>\n >\n >;\n\nexport type ResolvedIncludedComponentProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'required', 'component'>\n> &\n Partial<\n ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'optional', 'component'>\n >\n >;\n\n/**\n * Like {@link ResolvedIncludedProps}, but keeps included prop keys exactly as\n * declared (no `JSX.Element` capitalization).\n */\nexport type ResolvedIncludedPropsAsDefined<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutPropsAsDefined<\n SelectedIncludedProps<Props, IncludeProps, 'required'>\n> &\n Partial<\n ResolveLayoutPropsAsDefined<\n SelectedIncludedProps<Props, IncludeProps, 'optional'>\n >\n >;\nexport type LayoutRenderProps<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Options extends InPropsDefinition<Resources>,\n Composables extends ComposableComponents = {},\n IncludeProps extends IncludedProps<\n MergedLayoutInProps<Resources, Options, Composables>\n > = {},\n CustomProps extends CustomPropsObject = {},\n> = Show<\n ResolveRenderProps<CustomProps> &\n ResolvedIncludedProps<\n MergedLayoutInProps<Resources, Options, Composables>,\n IncludeProps\n >\n>;\n\nexport function getIncludedPropBehavior(value: unknown): {\n visibility: 'required' | 'optional';\n passthrough: 'component' | 'config';\n} | null {\n if (value === null || typeof value !== 'object') {\n return null;\n }\n\n if ('visibility' in value || 'passthrough' in value) {\n throw new LayoutConfigurationError(\n 'Include properties visibility and passthrough were removed; use required and suppliedVia.',\n );\n }\n\n const required =\n 'required' in value && typeof value.required === 'boolean'\n ? value.required\n : undefined;\n const suppliedVia = 'suppliedVia' in value ? value.suppliedVia : undefined;\n\n if (\n required === undefined ||\n (suppliedVia !== 'component' && suppliedVia !== 'config')\n ) {\n return null;\n }\n\n return {\n visibility: required ? 'required' : 'optional',\n passthrough: suppliedVia,\n };\n}\n"],"mappings":";;;AA0PA,SAAgB,wBAAwB,OAG/B;CACP,IAAI,UAAU,QAAQ,OAAO,UAAU,UACrC,OAAO;CAGT,IAAI,gBAAgB,SAAS,iBAAiB,OAC5C,MAAM,IAAIA,4DACR,2FACF;CAGF,MAAM,WACJ,cAAc,SAAS,OAAO,MAAM,aAAa,YAC7C,MAAM,WACN;CACN,MAAM,cAAc,iBAAiB,QAAQ,MAAM,cAAc;CAEjE,IACE,aAAa,UACZ,gBAAgB,eAAe,gBAAgB,UAEhD,OAAO;CAGT,OAAO;EACL,YAAY,WAAW,aAAa;EACpC,aAAa;CACf;AACF"}
|
|
1
|
+
{"version":3,"file":"props.cjs","names":["LayoutConfigurationError"],"sources":["../src/props.ts"],"sourcesContent":["import type { WithChildren } from '@jfdevelops/react-layout-composables';\nimport type { CustomPropsObject, ResolveRenderProps } from './custom-props';\nimport { LayoutConfigurationError } from './errors';\nimport type {\n ComposableComponents,\n MergePresetProps,\n} from '@jfdevelops/react-layout-composables';\nimport type { InPropsObject } from '@jfdevelops/react-layout-composables';\nimport {\n EnumWrappedProp,\n LiteralWrappedProp,\n ResolveLayoutProps,\n ResolveLayoutPropsAsDefined,\n ResolveProps,\n} from '@jfdevelops/react-layout-validator';\nimport { ResourceDefinition, ResourceEnum } from './resource';\nimport { Show } from './utils';\n\nexport type { InPropsObject };\n\n/** Shared include/custom contract used by configurable layout helpers. */\nexport type PropsContract<Include extends object = object, Custom extends object = object> = {\n include?: Include;\n custom?: Custom;\n};\n\n/**\n * Two-argument `render(props, context)` used by createComponent and scoped\n * resource components. `Context` is sibling components (scoped) or the\n * resource render context (top-level).\n */\nexport type PropsContextRender<RenderProps, Context, Result = unknown> = (\n props: WithChildren<RenderProps>,\n context: Context,\n) => Result;\n\n/**\n * Shared `{ props?, render }` shape used by createComponent, scoped\n * components, and anywhere else a value declares props and a two-arg render.\n *\n * @typeParam Props - Declared on the entry (`props`). Often an\n * {@link InPropsObject}, or a layout include/custom bag.\n * @typeParam RenderProps - First argument to `render` (defaults to\n * {@link ResolveProps}<Props> when Props is an {@link InPropsObject})\n * @typeParam Result - `render` return type\n * @typeParam Context - Second argument to `render`\n */\nexport interface PropsRenderDefinition<\n Props = InPropsObject,\n RenderProps = Props extends InPropsObject ? ResolveProps<Props> : unknown,\n Result = unknown,\n Context = unknown,\n> {\n props?: Props;\n render: PropsContextRender<RenderProps, Context, Result>;\n}\n\nexport type InPropsOptions<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Name extends string,\n> = {\n name: LiteralWrappedProp<Name, 'string', 'required'>;\n resource: EnumWrappedProp<ResourceEnum<Resources>, 'string', 'required'>;\n};\nexport type InPropsFunction<\n Resources extends ReadonlyArray<ResourceDefinition>,\n> = <Name extends string>(\n props: Show<InPropsOptions<Resources, Name>>,\n) => InPropsObject;\nexport type InPropsDefinition<\n Resources extends ReadonlyArray<ResourceDefinition>,\n> = InPropsObject | InPropsFunction<Resources>;\nexport type InferredInProps<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Options extends InPropsDefinition<Resources>,\n> = Options extends InPropsFunction<Resources> ? ReturnType<Options> : Options;\nexport type MergedLayoutInProps<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Options extends InPropsDefinition<Resources>,\n Composables extends ComposableComponents,\n> =\n InferredInProps<Resources, Options> extends InPropsObject\n ? InferredInProps<Resources, Options> & MergePresetProps<Composables>\n : never;\nexport type RequiredVariant = true | 'required';\n/**\n * @typeParam RequiredVariant How the required props are selected. In application code,\n * it will always be `true`, but internally we need to support `'required'` as well.\n */\ntype PropsType<Variant extends RequiredVariant = true> = Variant | 'optional';\ntype InternalPropsType = PropsType<'required'>;\ntype IncludedPropSource = 'component' | 'config';\n/** Controls whether an included prop is required and where it is supplied. */\nexport type IncludedPropBehavior = {\n required: boolean;\n suppliedVia: IncludedPropSource;\n};\n\ntype IncludedPropType = PropsType | IncludedPropBehavior;\n/**\n * A map of props to include in the layout.\n */\nexport type IncludedProps<T extends object> = {\n [K in keyof T & string]?: IncludedPropType;\n};\n\ntype PropsKeys<Props extends InPropsObject, T> = T & keyof Props;\nexport type IncludedPropVisibility<Value> = Value extends { required: boolean }\n ? Value['required'] extends true\n ? 'required'\n : 'optional'\n : Value extends true | 'required'\n ? 'required'\n : Value extends 'optional'\n ? 'optional'\n : never;\nexport type IncludedPropSupplySource<Value> = Value extends {\n suppliedVia: IncludedPropSource;\n}\n ? Value['suppliedVia']\n : never;\n/**\n * Internal representation of the supported include behavior.\n */\nexport type NormalizedIncludedPropBehavior<Value> = Value extends\n | { required: boolean }\n | { suppliedVia: IncludedPropSource }\n ? {\n visibility: IncludedPropVisibility<Value>;\n passthrough: IncludedPropSupplySource<Value>;\n }\n : Value;\n\nexport type IncludedPropPassthrough<Value> = Value extends\n | { required: boolean }\n | { suppliedVia: IncludedPropSource }\n ? IncludedPropSupplySource<Value> extends 'component'\n ? IncludedPropVisibility<Value> extends 'optional'\n ? 'component' | 'config'\n : 'component'\n : IncludedPropSupplySource<Value>\n : Value extends true | 'required'\n ? 'config'\n : Value extends 'optional'\n ? 'component' | 'config'\n : never;\n\ntype GetPropsKey<\n IncludeProps extends object,\n Visibility extends InternalPropsType,\n Passthrough extends IncludedPropSource | 'render' = 'render',\n> = {\n [Key in keyof IncludeProps]: IncludedPropVisibility<\n IncludeProps[Key]\n > extends Visibility\n ? Passthrough extends 'render'\n ? Key\n : Passthrough extends IncludedPropPassthrough<IncludeProps[Key]>\n ? Key\n : never\n : never;\n}[keyof IncludeProps];\ntype SelectedIncludedProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n Visibility extends InternalPropsType,\n Passthrough extends IncludedPropSource | 'render' = 'render',\n> = Pick<\n Props,\n PropsKeys<Props, GetPropsKey<IncludeProps, Visibility, Passthrough>>\n>;\n\ntype OptionalPropDefinition<Definition> = Definition extends {\n optional(): infer OptionalDefinition;\n}\n ? OptionalDefinition\n : Definition;\n\n/** Raw validator definitions accepted by a generated component call. */\nexport type IncludedComponentPropDefinitions<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = SelectedIncludedProps<Props, IncludeProps, 'required', 'component'> & {\n [Key in keyof SelectedIncludedProps<\n Props,\n IncludeProps,\n 'optional',\n 'component'\n >]: OptionalPropDefinition<\n SelectedIncludedProps<Props, IncludeProps, 'optional', 'component'>[Key]\n >;\n};\n\nexport type ResolvedIncludedProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutProps<SelectedIncludedProps<Props, IncludeProps, 'required'>> &\n Partial<\n ResolveLayoutProps<SelectedIncludedProps<Props, IncludeProps, 'optional'>>\n >;\n\nexport type ResolvedIncludedConfigProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'required', 'config'>\n> &\n Partial<\n ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'optional', 'config'>\n >\n >;\n\nexport type ResolvedIncludedComponentProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'required', 'component'>\n> &\n Partial<\n ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'optional', 'component'>\n >\n >;\n\n/**\n * Like {@link ResolvedIncludedProps}, but keeps included prop keys exactly as\n * declared (no `JSX.Element` capitalization).\n */\nexport type ResolvedIncludedPropsAsDefined<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutPropsAsDefined<\n SelectedIncludedProps<Props, IncludeProps, 'required'>\n> &\n Partial<\n ResolveLayoutPropsAsDefined<\n SelectedIncludedProps<Props, IncludeProps, 'optional'>\n >\n >;\nexport type LayoutRenderProps<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Options extends InPropsDefinition<Resources>,\n Composables extends ComposableComponents = {},\n IncludeProps extends IncludedProps<\n MergedLayoutInProps<Resources, Options, Composables>\n > = {},\n CustomProps extends CustomPropsObject = {},\n> = Show<\n ResolveRenderProps<CustomProps> &\n ResolvedIncludedProps<\n MergedLayoutInProps<Resources, Options, Composables>,\n IncludeProps\n >\n>;\n\nexport function getIncludedPropBehavior(value: unknown): {\n visibility: 'required' | 'optional';\n passthrough: 'component' | 'config';\n} | null {\n if (value === null || typeof value !== 'object') {\n return null;\n }\n\n if ('visibility' in value || 'passthrough' in value) {\n throw new LayoutConfigurationError(\n 'Include properties visibility and passthrough were removed; use required and suppliedVia.',\n );\n }\n\n const required =\n 'required' in value && typeof value.required === 'boolean'\n ? value.required\n : undefined;\n const suppliedVia = 'suppliedVia' in value ? value.suppliedVia : undefined;\n\n if (\n required === undefined ||\n (suppliedVia !== 'component' && suppliedVia !== 'config')\n ) {\n return null;\n }\n\n return {\n visibility: required ? 'required' : 'optional',\n passthrough: suppliedVia,\n };\n}\n"],"mappings":";;;AAgQA,SAAgB,wBAAwB,OAG/B;CACP,IAAI,UAAU,QAAQ,OAAO,UAAU,UACrC,OAAO;CAGT,IAAI,gBAAgB,SAAS,iBAAiB,OAC5C,MAAM,IAAIA,4DACR,2FACF;CAGF,MAAM,WACJ,cAAc,SAAS,OAAO,MAAM,aAAa,YAC7C,MAAM,WACN;CACN,MAAM,cAAc,iBAAiB,QAAQ,MAAM,cAAc;CAEjE,IACE,aAAa,UACZ,gBAAgB,eAAe,gBAAgB,UAEhD,OAAO;CAGT,OAAO;EACL,YAAY,WAAW,aAAa;EACpC,aAAa;CACf;AACF"}
|
package/dist/props.d.cts
CHANGED
|
@@ -5,6 +5,11 @@ import { ComposableComponents, InPropsObject, MergePresetProps, WithChildren } f
|
|
|
5
5
|
import { EnumWrappedProp, LiteralWrappedProp, ResolveLayoutProps, ResolveLayoutPropsAsDefined, ResolveProps } from "@jfdevelops/react-layout-validator";
|
|
6
6
|
|
|
7
7
|
//#region src/props.d.ts
|
|
8
|
+
/** Shared include/custom contract used by configurable layout helpers. */
|
|
9
|
+
type PropsContract<Include extends object = object, Custom extends object = object> = {
|
|
10
|
+
include?: Include;
|
|
11
|
+
custom?: Custom;
|
|
12
|
+
};
|
|
8
13
|
/**
|
|
9
14
|
* Two-argument `render(props, context)` used by createComponent and scoped
|
|
10
15
|
* resource components. `Context` is sibling components (scoped) or the
|
|
@@ -92,5 +97,5 @@ type ResolvedIncludedComponentProps<Props extends InPropsObject, IncludeProps ex
|
|
|
92
97
|
type ResolvedIncludedPropsAsDefined<Props extends InPropsObject, IncludeProps extends IncludedProps<Props>> = ResolveLayoutPropsAsDefined<SelectedIncludedProps<Props, IncludeProps, 'required'>> & Partial<ResolveLayoutPropsAsDefined<SelectedIncludedProps<Props, IncludeProps, 'optional'>>>;
|
|
93
98
|
type LayoutRenderProps<Resources extends ReadonlyArray<ResourceDefinition>, Options extends InPropsDefinition<Resources>, Composables extends ComposableComponents = {}, IncludeProps extends IncludedProps<MergedLayoutInProps<Resources, Options, Composables>> = {}, CustomProps extends CustomPropsObject = {}> = Show<ResolveRenderProps<CustomProps> & ResolvedIncludedProps<MergedLayoutInProps<Resources, Options, Composables>, IncludeProps>>;
|
|
94
99
|
//#endregion
|
|
95
|
-
export { InPropsDefinition, InPropsFunction, type InPropsObject, InPropsOptions, IncludedComponentPropDefinitions, IncludedPropBehavior, IncludedProps, InferredInProps, LayoutRenderProps, MergedLayoutInProps, NormalizedIncludedPropBehavior, PropsContextRender, PropsRenderDefinition, ResolvedIncludedComponentProps, ResolvedIncludedConfigProps, ResolvedIncludedProps, ResolvedIncludedPropsAsDefined };
|
|
100
|
+
export { InPropsDefinition, InPropsFunction, type InPropsObject, InPropsOptions, IncludedComponentPropDefinitions, IncludedPropBehavior, IncludedProps, InferredInProps, LayoutRenderProps, MergedLayoutInProps, NormalizedIncludedPropBehavior, PropsContextRender, PropsContract, PropsRenderDefinition, ResolvedIncludedComponentProps, ResolvedIncludedConfigProps, ResolvedIncludedProps, ResolvedIncludedPropsAsDefined };
|
|
96
101
|
//# sourceMappingURL=props.d.cts.map
|
package/dist/props.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.cts","names":[],"sources":["../src/props.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"props.d.cts","names":[],"sources":["../src/props.ts"],"mappings":";;;;;;;;KAqBY,aAAA;EACV,OAAA,GAAU,OAAA;EACV,MAAA,GAAS,MAAM;AAAA;;;;;;KAQL,kBAAA,4CACV,KAAA,EAAO,YAAA,CAAa,WAAA,GACpB,OAAA,EAAS,OAAA,KACN,MAAA;AAHL;;;;;;;;;;;AAAA,UAgBiB,qBAAA,SACP,aAAA,iBACM,KAAA,SAAc,aAAA,GAAgB,YAAA,CAAa,KAAA;EAIzD,KAAA,GAAQ,KAAA;EACR,MAAA,EAAQ,kBAAA,CAAmB,WAAA,EAAa,OAAA,EAAS,MAAA;AAAA;AAAA,KAGvC,cAAA,mBACQ,aAAA,CAAc,kBAAA;EAGhC,IAAA,EAAM,kBAAA,CAAmB,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AAO,YAAA;AAAA,KAIvB,8BAAA,eACI,aAAA,uBACO,aAAA,CAAc,KAAA,KACjC,kBAAA,CACF,qBAAA,CAAsB,KAAA,EAAO,YAAA,8BAE7B,OAAA,CACE,kBAAA,CACE,qBAAA,CAAsB,KAAA,EAAO,YAAA;;;;;KAQvB,8BAAA,eACI,aAAA,uBACO,aAAA,CAAc,KAAA,KACjC,2BAAA,CACF,qBAAA,CAAsB,KAAA,EAAO,YAAA,iBAE7B,OAAA,CACE,2BAAA,CACE,qBAAA,CAAsB,KAAA,EAAO,YAAA;AAAA,KAGvB,iBAAA,mBACQ,aAAA,CAAc,kBAAA,mBAChB,iBAAA,CAAkB,SAAA,uBACd,oBAAA,4BACC,aAAA,CACnB,mBAAA,CAAoB,SAAA,EAAW,OAAA,EAAS,WAAA,6BAEtB,iBAAA,SAClB,IAAA,CACF,kBAAA,CAAmB,WAAA,IACjB,qBAAA,CACE,mBAAA,CAAoB,SAAA,EAAW,OAAA,EAAS,WAAA,GACxC,YAAA"}
|
package/dist/props.d.mts
CHANGED
|
@@ -5,6 +5,11 @@ import { ComposableComponents, InPropsObject, MergePresetProps, WithChildren } f
|
|
|
5
5
|
import { EnumWrappedProp, LiteralWrappedProp, ResolveLayoutProps, ResolveLayoutPropsAsDefined, ResolveProps } from "@jfdevelops/react-layout-validator";
|
|
6
6
|
|
|
7
7
|
//#region src/props.d.ts
|
|
8
|
+
/** Shared include/custom contract used by configurable layout helpers. */
|
|
9
|
+
type PropsContract<Include extends object = object, Custom extends object = object> = {
|
|
10
|
+
include?: Include;
|
|
11
|
+
custom?: Custom;
|
|
12
|
+
};
|
|
8
13
|
/**
|
|
9
14
|
* Two-argument `render(props, context)` used by createComponent and scoped
|
|
10
15
|
* resource components. `Context` is sibling components (scoped) or the
|
|
@@ -92,5 +97,5 @@ type ResolvedIncludedComponentProps<Props extends InPropsObject, IncludeProps ex
|
|
|
92
97
|
type ResolvedIncludedPropsAsDefined<Props extends InPropsObject, IncludeProps extends IncludedProps<Props>> = ResolveLayoutPropsAsDefined<SelectedIncludedProps<Props, IncludeProps, 'required'>> & Partial<ResolveLayoutPropsAsDefined<SelectedIncludedProps<Props, IncludeProps, 'optional'>>>;
|
|
93
98
|
type LayoutRenderProps<Resources extends ReadonlyArray<ResourceDefinition>, Options extends InPropsDefinition<Resources>, Composables extends ComposableComponents = {}, IncludeProps extends IncludedProps<MergedLayoutInProps<Resources, Options, Composables>> = {}, CustomProps extends CustomPropsObject = {}> = Show<ResolveRenderProps<CustomProps> & ResolvedIncludedProps<MergedLayoutInProps<Resources, Options, Composables>, IncludeProps>>;
|
|
94
99
|
//#endregion
|
|
95
|
-
export { InPropsDefinition, InPropsFunction, type InPropsObject, InPropsOptions, IncludedComponentPropDefinitions, IncludedPropBehavior, IncludedProps, InferredInProps, LayoutRenderProps, MergedLayoutInProps, NormalizedIncludedPropBehavior, PropsContextRender, PropsRenderDefinition, ResolvedIncludedComponentProps, ResolvedIncludedConfigProps, ResolvedIncludedProps, ResolvedIncludedPropsAsDefined };
|
|
100
|
+
export { InPropsDefinition, InPropsFunction, type InPropsObject, InPropsOptions, IncludedComponentPropDefinitions, IncludedPropBehavior, IncludedProps, InferredInProps, LayoutRenderProps, MergedLayoutInProps, NormalizedIncludedPropBehavior, PropsContextRender, PropsContract, PropsRenderDefinition, ResolvedIncludedComponentProps, ResolvedIncludedConfigProps, ResolvedIncludedProps, ResolvedIncludedPropsAsDefined };
|
|
96
101
|
//# sourceMappingURL=props.d.mts.map
|