@jfdevelops/react-layout 0.22.0 → 0.22.2
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 +31 -17
- package/dist/create-config/create-resource-links.cjs.map +1 -1
- package/dist/create-config/create-resource-links.d.cts +9 -2
- package/dist/create-config/create-resource-links.d.cts.map +1 -1
- package/dist/create-config/create-resource-links.d.mts +9 -2
- package/dist/create-config/create-resource-links.d.mts.map +1 -1
- package/dist/create-config/create-resource-links.mjs +32 -17
- package/dist/create-config/create-resource-links.mjs.map +1 -1
- package/dist/create-config/define-layout.cjs +3 -2
- package/dist/create-config/define-layout.cjs.map +1 -1
- package/dist/create-config/define-layout.d.cts.map +1 -1
- package/dist/create-config/define-layout.d.mts.map +1 -1
- package/dist/create-config/define-layout.mjs +3 -2
- 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 +1 -1
- package/dist/create-config/index.d.mts +1 -1
- 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/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 +4 -3
- package/dist/index.d.cts +4 -2
- package/dist/index.d.mts +4 -2
- package/dist/index.mjs +5 -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,46 +1,89 @@
|
|
|
1
|
+
import { FamilyErrorClass } from "../node_modules/.pnpm/@jfdevelops_create-error@0.2.0_patch_hash_afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.mjs";
|
|
2
|
+
|
|
1
3
|
//#region src/errors/react-layout-error.d.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
declare const ReactLayoutError: FamilyErrorClass<import("@jfdevelops/create-error/types").FamilyError<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
5
|
+
code: string;
|
|
6
|
+
scope: string;
|
|
7
|
+
}, {}>, {
|
|
8
|
+
definition: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
9
|
+
code: string;
|
|
10
|
+
scope: string;
|
|
11
|
+
}, {}>;
|
|
12
|
+
} & {
|
|
13
|
+
data: {
|
|
14
|
+
readonly property: "context";
|
|
15
|
+
readonly resolve: ({
|
|
16
|
+
definition,
|
|
17
|
+
input
|
|
18
|
+
}: import("@jfdevelops/create-error/types").ResolveContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
19
|
+
code: string;
|
|
20
|
+
scope: string;
|
|
21
|
+
}, {}>>) => {
|
|
22
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
23
|
+
};
|
|
20
24
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
message: ({
|
|
26
|
+
definition,
|
|
27
|
+
data,
|
|
28
|
+
implementation
|
|
29
|
+
}: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
30
|
+
code: string;
|
|
31
|
+
scope: string;
|
|
32
|
+
}, {}>>) => string & import("@jfdevelops/create-error/types").TypeSlot<"implementationArgument", {
|
|
33
|
+
readonly context: import("@jfdevelops/create-error/types").DataSlot;
|
|
34
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
35
|
+
}>;
|
|
36
|
+
} & {
|
|
37
|
+
properties(context: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
38
|
+
code: string;
|
|
39
|
+
scope: string;
|
|
40
|
+
}, {}>>): {
|
|
41
|
+
readonly code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
42
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
43
|
+
readonly renderMessage: (renderer?: (scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">, context: import("@jfdevelops/create-error/types").DataSlot) => string) => string;
|
|
44
|
+
};
|
|
45
|
+
} & {
|
|
46
|
+
toJSON(error: import("@jfdevelops/create-error/types").BlueprintErrorTemplate<NoInfer<{
|
|
47
|
+
data: {
|
|
48
|
+
readonly property: "context";
|
|
49
|
+
readonly resolve: ({
|
|
50
|
+
definition,
|
|
51
|
+
input
|
|
52
|
+
}: import("@jfdevelops/create-error/types").ResolveContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
53
|
+
code: string;
|
|
54
|
+
scope: string;
|
|
55
|
+
}, {}>>) => {
|
|
56
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
message: ({
|
|
60
|
+
definition,
|
|
61
|
+
data,
|
|
62
|
+
implementation
|
|
63
|
+
}: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
64
|
+
code: string;
|
|
65
|
+
scope: string;
|
|
66
|
+
}, {}>>) => string & import("@jfdevelops/create-error/types").TypeSlot<"implementationArgument", {
|
|
67
|
+
readonly context: import("@jfdevelops/create-error/types").DataSlot;
|
|
68
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
69
|
+
}>;
|
|
70
|
+
} & {
|
|
71
|
+
properties(context: import("@jfdevelops/create-error/types").BlueprintContext<import("arktype/internal/variants/object.ts").ObjectType<{
|
|
72
|
+
code: string;
|
|
73
|
+
scope: string;
|
|
74
|
+
}, {}>>): {
|
|
75
|
+
readonly code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
76
|
+
readonly scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
77
|
+
readonly renderMessage: (renderer?: (scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">, context: import("@jfdevelops/create-error/types").DataSlot) => string) => string;
|
|
78
|
+
};
|
|
79
|
+
}>>): {
|
|
35
80
|
name: string;
|
|
36
|
-
code:
|
|
37
|
-
scope:
|
|
81
|
+
code: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "code">;
|
|
82
|
+
scope: string & import("@jfdevelops/create-error/types").TypeSlot<"definition", "scope">;
|
|
38
83
|
message: string;
|
|
39
84
|
context: unknown;
|
|
40
85
|
};
|
|
41
|
-
}
|
|
42
|
-
/** Creates a context-only React Layout error class with a default renderer. */
|
|
43
|
-
declare function createReactLayoutError<const Options extends CreateReactLayoutErrorOptions>(options: Options): ReactLayoutErrorRendererFactory<Options['code'], Options['scope']>;
|
|
86
|
+
}>>;
|
|
44
87
|
//#endregion
|
|
45
|
-
export {
|
|
88
|
+
export { ReactLayoutError };
|
|
46
89
|
//# sourceMappingURL=react-layout-error.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-layout-error.d.mts","names":[],"sources":["../../src/errors/react-layout-error.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"react-layout-error.d.mts","names":[],"sources":["../../src/errors/react-layout-error.ts"],"mappings":";;;cAyDa,gBAAA,4DAAgB,WAAA,+CAAA,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yCAhBrB,KAAA,oDAAK,QAAA,yBACL,OAAA,2CAAO,QAAA;EAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CADP,KAAA,oDAAK,QAAA,yBACL,OAAA,2CAAO,QAAA;IAAA;EAAA"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { createError } from "@jfdevelops/create-error";
|
|
2
|
+
import { type } from "arktype";
|
|
3
|
+
|
|
1
4
|
//#region src/errors/react-layout-error.ts
|
|
2
5
|
function makeJsonSafe(value) {
|
|
3
6
|
if (value === void 0) return null;
|
|
@@ -5,49 +8,42 @@ function makeJsonSafe(value) {
|
|
|
5
8
|
if (value && typeof value === "object") return Object.fromEntries(Object.entries(value).map(([key, nestedValue]) => [key, makeJsonSafe(nestedValue)]));
|
|
6
9
|
return value;
|
|
7
10
|
}
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
renderMessage(renderer) {
|
|
46
|
-
return (renderer ?? defaultRenderer)(this.scope, this.context);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
}
|
|
11
|
+
/** @internal */
|
|
12
|
+
const createReactLayoutError = createError({
|
|
13
|
+
definition: type({
|
|
14
|
+
code: "string",
|
|
15
|
+
scope: "string"
|
|
16
|
+
}),
|
|
17
|
+
data: {
|
|
18
|
+
property: "context",
|
|
19
|
+
resolve: ({ definition, input }) => typeof input === "object" && input !== null ? {
|
|
20
|
+
...input,
|
|
21
|
+
scope: definition.scope
|
|
22
|
+
} : input
|
|
23
|
+
},
|
|
24
|
+
message: ({ definition, data, implementation }) => implementation({
|
|
25
|
+
context: data,
|
|
26
|
+
scope: definition.scope
|
|
27
|
+
}),
|
|
28
|
+
properties: ({ definition, data, implementation }) => ({
|
|
29
|
+
code: definition.code,
|
|
30
|
+
scope: definition.scope,
|
|
31
|
+
renderMessage(renderer = (scope, context) => implementation({
|
|
32
|
+
context,
|
|
33
|
+
scope
|
|
34
|
+
})) {
|
|
35
|
+
return renderer(definition.scope, data);
|
|
36
|
+
}
|
|
37
|
+
}),
|
|
38
|
+
toJSON: (error) => ({
|
|
39
|
+
name: error.name,
|
|
40
|
+
code: error.code,
|
|
41
|
+
scope: error.scope,
|
|
42
|
+
message: error.message,
|
|
43
|
+
context: makeJsonSafe(error.context)
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
const ReactLayoutError = createReactLayoutError.Error;
|
|
51
47
|
|
|
52
48
|
//#endregion
|
|
53
49
|
export { ReactLayoutError, createReactLayoutError };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-layout-error.mjs","names":[],"sources":["../../src/errors/react-layout-error.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"react-layout-error.mjs","names":[],"sources":["../../src/errors/react-layout-error.ts"],"sourcesContent":["import { createError } from '@jfdevelops/create-error';\nimport { type } from 'arktype';\n\nfunction makeJsonSafe(value: unknown): unknown {\n if (value === undefined) {\n return null;\n }\n\n if (Array.isArray(value)) {\n return value.map(makeJsonSafe);\n }\n\n if (value && typeof value === 'object') {\n return Object.fromEntries(\n Object.entries(value).map(([key, nestedValue]) => [\n key,\n makeJsonSafe(nestedValue),\n ]),\n );\n }\n\n return value;\n}\n\n/** @internal */\nexport const createReactLayoutError = createError({\n definition: type({ code: 'string', scope: 'string' }),\n data: {\n property: 'context',\n resolve: ({ definition, input }) =>\n typeof input === 'object' && input !== null\n ? { ...input, scope: definition.scope }\n : input,\n },\n message: ({ definition, data, implementation }) =>\n implementation({ context: data, scope: definition.scope }),\n properties: ({ definition, data, implementation }) => ({\n code: definition.code,\n scope: definition.scope,\n renderMessage(\n renderer: (\n scope: typeof definition.scope,\n context: typeof data,\n ) => string = (scope, context) => implementation({ context, scope }),\n ) {\n return renderer(definition.scope, data);\n },\n }),\n toJSON: (error) => ({\n name: error.name,\n code: error.code,\n scope: error.scope,\n message: error.message,\n context: makeJsonSafe(error.context),\n }),\n});\n\nexport const ReactLayoutError = createReactLayoutError.Error;\n"],"mappings":";;;;AAGA,SAAS,aAAa,OAAyB;CAC7C,IAAI,UAAU,QACZ,OAAO;CAGT,IAAI,MAAM,QAAQ,KAAK,GACrB,OAAO,MAAM,IAAI,YAAY;CAG/B,IAAI,SAAS,OAAO,UAAU,UAC5B,OAAO,OAAO,YACZ,OAAO,QAAQ,KAAK,EAAE,KAAK,CAAC,KAAK,iBAAiB,CAChD,KACA,aAAa,WAAW,CAC1B,CAAC,CACH;CAGF,OAAO;AACT;;AAGA,MAAa,yBAAyB,YAAY;CAChD,YAAY,KAAK;EAAE,MAAM;EAAU,OAAO;CAAS,CAAC;CACpD,MAAM;EACJ,UAAU;EACV,UAAU,EAAE,YAAY,YACtB,OAAO,UAAU,YAAY,UAAU,OACnC;GAAE,GAAG;GAAO,OAAO,WAAW;EAAM,IACpC;CACR;CACA,UAAU,EAAE,YAAY,MAAM,qBAC5B,eAAe;EAAE,SAAS;EAAM,OAAO,WAAW;CAAM,CAAC;CAC3D,aAAa,EAAE,YAAY,MAAM,sBAAsB;EACrD,MAAM,WAAW;EACjB,OAAO,WAAW;EAClB,cACE,YAGe,OAAO,YAAY,eAAe;GAAE;GAAS;EAAM,CAAC,GACnE;GACA,OAAO,SAAS,WAAW,OAAO,IAAI;EACxC;CACF;CACA,SAAS,WAAW;EAClB,MAAM,MAAM;EACZ,MAAM,MAAM;EACZ,OAAO,MAAM;EACb,SAAS,MAAM;EACf,SAAS,aAAa,MAAM,OAAO;CACrC;AACF,CAAC;AAED,MAAa,mBAAmB,uBAAuB"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_resource = require('./resource.cjs');
|
|
3
|
-
const require_utils = require('./utils.cjs');
|
|
4
2
|
const require_react_layout_error = require('./errors/react-layout-error.cjs');
|
|
5
3
|
const require_invalid_config = require('./errors/invalid-config.cjs');
|
|
6
4
|
const require_invalid_path = require('./errors/invalid-path.cjs');
|
|
@@ -8,6 +6,9 @@ const require_invalid_resource = require('./errors/invalid-resource.cjs');
|
|
|
8
6
|
const require_invalid_sub_resource = require('./errors/invalid-sub-resource.cjs');
|
|
9
7
|
const require_invalid_component = require('./errors/invalid-component.cjs');
|
|
10
8
|
const require_missing_path_variable = require('./errors/missing-path-variable.cjs');
|
|
9
|
+
const require_layout_configuration_error = require('./errors/layout-configuration-error.cjs');
|
|
10
|
+
const require_resource = require('./resource.cjs');
|
|
11
|
+
const require_utils = require('./utils.cjs');
|
|
11
12
|
const require_define_layout = require('./create-config/define-layout.cjs');
|
|
12
13
|
let _jfdevelops_react_layout_composables = require("@jfdevelops/react-layout-composables");
|
|
13
14
|
let _jfdevelops_react_layout_validator = require("@jfdevelops/react-layout-validator");
|
|
@@ -23,6 +24,7 @@ Object.defineProperty(exports, 'LayoutComposablePresetProvider', {
|
|
|
23
24
|
return _jfdevelops_react_layout_composables.LayoutComposablePresetProvider;
|
|
24
25
|
}
|
|
25
26
|
});
|
|
27
|
+
exports.LayoutConfigurationError = require_layout_configuration_error.LayoutConfigurationError;
|
|
26
28
|
exports.MissingPathVariableError = require_missing_path_variable.MissingPathVariableError;
|
|
27
29
|
Object.defineProperty(exports, 'PropError', {
|
|
28
30
|
enumerable: true,
|
|
@@ -61,7 +63,6 @@ Object.defineProperty(exports, 'createProp', {
|
|
|
61
63
|
return _jfdevelops_react_layout_validator.createProp;
|
|
62
64
|
}
|
|
63
65
|
});
|
|
64
|
-
exports.createReactLayoutError = require_react_layout_error.createReactLayoutError;
|
|
65
66
|
Object.defineProperty(exports, 'defineComposableComponent', {
|
|
66
67
|
enumerable: true,
|
|
67
68
|
get: function () {
|
package/dist/index.d.cts
CHANGED
|
@@ -6,15 +6,17 @@ import { CreateGetComponentForPath, GetComponentForPath, ResolvedPathValue } fro
|
|
|
6
6
|
import { ForPaths, ForPathsRenderContext, RenderedPathComponent, RenderedPathComponentHOF, TargetPathBuilder } from "./create-config/for-paths/builder.cjs";
|
|
7
7
|
import { IsSubResourceKey } from "./create-config/is-sub-resource-key.cjs";
|
|
8
8
|
import { ComponentTypes, CreatedResourceConfig } from "./create-config/get-component.cjs";
|
|
9
|
+
import { CreateResourceMap, CreateResourceMapFn } from "./create-config/create-resource-links.cjs";
|
|
9
10
|
import { CreateResourceLayoutWithLayoutOptions, DefineResourceLayoutWithLayoutFn, DefineResourcesFn, DefinedResourceLayoutWithShell, LayoutRenderResourcesAccessor, LayoutResourcesAccessor, ResourceLayoutShellComponent, ResourceLayoutShellProps, ResourceSelection, ShellLayoutDefinition, ShellRenderContext, defineResourceLayout } from "./create-config/define-layout.cjs";
|
|
10
11
|
import { ResourceLayoutShellPublisher } from "./create-config/shell-context.cjs";
|
|
11
|
-
import {
|
|
12
|
+
import { ReactLayoutError } from "./errors/react-layout-error.cjs";
|
|
12
13
|
import { InvalidConfigContext, InvalidConfigError } from "./errors/invalid-config.cjs";
|
|
13
14
|
import { InvalidPathContext, InvalidPathError } from "./errors/invalid-path.cjs";
|
|
14
15
|
import { InvalidResourceContext, InvalidResourceError } from "./errors/invalid-resource.cjs";
|
|
15
16
|
import { InvalidSubResourceContext, InvalidSubResourceError } from "./errors/invalid-sub-resource.cjs";
|
|
16
17
|
import { InvalidComponentContext, InvalidComponentError } from "./errors/invalid-component.cjs";
|
|
17
18
|
import { MissingPathVariableContext, MissingPathVariableError } from "./errors/missing-path-variable.cjs";
|
|
19
|
+
import { LayoutConfigurationError, LayoutConfigurationErrorContext } from "./errors/layout-configuration-error.cjs";
|
|
18
20
|
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";
|
|
19
21
|
import { AnyBuiltPropDefinition, ExtractDefinitionValue, PropError, PropErrorOptions, ResolveLayoutProps, ResolveLayoutPropsAsDefined, ResolveProps, ResolvedBuiltPropShape, createPrimitivePropBuilder, createProp, isPropDefinitionShape, resolvePropDefinitionValues, validateProps } from "@jfdevelops/react-layout-validator";
|
|
20
|
-
export { type AnyBuiltPropDefinition, type AnyComposableComponent, type BaseComponent, type ComponentTypes, type ComposableComponent, type ComposableComponentCallable, type ComposableComponents, type ComposableNameContext, type ComposablePresetComponent, type ComposablePresetComponentCallProps, type ComposablePresetMeta, type ComposablePresetProps, type ComposableResourceLayout, type CreateGetComponentForPath, type CreateLayoutComposable, type
|
|
22
|
+
export { type AnyBuiltPropDefinition, type AnyComposableComponent, type BaseComponent, type ComponentTypes, type ComposableComponent, type ComposableComponentCallable, type ComposableComponents, type ComposableNameContext, type ComposablePresetComponent, type ComposablePresetComponentCallProps, type ComposablePresetMeta, type ComposablePresetProps, type ComposableResourceLayout, type CreateGetComponentForPath, type CreateLayoutComposable, type CreateResourceLayoutWithLayoutOptions, type CreateResourceMap, type CreateResourceMapFn, type CreatedResourceConfig, type DefineResourceLayoutWithLayoutFn, type DefineResourcesFn, type DefinedComposableComponentRecord, type DefinedResourceLayoutWithShell, type ExtractDefinitionValue, type ForPaths, type ForPathsRenderContext, type GetComponentForPath, type InPropsDefinition, type InPropsFunction, type InPropsObject, type InPropsOptions, type IncludedPropBehavior, type IncludedProps, type InferredInProps, type InvalidComponentContext, InvalidComponentError, type InvalidConfigContext, InvalidConfigError, type InvalidPathContext, InvalidPathError, type InvalidResourceContext, InvalidResourceError, type InvalidSubResourceContext, InvalidSubResourceError, type IsSubResourceKey, LayoutComposablePresetProvider, type LayoutComposablesFactory, LayoutConfigurationError, type LayoutConfigurationErrorContext, type LayoutRenderProps, type LayoutRenderResourcesAccessor, type LayoutResourceKey, type LayoutResourcesAccessor, type MakeComposable, type MakeComposableOptions, type MergeIntersection, type MergePresetProps, type MergedLayoutInProps, type MissingPathVariableContext, MissingPathVariableError, type NormalizeResource, type NormalizeResources, type ParameterizedResourcePath, type PathVariables, type PresetPropsFromComposable, PropError, type PropErrorOptions, type PropsContextRender, type PropsRenderDefinition, ReactLayoutError, 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 ResolvedPathValue, type ResourceDefinition, type ResourceDefinitionValue, type ResourceEnum, type ResourceLayoutComponentProps, type ResourceLayoutShellComponent, type ResourceLayoutShellProps, type ResourceLayoutShellPublisher, type ResourceSelection, type ResourceTree, type ShellLayoutDefinition, type ShellRenderContext, type Show, type TargetPathBuilder, type UnionToIntersection, collectComposablePresetEntries, createComposableComponent, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, defineComposableComponent, defineResourceLayout, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|
package/dist/index.d.mts
CHANGED
|
@@ -6,15 +6,17 @@ import { CreateGetComponentForPath, GetComponentForPath, ResolvedPathValue } fro
|
|
|
6
6
|
import { ForPaths, ForPathsRenderContext, RenderedPathComponent, RenderedPathComponentHOF, TargetPathBuilder } from "./create-config/for-paths/builder.mjs";
|
|
7
7
|
import { IsSubResourceKey } from "./create-config/is-sub-resource-key.mjs";
|
|
8
8
|
import { ComponentTypes, CreatedResourceConfig } from "./create-config/get-component.mjs";
|
|
9
|
+
import { CreateResourceMap, CreateResourceMapFn } from "./create-config/create-resource-links.mjs";
|
|
9
10
|
import { CreateResourceLayoutWithLayoutOptions, DefineResourceLayoutWithLayoutFn, DefineResourcesFn, DefinedResourceLayoutWithShell, LayoutRenderResourcesAccessor, LayoutResourcesAccessor, ResourceLayoutShellComponent, ResourceLayoutShellProps, ResourceSelection, ShellLayoutDefinition, ShellRenderContext, defineResourceLayout } from "./create-config/define-layout.mjs";
|
|
10
11
|
import { ResourceLayoutShellPublisher } from "./create-config/shell-context.mjs";
|
|
11
|
-
import {
|
|
12
|
+
import { ReactLayoutError } from "./errors/react-layout-error.mjs";
|
|
12
13
|
import { InvalidConfigContext, InvalidConfigError } from "./errors/invalid-config.mjs";
|
|
13
14
|
import { InvalidPathContext, InvalidPathError } from "./errors/invalid-path.mjs";
|
|
14
15
|
import { InvalidResourceContext, InvalidResourceError } from "./errors/invalid-resource.mjs";
|
|
15
16
|
import { InvalidSubResourceContext, InvalidSubResourceError } from "./errors/invalid-sub-resource.mjs";
|
|
16
17
|
import { InvalidComponentContext, InvalidComponentError } from "./errors/invalid-component.mjs";
|
|
17
18
|
import { MissingPathVariableContext, MissingPathVariableError } from "./errors/missing-path-variable.mjs";
|
|
19
|
+
import { LayoutConfigurationError, LayoutConfigurationErrorContext } from "./errors/layout-configuration-error.mjs";
|
|
18
20
|
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";
|
|
19
21
|
import { AnyBuiltPropDefinition, ExtractDefinitionValue, PropError, PropErrorOptions, ResolveLayoutProps, ResolveLayoutPropsAsDefined, ResolveProps, ResolvedBuiltPropShape, createPrimitivePropBuilder, createProp, isPropDefinitionShape, resolvePropDefinitionValues, validateProps } from "@jfdevelops/react-layout-validator";
|
|
20
|
-
export { type AnyBuiltPropDefinition, type AnyComposableComponent, type BaseComponent, type ComponentTypes, type ComposableComponent, type ComposableComponentCallable, type ComposableComponents, type ComposableNameContext, type ComposablePresetComponent, type ComposablePresetComponentCallProps, type ComposablePresetMeta, type ComposablePresetProps, type ComposableResourceLayout, type CreateGetComponentForPath, type CreateLayoutComposable, type
|
|
22
|
+
export { type AnyBuiltPropDefinition, type AnyComposableComponent, type BaseComponent, type ComponentTypes, type ComposableComponent, type ComposableComponentCallable, type ComposableComponents, type ComposableNameContext, type ComposablePresetComponent, type ComposablePresetComponentCallProps, type ComposablePresetMeta, type ComposablePresetProps, type ComposableResourceLayout, type CreateGetComponentForPath, type CreateLayoutComposable, type CreateResourceLayoutWithLayoutOptions, type CreateResourceMap, type CreateResourceMapFn, type CreatedResourceConfig, type DefineResourceLayoutWithLayoutFn, type DefineResourcesFn, type DefinedComposableComponentRecord, type DefinedResourceLayoutWithShell, type ExtractDefinitionValue, type ForPaths, type ForPathsRenderContext, type GetComponentForPath, type InPropsDefinition, type InPropsFunction, type InPropsObject, type InPropsOptions, type IncludedPropBehavior, type IncludedProps, type InferredInProps, type InvalidComponentContext, InvalidComponentError, type InvalidConfigContext, InvalidConfigError, type InvalidPathContext, InvalidPathError, type InvalidResourceContext, InvalidResourceError, type InvalidSubResourceContext, InvalidSubResourceError, type IsSubResourceKey, LayoutComposablePresetProvider, type LayoutComposablesFactory, LayoutConfigurationError, type LayoutConfigurationErrorContext, type LayoutRenderProps, type LayoutRenderResourcesAccessor, type LayoutResourceKey, type LayoutResourcesAccessor, type MakeComposable, type MakeComposableOptions, type MergeIntersection, type MergePresetProps, type MergedLayoutInProps, type MissingPathVariableContext, MissingPathVariableError, type NormalizeResource, type NormalizeResources, type ParameterizedResourcePath, type PathVariables, type PresetPropsFromComposable, PropError, type PropErrorOptions, type PropsContextRender, type PropsRenderDefinition, ReactLayoutError, 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 ResolvedPathValue, type ResourceDefinition, type ResourceDefinitionValue, type ResourceEnum, type ResourceLayoutComponentProps, type ResourceLayoutShellComponent, type ResourceLayoutShellProps, type ResourceLayoutShellPublisher, type ResourceSelection, type ResourceTree, type ShellLayoutDefinition, type ShellRenderContext, type Show, type TargetPathBuilder, type UnionToIntersection, collectComposablePresetEntries, createComposableComponent, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, defineComposableComponent, defineResourceLayout, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { pick } from "./utils.mjs";
|
|
3
|
-
import { ReactLayoutError, createReactLayoutError } from "./errors/react-layout-error.mjs";
|
|
1
|
+
import { ReactLayoutError } from "./errors/react-layout-error.mjs";
|
|
4
2
|
import { InvalidConfigError } from "./errors/invalid-config.mjs";
|
|
5
3
|
import { InvalidPathError } from "./errors/invalid-path.mjs";
|
|
6
4
|
import { InvalidResourceError } from "./errors/invalid-resource.mjs";
|
|
7
5
|
import { InvalidSubResourceError } from "./errors/invalid-sub-resource.mjs";
|
|
8
6
|
import { InvalidComponentError } from "./errors/invalid-component.mjs";
|
|
9
7
|
import { MissingPathVariableError } from "./errors/missing-path-variable.mjs";
|
|
8
|
+
import { LayoutConfigurationError } from "./errors/layout-configuration-error.mjs";
|
|
9
|
+
import { normalizeResource, normalizeResources, toResourceEnum } from "./resource.mjs";
|
|
10
|
+
import { pick } from "./utils.mjs";
|
|
10
11
|
import { defineResourceLayout } from "./create-config/define-layout.mjs";
|
|
11
12
|
import { LayoutComposablePresetProvider, collectComposablePresetEntries, createComposableComponent, createLayoutComposableFactory, defineComposableComponent, makeComposable, resolveComposablePresetProps, resolveLayoutComposables } from "@jfdevelops/react-layout-composables";
|
|
12
13
|
import { PropError, createPrimitivePropBuilder, createProp, isPropDefinitionShape, resolvePropDefinitionValues, validateProps } from "@jfdevelops/react-layout-validator";
|
|
13
14
|
|
|
14
|
-
export { InvalidComponentError, InvalidConfigError, InvalidPathError, InvalidResourceError, InvalidSubResourceError, LayoutComposablePresetProvider, MissingPathVariableError, PropError, ReactLayoutError, collectComposablePresetEntries, createComposableComponent, createLayoutComposableFactory, createPrimitivePropBuilder, createProp,
|
|
15
|
+
export { InvalidComponentError, InvalidConfigError, InvalidPathError, InvalidResourceError, InvalidSubResourceError, LayoutComposablePresetProvider, LayoutConfigurationError, MissingPathVariableError, PropError, ReactLayoutError, collectComposablePresetEntries, createComposableComponent, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, defineComposableComponent, defineResourceLayout, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@jfdevelops+create-error@0.2.0_patch_hash=afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.d.mts
|
|
2
|
+
//#region src/types.d.ts
|
|
3
|
+
declare const typeSlot: unique symbol;
|
|
4
|
+
/** Marks a blueprint value that is resolved by a later builder stage. */
|
|
5
|
+
type TypeSlot<Kind extends string, Payload = never> = {
|
|
6
|
+
readonly [typeSlot]: {
|
|
7
|
+
readonly kind: Kind;
|
|
8
|
+
readonly payload: Payload;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
type DataSlot = TypeSlot<'data'>;
|
|
12
|
+
type ResolveTemplate<Config> = Config extends {
|
|
13
|
+
data: {
|
|
14
|
+
resolve: (...arguments_: infer _Arguments) => infer Resolved;
|
|
15
|
+
};
|
|
16
|
+
} ? Resolved : never;
|
|
17
|
+
type InjectedDefinitionKeys<Template> = { [Key in keyof Template]: Template[Key] extends TypeSlot<'definition', PropertyKey> ? Key : never }[keyof Template];
|
|
18
|
+
type ConstructorInput<Config, Data> = Data extends readonly unknown[] | ((...arguments_: never[]) => unknown) ? Data : Data extends object ? Omit<Data, Extract<InjectedDefinitionKeys<ResolveTemplate<Config>>, keyof Data>> : Data;
|
|
19
|
+
type ReplaceTuple<Values extends readonly unknown[], Definition, Data, Implementation> = { [Index in keyof Values]: ReplaceTemplate<Values[Index], Definition, Data, Implementation> };
|
|
20
|
+
/**
|
|
21
|
+
* Built-in class instances that are never plain objects. Templates are not
|
|
22
|
+
* expanded inside them, and they never receive definition fields.
|
|
23
|
+
*/
|
|
24
|
+
type OpaqueObject = Date | RegExp | ReadonlyMap<unknown, unknown> | ReadonlySet<unknown> | WeakMap<object, unknown> | WeakSet<object> | PromiseLike<unknown> | ArrayBuffer | ArrayBufferView;
|
|
25
|
+
type ReplaceTemplate<Type, Definition, Data, Implementation> = Type extends TypeSlot<'definition', infer Key> ? Key extends keyof Definition ? Definition[Key] : never : Type extends TypeSlot<'data'> ? Data : Type extends TypeSlot<'implementation'> ? Implementation : Type extends OpaqueObject ? Type : Type extends ((...arguments_: infer Arguments) => infer Result) ? (...arguments_: ReplaceTuple<Arguments, Definition, Data, Implementation>) => ReplaceTemplate<Result, Definition, Data, Implementation> : Type extends readonly unknown[] ? ReplaceTuple<Type, Definition, Data, Implementation> : Type extends object ? { [Key in keyof Type]: ReplaceTemplate<Type[Key], Definition, Data, Implementation> } : Type;
|
|
26
|
+
type PropertiesTemplate<Config> = Config extends {
|
|
27
|
+
properties: (...arguments_: infer _Arguments) => infer Properties;
|
|
28
|
+
} ? Properties : object;
|
|
29
|
+
type DataPropertyTemplate<Config> = Config extends {
|
|
30
|
+
data: {
|
|
31
|
+
property: infer Property extends string;
|
|
32
|
+
};
|
|
33
|
+
} ? { [Key in Property]: DataSlot } : object;
|
|
34
|
+
/**
|
|
35
|
+
* The error shape visible to a blueprint's `toJSON` callback.
|
|
36
|
+
*
|
|
37
|
+
* It contains native `Error` fields, the configured data property, and every
|
|
38
|
+
* member returned by `properties`.
|
|
39
|
+
*/
|
|
40
|
+
type InstanceProperties<Config, Definition, Data, Implementation> = ReplaceTemplate<PropertiesTemplate<Config>, Definition, Data, Implementation> & ReplaceTemplate<DataPropertyTemplate<Config>, Definition, Data, Implementation> & Error & (Config extends {
|
|
41
|
+
toJSON: (...arguments_: infer _Arguments) => infer Json;
|
|
42
|
+
} ? {
|
|
43
|
+
toJSON(): ReplaceTemplate<Json, Definition, Data, Implementation>;
|
|
44
|
+
} : object);
|
|
45
|
+
type MessageTemplate<Config> = Config extends {
|
|
46
|
+
message: (...arguments_: infer _Arguments) => infer Message;
|
|
47
|
+
} ? Message : string;
|
|
48
|
+
type PassedImplementationArgument<Config, Definition, Data> = MessageTemplate<Config> extends TypeSlot<'implementationArgument', infer Argument> ? Argument extends TypeSlot<'data'> ? Data : ReplaceTemplate<Argument, Definition, Data, never> : never;
|
|
49
|
+
type PassedImplementationCallback<Config, Definition, Data> = (argument: PassedImplementationArgument<Config, Definition, Data>) => string;
|
|
50
|
+
/**
|
|
51
|
+
* Input accepted by `invariant`: the constructor input, or a function that
|
|
52
|
+
* returns it. When the constructor input can itself be a function, only the
|
|
53
|
+
* wrapped form is accepted so a callback is never mistaken for a lazy input.
|
|
54
|
+
*/
|
|
55
|
+
type InvariantInput<Input> = ExtendsNever<Extract<Input, (...arguments_: never[]) => unknown>, Input | (() => Input), () => Input>;
|
|
56
|
+
interface ErrorClassStatics {
|
|
57
|
+
/**
|
|
58
|
+
* Throws this error class when `condition` is falsy.
|
|
59
|
+
*
|
|
60
|
+
* A function can be supplied as `input` to avoid constructing error data
|
|
61
|
+
* unless the invariant fails. TypeScript narrows `condition` after a
|
|
62
|
+
* successful call.
|
|
63
|
+
*
|
|
64
|
+
* TypeScript only allows assertion calls through explicitly typed names, so
|
|
65
|
+
* call this on a `class` declaration. For a class stored in a `const`, use
|
|
66
|
+
* the standalone {@link invariant} function instead.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* MissingUserError.invariant(
|
|
71
|
+
* user,
|
|
72
|
+
* () => ({ userId }),
|
|
73
|
+
* { cause },
|
|
74
|
+
* );
|
|
75
|
+
*
|
|
76
|
+
* user.id; // narrowed to the truthy branch
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
invariant<Condition, Input>(this: new (input: Input, options?: ErrorOptions) => Error, condition: Condition, input: InvariantInput<Input>, options?: ErrorOptions): asserts condition;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The instance type shared by every error in one family.
|
|
83
|
+
*
|
|
84
|
+
* Definition-derived fields use the schema's general output type, and the data
|
|
85
|
+
* property is `unknown` because each concrete error types its own data.
|
|
86
|
+
*/
|
|
87
|
+
/**
|
|
88
|
+
* The shared native `Error` base created for one blueprint.
|
|
89
|
+
*
|
|
90
|
+
* Use `factory.Error` for family-wide `instanceof` checks or as a public base
|
|
91
|
+
* type for errors created by the same blueprint.
|
|
92
|
+
*/
|
|
93
|
+
type FamilyErrorClass<Instance extends Error = Error> = (abstract new (...arguments_: never[]) => Instance) & ErrorClassStatics;
|
|
94
|
+
/** An extendable concrete error class produced by a configured factory. */
|
|
95
|
+
interface ConcreteErrorClass<Input, Instance> extends ErrorClassStatics {
|
|
96
|
+
/**
|
|
97
|
+
* Creates an error from family-specific input.
|
|
98
|
+
*
|
|
99
|
+
* Pass native `ErrorOptions` as the second argument to preserve a `cause`.
|
|
100
|
+
*/
|
|
101
|
+
new (input: Input, options?: ErrorOptions): Instance;
|
|
102
|
+
}
|
|
103
|
+
type ImplementedErrorClass<Config, Definition, Input, Data> = ConcreteErrorClass<ConstructorInput<Config, Input>, InstanceProperties<Config, Definition, Data, PassedImplementationCallback<Config, Definition, Data>>>;
|
|
104
|
+
type ExtendsNever<Value, OnTrue, OnFalse> = [Value] extends [never] ? OnTrue : OnFalse;
|
|
105
|
+
//#endregion
|
|
106
|
+
export { FamilyErrorClass, ImplementedErrorClass };
|
|
107
|
+
//# sourceMappingURL=types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":["Kind","Payload","typeSlot","kind","payload","Schema","StandardSchemaV1","InferInput","InferOutput","Input","Definition","Record","Exclude","DefinitionOutput","Key","TypeSlot","Argument$1","argument","definition","DefinitionTemplate","data","DataSlot","implementation","ImplementationSlot","input","property","resolve","ResolveContext","context","message","BlueprintContext","properties","toJSON","Error","error","Config","arguments_","_Arguments","Resolved","Template","PropertyKey","Data","Omit","Extract","InjectedDefinitionKeys","ResolveTemplate","Values","Implementation","Index","ReplaceTemplate","Date","RegExp","ReadonlyMap","ReadonlySet","WeakMap","WeakSet","PromiseLike","ArrayBuffer","ArrayBufferView","Type","OpaqueObject","Arguments","Result","ReplaceTuple","Properties","Property","DataPropertyTemplate","PropertiesTemplate","Json","Message","MessageTemplate","Argument","ImplementationArgumentWithDefinition","ImplementationArgument","PassedImplementationArgument","ExtendsNever","invariant","Condition","ErrorOptions","options","this","condition","InvariantInput","InstanceProperties","ConcreteDefinition","Instance","ErrorClassStatics","ConcreteErrorClass","ConstructorInput","PassedImplementationCallback","Value","OnTrue","OnFalse","InferredData","name","implement","DefaultBuilderData","Expand","ImplementationCallback","BuilderData","ImplementOptions","ImplementedErrorClass","BuilderInput","ImplementationBuilder","defineContext","ContextSchema","DefinitionInput","ExactDefinition","ErrorDefinitionBuilder","FamilyErrorClass","FamilyError","is","value"],"sources":["../../../../../../../../../../node_modules/.pnpm/@jfdevelops+create-error@0.2.0_patch_hash=afc71b16c3f866f54416d30f467784ddc31736feb04f281a5fc4772ea422f4a9/node_modules/@jfdevelops/create-error/dist/types.d.mts"],"x_google_ignoreList":[0],"mappings":"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"}
|