@jfdevelops/react-layout 0.22.0 → 0.23.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-resource-links.cjs +42 -22
- package/dist/create-config/create-resource-links.cjs.map +1 -1
- package/dist/create-config/create-resource-links.d.cts +25 -2
- package/dist/create-config/create-resource-links.d.cts.map +1 -1
- package/dist/create-config/create-resource-links.d.mts +25 -2
- package/dist/create-config/create-resource-links.d.mts.map +1 -1
- package/dist/create-config/create-resource-links.mjs +43 -22
- package/dist/create-config/create-resource-links.mjs.map +1 -1
- package/dist/create-config/define-layout.cjs +29 -9
- package/dist/create-config/define-layout.cjs.map +1 -1
- package/dist/create-config/define-layout.d.cts +13 -1
- package/dist/create-config/define-layout.d.cts.map +1 -1
- package/dist/create-config/define-layout.d.mts +13 -1
- package/dist/create-config/define-layout.d.mts.map +1 -1
- package/dist/create-config/define-layout.mjs +30 -10
- package/dist/create-config/define-layout.mjs.map +1 -1
- package/dist/create-config/for-paths/builder.cjs +6 -6
- package/dist/create-config/for-paths/builder.cjs.map +1 -1
- package/dist/create-config/for-paths/builder.mjs +6 -6
- package/dist/create-config/for-paths/builder.mjs.map +1 -1
- package/dist/create-config/for-resource.cjs +2 -1
- package/dist/create-config/for-resource.cjs.map +1 -1
- package/dist/create-config/for-resource.d.cts.map +1 -1
- package/dist/create-config/for-resource.d.mts.map +1 -1
- package/dist/create-config/for-resource.mjs +2 -1
- package/dist/create-config/for-resource.mjs.map +1 -1
- package/dist/create-config/for-resources/create-for-resources.cjs +15 -14
- package/dist/create-config/for-resources/create-for-resources.cjs.map +1 -1
- package/dist/create-config/for-resources/create-for-resources.mjs +15 -14
- package/dist/create-config/for-resources/create-for-resources.mjs.map +1 -1
- package/dist/create-config/index.d.cts +2 -2
- package/dist/create-config/index.d.mts +2 -2
- package/dist/errors/invalid-component.cjs +15 -7
- package/dist/errors/invalid-component.cjs.map +1 -1
- package/dist/errors/invalid-component.d.cts +106 -10
- package/dist/errors/invalid-component.d.cts.map +1 -1
- package/dist/errors/invalid-component.d.mts +106 -10
- package/dist/errors/invalid-component.d.mts.map +1 -1
- package/dist/errors/invalid-component.mjs +15 -7
- package/dist/errors/invalid-component.mjs.map +1 -1
- package/dist/errors/invalid-config.cjs +8 -3
- package/dist/errors/invalid-config.cjs.map +1 -1
- package/dist/errors/invalid-config.d.cts +96 -6
- package/dist/errors/invalid-config.d.cts.map +1 -1
- package/dist/errors/invalid-config.d.mts +96 -6
- package/dist/errors/invalid-config.d.mts.map +1 -1
- package/dist/errors/invalid-config.mjs +8 -3
- package/dist/errors/invalid-config.mjs.map +1 -1
- package/dist/errors/invalid-path.cjs +11 -5
- package/dist/errors/invalid-path.cjs.map +1 -1
- package/dist/errors/invalid-path.d.cts +100 -8
- package/dist/errors/invalid-path.d.cts.map +1 -1
- package/dist/errors/invalid-path.d.mts +100 -8
- package/dist/errors/invalid-path.d.mts.map +1 -1
- package/dist/errors/invalid-path.mjs +11 -5
- package/dist/errors/invalid-path.mjs.map +1 -1
- package/dist/errors/invalid-resource.cjs +11 -5
- package/dist/errors/invalid-resource.cjs.map +1 -1
- package/dist/errors/invalid-resource.d.cts +100 -8
- package/dist/errors/invalid-resource.d.cts.map +1 -1
- package/dist/errors/invalid-resource.d.mts +100 -8
- package/dist/errors/invalid-resource.d.mts.map +1 -1
- package/dist/errors/invalid-resource.mjs +11 -5
- package/dist/errors/invalid-resource.mjs.map +1 -1
- package/dist/errors/invalid-sub-resource.cjs +12 -5
- package/dist/errors/invalid-sub-resource.cjs.map +1 -1
- package/dist/errors/invalid-sub-resource.d.cts +103 -9
- package/dist/errors/invalid-sub-resource.d.cts.map +1 -1
- package/dist/errors/invalid-sub-resource.d.mts +103 -9
- package/dist/errors/invalid-sub-resource.d.mts.map +1 -1
- package/dist/errors/invalid-sub-resource.mjs +12 -5
- package/dist/errors/invalid-sub-resource.mjs.map +1 -1
- package/dist/errors/layout-configuration-error.cjs +17 -0
- package/dist/errors/layout-configuration-error.cjs.map +1 -0
- package/dist/errors/layout-configuration-error.d.cts +99 -0
- package/dist/errors/layout-configuration-error.d.cts.map +1 -0
- package/dist/errors/layout-configuration-error.d.mts +99 -0
- package/dist/errors/layout-configuration-error.d.mts.map +1 -0
- package/dist/errors/layout-configuration-error.mjs +17 -0
- package/dist/errors/layout-configuration-error.mjs.map +1 -0
- package/dist/errors/missing-path-variable.cjs +12 -5
- package/dist/errors/missing-path-variable.cjs.map +1 -1
- package/dist/errors/missing-path-variable.d.cts +99 -7
- package/dist/errors/missing-path-variable.d.cts.map +1 -1
- package/dist/errors/missing-path-variable.d.mts +99 -7
- package/dist/errors/missing-path-variable.d.mts.map +1 -1
- package/dist/errors/missing-path-variable.mjs +12 -5
- package/dist/errors/missing-path-variable.mjs.map +1 -1
- package/dist/errors/missing-resource-provider.cjs +12 -0
- package/dist/errors/missing-resource-provider.cjs.map +1 -0
- package/dist/errors/missing-resource-provider.d.cts +91 -0
- package/dist/errors/missing-resource-provider.d.cts.map +1 -0
- package/dist/errors/missing-resource-provider.d.mts +91 -0
- package/dist/errors/missing-resource-provider.d.mts.map +1 -0
- package/dist/errors/missing-resource-provider.mjs +12 -0
- package/dist/errors/missing-resource-provider.mjs.map +1 -0
- package/dist/errors/react-layout-error.cjs +38 -43
- package/dist/errors/react-layout-error.cjs.map +1 -1
- package/dist/errors/react-layout-error.d.cts +81 -38
- package/dist/errors/react-layout-error.d.cts.map +1 -1
- package/dist/errors/react-layout-error.d.mts +81 -38
- package/dist/errors/react-layout-error.d.mts.map +1 -1
- package/dist/errors/react-layout-error.mjs +39 -43
- package/dist/errors/react-layout-error.mjs.map +1 -1
- package/dist/index.cjs +6 -3
- package/dist/index.d.cts +6 -3
- package/dist/index.d.mts +6 -3
- package/dist/index.mjs +6 -4
- package/dist/node_modules/.pnpm/@jfdevelops_create-error@0.2.0_patch_hash_afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.d.cts +107 -0
- package/dist/node_modules/.pnpm/@jfdevelops_create-error@0.2.0_patch_hash_afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/@jfdevelops_create-error@0.2.0_patch_hash_afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.d.mts +107 -0
- package/dist/node_modules/.pnpm/@jfdevelops_create-error@0.2.0_patch_hash_afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.d.mts.map +1 -0
- package/dist/resource.cjs +2 -1
- package/dist/resource.cjs.map +1 -1
- package/dist/resource.d.cts.map +1 -1
- package/dist/resource.d.mts.map +1 -1
- package/dist/resource.mjs +3 -1
- package/dist/resource.mjs.map +1 -1
- package/package.json +8 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invalid-component.cjs","names":["createReactLayoutError"],"sources":["../../src/errors/invalid-component.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"invalid-component.cjs","names":["createReactLayoutError"],"sources":["../../src/errors/invalid-component.ts"],"sourcesContent":["import { type } from 'arktype';\nimport { createReactLayoutError } from './react-layout-error';\n\nconst context = type({\n component: 'unknown',\n 'path?': 'string',\n 'reason?': 'string',\n 'resource?': 'string',\n scope: \"'component'\",\n 'validComponents?': 'string[]',\n});\n\nexport type InvalidComponentContext = typeof context.infer;\n\n/** Thrown when a requested component slot cannot be resolved. */\nexport class InvalidComponentError extends createReactLayoutError({\n code: 'invalidComponent',\n scope: 'component',\n})\n .defineContext(context)\n .implement(({ context, scope }) => {\n const quotedComponent =\n JSON.stringify(context.component) ?? `\"${String(context.component)}\"`;\n const locationParts = [\n context.path ? `path \"${context.path}\"` : undefined,\n context.resource ? `resource \"${context.resource}\"` : undefined,\n ].filter((part): part is string => part !== undefined);\n const locationMessage =\n locationParts.length > 0 ? ` for ${locationParts.join(' and ')}` : '';\n const body =\n context.reason ??\n `Component slot ${quotedComponent}${locationMessage} is not configured.`;\n const validComponentsMessage =\n context.validComponents && context.validComponents.length > 0\n ? ` Available component slots are ${new Intl.ListFormat('en', {\n style: 'long',\n type: 'disjunction',\n }).format(context.validComponents)}.`\n : '';\n\n return `[${scope}]: ${body}${validComponentsMessage}`;\n }) {}\n"],"mappings":";;;;AAGA,MAAM,4BAAe;CACnB,WAAW;CACX,SAAS;CACT,WAAW;CACX,aAAa;CACb,OAAO;CACP,oBAAoB;AACtB,CAAC;;AAKD,IAAa,wBAAb,cAA2CA,kDAAuB;CAChE,MAAM;CACN,OAAO;AACT,CAAC,EACE,cAAc,OAAO,EACrB,WAAW,EAAE,SAAS,YAAY;CACjC,MAAM,kBACJ,KAAK,UAAU,QAAQ,SAAS,KAAK,IAAI,OAAO,QAAQ,SAAS,EAAE;CACrE,MAAM,gBAAgB,CACpB,QAAQ,OAAO,SAAS,QAAQ,KAAK,KAAK,QAC1C,QAAQ,WAAW,aAAa,QAAQ,SAAS,KAAK,MACxD,EAAE,QAAQ,SAAyB,SAAS,MAAS;CACrD,MAAM,kBACJ,cAAc,SAAS,IAAI,QAAQ,cAAc,KAAK,OAAO,MAAM;CAYrE,OAAO,IAAI,MAAM,KAVf,QAAQ,UACR,kBAAkB,kBAAkB,gBAAgB,uBAEpD,QAAQ,mBAAmB,QAAQ,gBAAgB,SAAS,IACxD,kCAAkC,IAAI,KAAK,WAAW,MAAM;EAC1D,OAAO;EACP,MAAM;CACR,CAAC,EAAE,OAAO,QAAQ,eAAe,EAAE,KACnC;AAGR,CAAC,EAAE,CAAC"}
|
|
@@ -1,16 +1,112 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ImplementedErrorClass } from "../node_modules/.pnpm/@jfdevelops_create-error@0.2.0_patch_hash_afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/errors/invalid-component.d.ts
|
|
4
|
-
declare const
|
|
5
|
-
/** Context describing an invalid or unconfigured component slot. */
|
|
6
|
-
interface InvalidComponentContext extends ReactLayoutErrorContext<typeof scope> {
|
|
4
|
+
declare const context: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
7
5
|
component: unknown;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
scope: "component";
|
|
7
|
+
path?: string | undefined;
|
|
8
|
+
reason?: string | undefined;
|
|
9
|
+
resource?: string | undefined;
|
|
10
|
+
validComponents?: string[] | undefined;
|
|
11
|
+
}, {}>;
|
|
12
|
+
type InvalidComponentContext = typeof context.infer;
|
|
13
|
+
declare const InvalidComponentError_base: ImplementedErrorClass<{
|
|
14
|
+
definition: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
15
|
+
code: string;
|
|
16
|
+
scope: string;
|
|
17
|
+
}, {}>;
|
|
18
|
+
} & {
|
|
19
|
+
data: {
|
|
20
|
+
readonly property: "context";
|
|
21
|
+
readonly resolve: ({
|
|
22
|
+
definition,
|
|
23
|
+
input
|
|
24
|
+
}: import("@jfdevelops/create-error/types").ResolveContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
25
|
+
code: string;
|
|
26
|
+
scope: string;
|
|
27
|
+
}, {}>>) => {
|
|
28
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
message: ({
|
|
32
|
+
definition,
|
|
33
|
+
data,
|
|
34
|
+
implementation
|
|
35
|
+
}: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
36
|
+
code: string;
|
|
37
|
+
scope: string;
|
|
38
|
+
}, {}>>) => string & import("@jfdevelops/create-error/types").TypeSlot<"implementationArgument", {
|
|
39
|
+
readonly context: import("@jfdevelops/create-error/types").DataSlot;
|
|
40
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
41
|
+
}>;
|
|
42
|
+
} & {
|
|
43
|
+
properties(context: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
44
|
+
code: string;
|
|
45
|
+
scope: string;
|
|
46
|
+
}, {}>>): {
|
|
47
|
+
readonly code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
48
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
49
|
+
readonly renderMessage: (renderer?: (scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">, context: import("@jfdevelops/create-error/types").DataSlot) => string) => string;
|
|
50
|
+
};
|
|
51
|
+
} & {
|
|
52
|
+
toJSON(error: import("@jfdevelops/create-error/types").BlueprintErrorTemplate<NoInfer<{
|
|
53
|
+
data: {
|
|
54
|
+
readonly property: "context";
|
|
55
|
+
readonly resolve: ({
|
|
56
|
+
definition,
|
|
57
|
+
input
|
|
58
|
+
}: import("@jfdevelops/create-error/types").ResolveContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
59
|
+
code: string;
|
|
60
|
+
scope: string;
|
|
61
|
+
}, {}>>) => {
|
|
62
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
message: ({
|
|
66
|
+
definition,
|
|
67
|
+
data,
|
|
68
|
+
implementation
|
|
69
|
+
}: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
70
|
+
code: string;
|
|
71
|
+
scope: string;
|
|
72
|
+
}, {}>>) => string & import("@jfdevelops/create-error/types").TypeSlot<"implementationArgument", {
|
|
73
|
+
readonly context: import("@jfdevelops/create-error/types").DataSlot;
|
|
74
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
75
|
+
}>;
|
|
76
|
+
} & {
|
|
77
|
+
properties(context: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
78
|
+
code: string;
|
|
79
|
+
scope: string;
|
|
80
|
+
}, {}>>): {
|
|
81
|
+
readonly code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
82
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
83
|
+
readonly renderMessage: (renderer?: (scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">, context: import("@jfdevelops/create-error/types").DataSlot) => string) => string;
|
|
84
|
+
};
|
|
85
|
+
}>>): {
|
|
86
|
+
name: string;
|
|
87
|
+
code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
88
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
89
|
+
message: string;
|
|
90
|
+
context: unknown;
|
|
91
|
+
};
|
|
92
|
+
}, {
|
|
93
|
+
readonly code: string;
|
|
94
|
+
readonly scope: string;
|
|
95
|
+
}, {
|
|
96
|
+
component: unknown;
|
|
97
|
+
scope: "component";
|
|
98
|
+
path?: string | undefined;
|
|
99
|
+
reason?: string | undefined;
|
|
100
|
+
resource?: string | undefined;
|
|
101
|
+
validComponents?: string[] | undefined;
|
|
102
|
+
}, {
|
|
103
|
+
component: unknown;
|
|
104
|
+
scope: "component";
|
|
105
|
+
path?: string | undefined;
|
|
106
|
+
reason?: string | undefined;
|
|
107
|
+
resource?: string | undefined;
|
|
108
|
+
validComponents?: string[] | undefined;
|
|
109
|
+
}>;
|
|
14
110
|
/** Thrown when a requested component slot cannot be resolved. */
|
|
15
111
|
declare class InvalidComponentError extends InvalidComponentError_base {}
|
|
16
112
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invalid-component.d.cts","names":[],"sources":["../../src/errors/invalid-component.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"invalid-component.d.cts","names":[],"sources":["../../src/errors/invalid-component.ts"],"mappings":";;;cAGM,OAAA,gDAAO,UAAA;;;;;;;;KASD,uBAAA,UAAiC,OAAA,CAAQ,KAAK;AAAA,cAAC,0BAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAG9C,qBAAA,SAA8B,0BA0BvC"}
|
|
@@ -1,16 +1,112 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ImplementedErrorClass } from "../node_modules/.pnpm/@jfdevelops_create-error@0.2.0_patch_hash_afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/errors/invalid-component.d.ts
|
|
4
|
-
declare const
|
|
5
|
-
/** Context describing an invalid or unconfigured component slot. */
|
|
6
|
-
interface InvalidComponentContext extends ReactLayoutErrorContext<typeof scope> {
|
|
4
|
+
declare const context: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
7
5
|
component: unknown;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
scope: "component";
|
|
7
|
+
path?: string | undefined;
|
|
8
|
+
reason?: string | undefined;
|
|
9
|
+
resource?: string | undefined;
|
|
10
|
+
validComponents?: string[] | undefined;
|
|
11
|
+
}, {}>;
|
|
12
|
+
type InvalidComponentContext = typeof context.infer;
|
|
13
|
+
declare const InvalidComponentError_base: ImplementedErrorClass<{
|
|
14
|
+
definition: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
15
|
+
code: string;
|
|
16
|
+
scope: string;
|
|
17
|
+
}, {}>;
|
|
18
|
+
} & {
|
|
19
|
+
data: {
|
|
20
|
+
readonly property: "context";
|
|
21
|
+
readonly resolve: ({
|
|
22
|
+
definition,
|
|
23
|
+
input
|
|
24
|
+
}: import("@jfdevelops/create-error/types").ResolveContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
25
|
+
code: string;
|
|
26
|
+
scope: string;
|
|
27
|
+
}, {}>>) => {
|
|
28
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
message: ({
|
|
32
|
+
definition,
|
|
33
|
+
data,
|
|
34
|
+
implementation
|
|
35
|
+
}: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
36
|
+
code: string;
|
|
37
|
+
scope: string;
|
|
38
|
+
}, {}>>) => string & import("@jfdevelops/create-error/types").TypeSlot<"implementationArgument", {
|
|
39
|
+
readonly context: import("@jfdevelops/create-error/types").DataSlot;
|
|
40
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
41
|
+
}>;
|
|
42
|
+
} & {
|
|
43
|
+
properties(context: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
44
|
+
code: string;
|
|
45
|
+
scope: string;
|
|
46
|
+
}, {}>>): {
|
|
47
|
+
readonly code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
48
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
49
|
+
readonly renderMessage: (renderer?: (scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">, context: import("@jfdevelops/create-error/types").DataSlot) => string) => string;
|
|
50
|
+
};
|
|
51
|
+
} & {
|
|
52
|
+
toJSON(error: import("@jfdevelops/create-error/types").BlueprintErrorTemplate<NoInfer<{
|
|
53
|
+
data: {
|
|
54
|
+
readonly property: "context";
|
|
55
|
+
readonly resolve: ({
|
|
56
|
+
definition,
|
|
57
|
+
input
|
|
58
|
+
}: import("@jfdevelops/create-error/types").ResolveContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
59
|
+
code: string;
|
|
60
|
+
scope: string;
|
|
61
|
+
}, {}>>) => {
|
|
62
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
message: ({
|
|
66
|
+
definition,
|
|
67
|
+
data,
|
|
68
|
+
implementation
|
|
69
|
+
}: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
70
|
+
code: string;
|
|
71
|
+
scope: string;
|
|
72
|
+
}, {}>>) => string & import("@jfdevelops/create-error/types").TypeSlot<"implementationArgument", {
|
|
73
|
+
readonly context: import("@jfdevelops/create-error/types").DataSlot;
|
|
74
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
75
|
+
}>;
|
|
76
|
+
} & {
|
|
77
|
+
properties(context: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
78
|
+
code: string;
|
|
79
|
+
scope: string;
|
|
80
|
+
}, {}>>): {
|
|
81
|
+
readonly code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
82
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
83
|
+
readonly renderMessage: (renderer?: (scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">, context: import("@jfdevelops/create-error/types").DataSlot) => string) => string;
|
|
84
|
+
};
|
|
85
|
+
}>>): {
|
|
86
|
+
name: string;
|
|
87
|
+
code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
88
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
89
|
+
message: string;
|
|
90
|
+
context: unknown;
|
|
91
|
+
};
|
|
92
|
+
}, {
|
|
93
|
+
readonly code: string;
|
|
94
|
+
readonly scope: string;
|
|
95
|
+
}, {
|
|
96
|
+
component: unknown;
|
|
97
|
+
scope: "component";
|
|
98
|
+
path?: string | undefined;
|
|
99
|
+
reason?: string | undefined;
|
|
100
|
+
resource?: string | undefined;
|
|
101
|
+
validComponents?: string[] | undefined;
|
|
102
|
+
}, {
|
|
103
|
+
component: unknown;
|
|
104
|
+
scope: "component";
|
|
105
|
+
path?: string | undefined;
|
|
106
|
+
reason?: string | undefined;
|
|
107
|
+
resource?: string | undefined;
|
|
108
|
+
validComponents?: string[] | undefined;
|
|
109
|
+
}>;
|
|
14
110
|
/** Thrown when a requested component slot cannot be resolved. */
|
|
15
111
|
declare class InvalidComponentError extends InvalidComponentError_base {}
|
|
16
112
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invalid-component.d.mts","names":[],"sources":["../../src/errors/invalid-component.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"invalid-component.d.mts","names":[],"sources":["../../src/errors/invalid-component.ts"],"mappings":";;;cAGM,OAAA,gDAAO,UAAA;;;;;;;;KASD,uBAAA,UAAiC,OAAA,CAAQ,KAAK;AAAA,cAAC,0BAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAG9C,qBAAA,SAA8B,0BA0BvC"}
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import { createReactLayoutError } from "./react-layout-error.mjs";
|
|
2
|
+
import { type } from "arktype";
|
|
2
3
|
|
|
3
4
|
//#region src/errors/invalid-component.ts
|
|
4
|
-
const
|
|
5
|
+
const context = type({
|
|
6
|
+
component: "unknown",
|
|
7
|
+
"path?": "string",
|
|
8
|
+
"reason?": "string",
|
|
9
|
+
"resource?": "string",
|
|
10
|
+
scope: "'component'",
|
|
11
|
+
"validComponents?": "string[]"
|
|
12
|
+
});
|
|
5
13
|
/** Thrown when a requested component slot cannot be resolved. */
|
|
6
14
|
var InvalidComponentError = class extends createReactLayoutError({
|
|
7
15
|
code: "invalidComponent",
|
|
8
|
-
scope
|
|
9
|
-
})((
|
|
10
|
-
const quotedComponent = JSON.stringify(component) ?? `"${String(component)}"`;
|
|
11
|
-
const locationParts = [path ? `path "${path}"` : void 0, resource ? `resource "${resource}"` : void 0].filter((part) => part !== void 0);
|
|
16
|
+
scope: "component"
|
|
17
|
+
}).defineContext(context).implement(({ context, scope }) => {
|
|
18
|
+
const quotedComponent = JSON.stringify(context.component) ?? `"${String(context.component)}"`;
|
|
19
|
+
const locationParts = [context.path ? `path "${context.path}"` : void 0, context.resource ? `resource "${context.resource}"` : void 0].filter((part) => part !== void 0);
|
|
12
20
|
const locationMessage = locationParts.length > 0 ? ` for ${locationParts.join(" and ")}` : "";
|
|
13
|
-
return `[${scope}]: ${reason ?? `Component slot ${quotedComponent}${locationMessage} is not configured.`}${validComponents && validComponents.length > 0 ? ` Available component slots are ${new Intl.ListFormat("en", {
|
|
21
|
+
return `[${scope}]: ${context.reason ?? `Component slot ${quotedComponent}${locationMessage} is not configured.`}${context.validComponents && context.validComponents.length > 0 ? ` Available component slots are ${new Intl.ListFormat("en", {
|
|
14
22
|
style: "long",
|
|
15
23
|
type: "disjunction"
|
|
16
|
-
}).format(validComponents)}.` : ""}`;
|
|
24
|
+
}).format(context.validComponents)}.` : ""}`;
|
|
17
25
|
}) {};
|
|
18
26
|
|
|
19
27
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invalid-component.mjs","names":[],"sources":["../../src/errors/invalid-component.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"invalid-component.mjs","names":[],"sources":["../../src/errors/invalid-component.ts"],"sourcesContent":["import { type } from 'arktype';\nimport { createReactLayoutError } from './react-layout-error';\n\nconst context = type({\n component: 'unknown',\n 'path?': 'string',\n 'reason?': 'string',\n 'resource?': 'string',\n scope: \"'component'\",\n 'validComponents?': 'string[]',\n});\n\nexport type InvalidComponentContext = typeof context.infer;\n\n/** Thrown when a requested component slot cannot be resolved. */\nexport class InvalidComponentError extends createReactLayoutError({\n code: 'invalidComponent',\n scope: 'component',\n})\n .defineContext(context)\n .implement(({ context, scope }) => {\n const quotedComponent =\n JSON.stringify(context.component) ?? `\"${String(context.component)}\"`;\n const locationParts = [\n context.path ? `path \"${context.path}\"` : undefined,\n context.resource ? `resource \"${context.resource}\"` : undefined,\n ].filter((part): part is string => part !== undefined);\n const locationMessage =\n locationParts.length > 0 ? ` for ${locationParts.join(' and ')}` : '';\n const body =\n context.reason ??\n `Component slot ${quotedComponent}${locationMessage} is not configured.`;\n const validComponentsMessage =\n context.validComponents && context.validComponents.length > 0\n ? ` Available component slots are ${new Intl.ListFormat('en', {\n style: 'long',\n type: 'disjunction',\n }).format(context.validComponents)}.`\n : '';\n\n return `[${scope}]: ${body}${validComponentsMessage}`;\n }) {}\n"],"mappings":";;;;AAGA,MAAM,UAAU,KAAK;CACnB,WAAW;CACX,SAAS;CACT,WAAW;CACX,aAAa;CACb,OAAO;CACP,oBAAoB;AACtB,CAAC;;AAKD,IAAa,wBAAb,cAA2C,uBAAuB;CAChE,MAAM;CACN,OAAO;AACT,CAAC,EACE,cAAc,OAAO,EACrB,WAAW,EAAE,SAAS,YAAY;CACjC,MAAM,kBACJ,KAAK,UAAU,QAAQ,SAAS,KAAK,IAAI,OAAO,QAAQ,SAAS,EAAE;CACrE,MAAM,gBAAgB,CACpB,QAAQ,OAAO,SAAS,QAAQ,KAAK,KAAK,QAC1C,QAAQ,WAAW,aAAa,QAAQ,SAAS,KAAK,MACxD,EAAE,QAAQ,SAAyB,SAAS,MAAS;CACrD,MAAM,kBACJ,cAAc,SAAS,IAAI,QAAQ,cAAc,KAAK,OAAO,MAAM;CAYrE,OAAO,IAAI,MAAM,KAVf,QAAQ,UACR,kBAAkB,kBAAkB,gBAAgB,uBAEpD,QAAQ,mBAAmB,QAAQ,gBAAgB,SAAS,IACxD,kCAAkC,IAAI,KAAK,WAAW,MAAM;EAC1D,OAAO;EACP,MAAM;CACR,CAAC,EAAE,OAAO,QAAQ,eAAe,EAAE,KACnC;AAGR,CAAC,EAAE,CAAC"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
const require_react_layout_error = require('./react-layout-error.cjs');
|
|
2
|
+
let arktype = require("arktype");
|
|
2
3
|
|
|
3
4
|
//#region src/errors/invalid-config.ts
|
|
4
|
-
const
|
|
5
|
+
const context = (0, arktype.type)({
|
|
6
|
+
"config?": "unknown",
|
|
7
|
+
reason: "string",
|
|
8
|
+
scope: "'config'"
|
|
9
|
+
});
|
|
5
10
|
/** Thrown when a React Layout configuration is invalid. */
|
|
6
11
|
var InvalidConfigError = class extends require_react_layout_error.createReactLayoutError({
|
|
7
12
|
code: "invalidConfig",
|
|
8
|
-
scope
|
|
9
|
-
})((
|
|
13
|
+
scope: "config"
|
|
14
|
+
}).defineContext(context).implement(({ context, scope }) => `[${scope}]: The layout configuration is invalid: ${context.reason}`) {};
|
|
10
15
|
|
|
11
16
|
//#endregion
|
|
12
17
|
exports.InvalidConfigError = InvalidConfigError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invalid-config.cjs","names":["createReactLayoutError"],"sources":["../../src/errors/invalid-config.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"invalid-config.cjs","names":["createReactLayoutError"],"sources":["../../src/errors/invalid-config.ts"],"sourcesContent":["import { type } from 'arktype';\nimport { createReactLayoutError } from './react-layout-error';\n\nconst context = type({\n 'config?': 'unknown',\n reason: 'string',\n scope: \"'config'\",\n});\n\nexport type InvalidConfigContext = typeof context.infer;\n\n/** Thrown when a React Layout configuration is invalid. */\nexport class InvalidConfigError extends createReactLayoutError({\n code: 'invalidConfig',\n scope: 'config',\n})\n .defineContext(context)\n .implement(\n ({ context, scope }) =>\n `[${scope}]: The layout configuration is invalid: ${context.reason}`,\n ) {}\n"],"mappings":";;;;AAGA,MAAM,4BAAe;CACnB,WAAW;CACX,QAAQ;CACR,OAAO;AACT,CAAC;;AAKD,IAAa,qBAAb,cAAwCA,kDAAuB;CAC7D,MAAM;CACN,OAAO;AACT,CAAC,EACE,cAAc,OAAO,EACrB,WACE,EAAE,SAAS,YACV,IAAI,MAAM,0CAA0C,QAAQ,QAChE,EAAE,CAAC"}
|
|
@@ -1,13 +1,103 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ImplementedErrorClass } from "../node_modules/.pnpm/@jfdevelops_create-error@0.2.0_patch_hash_afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/errors/invalid-config.d.ts
|
|
4
|
-
declare const
|
|
5
|
-
/** Context describing a configuration that React Layout cannot use. */
|
|
6
|
-
interface InvalidConfigContext extends ReactLayoutErrorContext<typeof scope> {
|
|
4
|
+
declare const context: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
7
5
|
reason: string;
|
|
6
|
+
scope: "config";
|
|
8
7
|
config?: unknown;
|
|
9
|
-
}
|
|
10
|
-
|
|
8
|
+
}, {}>;
|
|
9
|
+
type InvalidConfigContext = typeof context.infer;
|
|
10
|
+
declare const InvalidConfigError_base: ImplementedErrorClass<{
|
|
11
|
+
definition: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
12
|
+
code: string;
|
|
13
|
+
scope: string;
|
|
14
|
+
}, {}>;
|
|
15
|
+
} & {
|
|
16
|
+
data: {
|
|
17
|
+
readonly property: "context";
|
|
18
|
+
readonly resolve: ({
|
|
19
|
+
definition,
|
|
20
|
+
input
|
|
21
|
+
}: import("@jfdevelops/create-error/types").ResolveContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
22
|
+
code: string;
|
|
23
|
+
scope: string;
|
|
24
|
+
}, {}>>) => {
|
|
25
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
message: ({
|
|
29
|
+
definition,
|
|
30
|
+
data,
|
|
31
|
+
implementation
|
|
32
|
+
}: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
33
|
+
code: string;
|
|
34
|
+
scope: string;
|
|
35
|
+
}, {}>>) => string & import("@jfdevelops/create-error/types").TypeSlot<"implementationArgument", {
|
|
36
|
+
readonly context: import("@jfdevelops/create-error/types").DataSlot;
|
|
37
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
38
|
+
}>;
|
|
39
|
+
} & {
|
|
40
|
+
properties(context: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
41
|
+
code: string;
|
|
42
|
+
scope: string;
|
|
43
|
+
}, {}>>): {
|
|
44
|
+
readonly code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
45
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
46
|
+
readonly renderMessage: (renderer?: (scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">, context: import("@jfdevelops/create-error/types").DataSlot) => string) => string;
|
|
47
|
+
};
|
|
48
|
+
} & {
|
|
49
|
+
toJSON(error: import("@jfdevelops/create-error/types").BlueprintErrorTemplate<NoInfer<{
|
|
50
|
+
data: {
|
|
51
|
+
readonly property: "context";
|
|
52
|
+
readonly resolve: ({
|
|
53
|
+
definition,
|
|
54
|
+
input
|
|
55
|
+
}: import("@jfdevelops/create-error/types").ResolveContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
56
|
+
code: string;
|
|
57
|
+
scope: string;
|
|
58
|
+
}, {}>>) => {
|
|
59
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
message: ({
|
|
63
|
+
definition,
|
|
64
|
+
data,
|
|
65
|
+
implementation
|
|
66
|
+
}: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
67
|
+
code: string;
|
|
68
|
+
scope: string;
|
|
69
|
+
}, {}>>) => string & import("@jfdevelops/create-error/types").TypeSlot<"implementationArgument", {
|
|
70
|
+
readonly context: import("@jfdevelops/create-error/types").DataSlot;
|
|
71
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
72
|
+
}>;
|
|
73
|
+
} & {
|
|
74
|
+
properties(context: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
75
|
+
code: string;
|
|
76
|
+
scope: string;
|
|
77
|
+
}, {}>>): {
|
|
78
|
+
readonly code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
79
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
80
|
+
readonly renderMessage: (renderer?: (scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">, context: import("@jfdevelops/create-error/types").DataSlot) => string) => string;
|
|
81
|
+
};
|
|
82
|
+
}>>): {
|
|
83
|
+
name: string;
|
|
84
|
+
code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
85
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
86
|
+
message: string;
|
|
87
|
+
context: unknown;
|
|
88
|
+
};
|
|
89
|
+
}, {
|
|
90
|
+
readonly code: string;
|
|
91
|
+
readonly scope: string;
|
|
92
|
+
}, {
|
|
93
|
+
reason: string;
|
|
94
|
+
scope: "config";
|
|
95
|
+
config?: unknown;
|
|
96
|
+
}, {
|
|
97
|
+
reason: string;
|
|
98
|
+
scope: "config";
|
|
99
|
+
config?: unknown;
|
|
100
|
+
}>;
|
|
11
101
|
/** Thrown when a React Layout configuration is invalid. */
|
|
12
102
|
declare class InvalidConfigError extends InvalidConfigError_base {}
|
|
13
103
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invalid-config.d.cts","names":[],"sources":["../../src/errors/invalid-config.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"invalid-config.d.cts","names":[],"sources":["../../src/errors/invalid-config.ts"],"mappings":";;;cAGM,OAAA,gDAAO,UAAA;;;;;KAMD,oBAAA,UAA8B,OAAA,CAAQ,KAAK;AAAA,cAAC,uBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAG3C,kBAAA,SAA2B,uBAQrC"}
|
|
@@ -1,13 +1,103 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ImplementedErrorClass } from "../node_modules/.pnpm/@jfdevelops_create-error@0.2.0_patch_hash_afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/errors/invalid-config.d.ts
|
|
4
|
-
declare const
|
|
5
|
-
/** Context describing a configuration that React Layout cannot use. */
|
|
6
|
-
interface InvalidConfigContext extends ReactLayoutErrorContext<typeof scope> {
|
|
4
|
+
declare const context: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
7
5
|
reason: string;
|
|
6
|
+
scope: "config";
|
|
8
7
|
config?: unknown;
|
|
9
|
-
}
|
|
10
|
-
|
|
8
|
+
}, {}>;
|
|
9
|
+
type InvalidConfigContext = typeof context.infer;
|
|
10
|
+
declare const InvalidConfigError_base: ImplementedErrorClass<{
|
|
11
|
+
definition: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
12
|
+
code: string;
|
|
13
|
+
scope: string;
|
|
14
|
+
}, {}>;
|
|
15
|
+
} & {
|
|
16
|
+
data: {
|
|
17
|
+
readonly property: "context";
|
|
18
|
+
readonly resolve: ({
|
|
19
|
+
definition,
|
|
20
|
+
input
|
|
21
|
+
}: import("@jfdevelops/create-error/types").ResolveContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
22
|
+
code: string;
|
|
23
|
+
scope: string;
|
|
24
|
+
}, {}>>) => {
|
|
25
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
message: ({
|
|
29
|
+
definition,
|
|
30
|
+
data,
|
|
31
|
+
implementation
|
|
32
|
+
}: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
33
|
+
code: string;
|
|
34
|
+
scope: string;
|
|
35
|
+
}, {}>>) => string & import("@jfdevelops/create-error/types").TypeSlot<"implementationArgument", {
|
|
36
|
+
readonly context: import("@jfdevelops/create-error/types").DataSlot;
|
|
37
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
38
|
+
}>;
|
|
39
|
+
} & {
|
|
40
|
+
properties(context: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
41
|
+
code: string;
|
|
42
|
+
scope: string;
|
|
43
|
+
}, {}>>): {
|
|
44
|
+
readonly code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
45
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
46
|
+
readonly renderMessage: (renderer?: (scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">, context: import("@jfdevelops/create-error/types").DataSlot) => string) => string;
|
|
47
|
+
};
|
|
48
|
+
} & {
|
|
49
|
+
toJSON(error: import("@jfdevelops/create-error/types").BlueprintErrorTemplate<NoInfer<{
|
|
50
|
+
data: {
|
|
51
|
+
readonly property: "context";
|
|
52
|
+
readonly resolve: ({
|
|
53
|
+
definition,
|
|
54
|
+
input
|
|
55
|
+
}: import("@jfdevelops/create-error/types").ResolveContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
56
|
+
code: string;
|
|
57
|
+
scope: string;
|
|
58
|
+
}, {}>>) => {
|
|
59
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
message: ({
|
|
63
|
+
definition,
|
|
64
|
+
data,
|
|
65
|
+
implementation
|
|
66
|
+
}: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
67
|
+
code: string;
|
|
68
|
+
scope: string;
|
|
69
|
+
}, {}>>) => string & import("@jfdevelops/create-error/types").TypeSlot<"implementationArgument", {
|
|
70
|
+
readonly context: import("@jfdevelops/create-error/types").DataSlot;
|
|
71
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
72
|
+
}>;
|
|
73
|
+
} & {
|
|
74
|
+
properties(context: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
75
|
+
code: string;
|
|
76
|
+
scope: string;
|
|
77
|
+
}, {}>>): {
|
|
78
|
+
readonly code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
79
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
80
|
+
readonly renderMessage: (renderer?: (scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">, context: import("@jfdevelops/create-error/types").DataSlot) => string) => string;
|
|
81
|
+
};
|
|
82
|
+
}>>): {
|
|
83
|
+
name: string;
|
|
84
|
+
code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
85
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
86
|
+
message: string;
|
|
87
|
+
context: unknown;
|
|
88
|
+
};
|
|
89
|
+
}, {
|
|
90
|
+
readonly code: string;
|
|
91
|
+
readonly scope: string;
|
|
92
|
+
}, {
|
|
93
|
+
reason: string;
|
|
94
|
+
scope: "config";
|
|
95
|
+
config?: unknown;
|
|
96
|
+
}, {
|
|
97
|
+
reason: string;
|
|
98
|
+
scope: "config";
|
|
99
|
+
config?: unknown;
|
|
100
|
+
}>;
|
|
11
101
|
/** Thrown when a React Layout configuration is invalid. */
|
|
12
102
|
declare class InvalidConfigError extends InvalidConfigError_base {}
|
|
13
103
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invalid-config.d.mts","names":[],"sources":["../../src/errors/invalid-config.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"invalid-config.d.mts","names":[],"sources":["../../src/errors/invalid-config.ts"],"mappings":";;;cAGM,OAAA,gDAAO,UAAA;;;;;KAMD,oBAAA,UAA8B,OAAA,CAAQ,KAAK;AAAA,cAAC,uBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAG3C,kBAAA,SAA2B,uBAQrC"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { createReactLayoutError } from "./react-layout-error.mjs";
|
|
2
|
+
import { type } from "arktype";
|
|
2
3
|
|
|
3
4
|
//#region src/errors/invalid-config.ts
|
|
4
|
-
const
|
|
5
|
+
const context = type({
|
|
6
|
+
"config?": "unknown",
|
|
7
|
+
reason: "string",
|
|
8
|
+
scope: "'config'"
|
|
9
|
+
});
|
|
5
10
|
/** Thrown when a React Layout configuration is invalid. */
|
|
6
11
|
var InvalidConfigError = class extends createReactLayoutError({
|
|
7
12
|
code: "invalidConfig",
|
|
8
|
-
scope
|
|
9
|
-
})((
|
|
13
|
+
scope: "config"
|
|
14
|
+
}).defineContext(context).implement(({ context, scope }) => `[${scope}]: The layout configuration is invalid: ${context.reason}`) {};
|
|
10
15
|
|
|
11
16
|
//#endregion
|
|
12
17
|
export { InvalidConfigError };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invalid-config.mjs","names":[],"sources":["../../src/errors/invalid-config.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"invalid-config.mjs","names":[],"sources":["../../src/errors/invalid-config.ts"],"sourcesContent":["import { type } from 'arktype';\nimport { createReactLayoutError } from './react-layout-error';\n\nconst context = type({\n 'config?': 'unknown',\n reason: 'string',\n scope: \"'config'\",\n});\n\nexport type InvalidConfigContext = typeof context.infer;\n\n/** Thrown when a React Layout configuration is invalid. */\nexport class InvalidConfigError extends createReactLayoutError({\n code: 'invalidConfig',\n scope: 'config',\n})\n .defineContext(context)\n .implement(\n ({ context, scope }) =>\n `[${scope}]: The layout configuration is invalid: ${context.reason}`,\n ) {}\n"],"mappings":";;;;AAGA,MAAM,UAAU,KAAK;CACnB,WAAW;CACX,QAAQ;CACR,OAAO;AACT,CAAC;;AAKD,IAAa,qBAAb,cAAwC,uBAAuB;CAC7D,MAAM;CACN,OAAO;AACT,CAAC,EACE,cAAc,OAAO,EACrB,WACE,EAAE,SAAS,YACV,IAAI,MAAM,0CAA0C,QAAQ,QAChE,EAAE,CAAC"}
|