piral-core 0.15.11-beta.5506 → 0.15.12-beta.5528
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/esm/types/api.d.ts +1 -1
- package/esm/types/common.d.ts +11 -11
- package/esm/types/components.d.ts +2 -2
- package/esm/types/config.d.ts +1 -1
- package/esm/types/data.d.ts +2 -2
- package/esm/types/extension.d.ts +2 -2
- package/esm/types/layout.d.ts +3 -3
- package/esm/types/navigation.d.ts +1 -1
- package/esm/types/state.d.ts +3 -3
- package/lib/types/api.d.ts +1 -1
- package/lib/types/common.d.ts +11 -11
- package/lib/types/components.d.ts +2 -2
- package/lib/types/config.d.ts +1 -1
- package/lib/types/data.d.ts +2 -2
- package/lib/types/extension.d.ts +2 -2
- package/lib/types/layout.d.ts +3 -3
- package/lib/types/navigation.d.ts +1 -1
- package/lib/types/state.d.ts +3 -3
- package/package.json +4 -4
package/esm/types/api.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ export interface PiralPageMeta extends PiralCustomPageMeta {
|
|
|
73
73
|
/**
|
|
74
74
|
* Shorthand for the definition of an extension component.
|
|
75
75
|
*/
|
|
76
|
-
export
|
|
76
|
+
export type AnyExtensionComponent<TName> = TName extends keyof PiralExtensionSlotMap ? AnyComponent<ExtensionComponentProps<TName>> : TName extends string ? AnyComponent<ExtensionComponentProps<any>> : AnyComponent<ExtensionComponentProps<TName>>;
|
|
77
77
|
/**
|
|
78
78
|
* Defines the Pilet API from piral-core.
|
|
79
79
|
* This interface will be consumed by pilet developers so that their pilet can interact with the piral instance.
|
package/esm/types/common.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ValuesOf<T> = T extends {
|
|
2
2
|
[_ in keyof T]: infer U;
|
|
3
3
|
} ? U : never;
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
4
|
+
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
5
|
+
export type RemainingArgs<T> = T extends (_: any, ...args: infer U) => any ? U : never;
|
|
6
|
+
export type DeepPartial<T> = {
|
|
7
7
|
[P in keyof T]?: T[P] extends Array<infer U> ? Array<DeepPartial<U>> : T[P] extends {} ? DeepPartial<T[P]> : T[P];
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type NestedPartial<T> = {
|
|
10
10
|
[P in keyof T]?: T[P] extends Array<infer U> ? Array<Partial<U>> : T[P] extends {} ? Partial<T[P]> : T[P];
|
|
11
11
|
};
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
12
|
+
export type Dict<T> = Record<string, T>;
|
|
13
|
+
export type Without<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
14
|
+
export type FirstParameter<T extends (arg: any) => any> = T extends (arg: infer P) => any ? P : never;
|
|
15
|
+
export type FirstParametersOf<T> = {
|
|
16
16
|
[K in keyof T]: T[K] extends (arg: any) => any ? FirstParameter<T[K]> : never;
|
|
17
17
|
}[keyof T];
|
|
18
|
-
export
|
|
18
|
+
export type UnionOf<T> = {
|
|
19
19
|
[K in keyof T]: T[K];
|
|
20
20
|
}[keyof T];
|
|
21
|
-
export
|
|
21
|
+
export type MaybeAsync<T> = T | (() => Promise<T>);
|
|
@@ -75,7 +75,7 @@ export interface ForeignComponent<TProps> {
|
|
|
75
75
|
/**
|
|
76
76
|
* Possible shapes for a component.
|
|
77
77
|
*/
|
|
78
|
-
export
|
|
78
|
+
export type AnyComponent<T> = ComponentType<T> | FirstParametersOf<ComponentConverters<T>>;
|
|
79
79
|
/**
|
|
80
80
|
* The error used when a route cannot be resolved.
|
|
81
81
|
*/
|
|
@@ -177,7 +177,7 @@ export interface Errors extends PiralCustomErrors {
|
|
|
177
177
|
/**
|
|
178
178
|
* The props for the ErrorInfo component.
|
|
179
179
|
*/
|
|
180
|
-
export
|
|
180
|
+
export type ErrorInfoProps = UnionOf<Errors>;
|
|
181
181
|
/**
|
|
182
182
|
* The props of a Loading indicator component.
|
|
183
183
|
*/
|
package/esm/types/config.d.ts
CHANGED
|
@@ -91,4 +91,4 @@ export interface PiralStateConfiguration {
|
|
|
91
91
|
/**
|
|
92
92
|
* The configuration to be used in the Piral instance.
|
|
93
93
|
*/
|
|
94
|
-
export
|
|
94
|
+
export type PiralConfiguration = PiralPiletConfiguration & PiralStateConfiguration;
|
package/esm/types/data.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface SharedData<TValue = any> {
|
|
|
10
10
|
/**
|
|
11
11
|
* Defines the potential targets when storing data.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type DataStoreTarget = 'memory' | 'local' | 'remote';
|
|
14
14
|
/**
|
|
15
15
|
* Defines the custom options for storing data.
|
|
16
16
|
*/
|
|
@@ -27,7 +27,7 @@ export interface CustomDataStoreOptions {
|
|
|
27
27
|
/**
|
|
28
28
|
* Defines the options to be used for storing data.
|
|
29
29
|
*/
|
|
30
|
-
export
|
|
30
|
+
export type DataStoreOptions = DataStoreTarget | CustomDataStoreOptions;
|
|
31
31
|
/**
|
|
32
32
|
* Defines the shape of a shared data item.
|
|
33
33
|
*/
|
package/esm/types/extension.d.ts
CHANGED
|
@@ -54,8 +54,8 @@ export interface BaseExtensionSlotProps<TName, TParams> {
|
|
|
54
54
|
/**
|
|
55
55
|
* Gives the extension params shape for the given extension slot name.
|
|
56
56
|
*/
|
|
57
|
-
export
|
|
57
|
+
export type ExtensionParams<TName> = TName extends keyof PiralExtensionSlotMap ? PiralExtensionSlotMap[TName] : TName extends string ? any : TName;
|
|
58
58
|
/**
|
|
59
59
|
* The props for defining an extension slot.
|
|
60
60
|
*/
|
|
61
|
-
export
|
|
61
|
+
export type ExtensionSlotProps<TName = string> = BaseExtensionSlotProps<TName extends string ? TName : string, ExtensionParams<TName>>;
|
package/esm/types/layout.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The mapping of breakpoints to layout type index.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type LayoutBreakpoints = [string, string, string];
|
|
5
5
|
/**
|
|
6
6
|
* The different known layout types.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type LayoutType = 'mobile' | 'tablet' | 'desktop';
|
|
9
9
|
/**
|
|
10
10
|
* The mapping of the layout types to breakpoint index.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type LayoutTypes = [LayoutType, LayoutType, LayoutType];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Disposable } from './utils';
|
|
2
|
-
export
|
|
2
|
+
export type NavigationAction = 'POP' | 'PUSH' | 'REPLACE';
|
|
3
3
|
export interface NavigationLocation {
|
|
4
4
|
/**
|
|
5
5
|
* The fully qualified URL incl. the origin and base path.
|
package/esm/types/state.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import type { ComponentConverters, LoadingIndicatorProps, ErrorInfoProps, Router
|
|
|
11
11
|
export interface StateDispatcher<TState> {
|
|
12
12
|
(state: TState): Partial<TState>;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export type WrappedComponent<TProps> = ComponentType<PropsWithChildren<Without<TProps, keyof BaseComponentProps>>>;
|
|
15
15
|
/**
|
|
16
16
|
* The base type for pilet component registration in the global state context.
|
|
17
17
|
*/
|
|
@@ -112,7 +112,7 @@ export interface RegistryState extends PiralCustomRegistryState {
|
|
|
112
112
|
*/
|
|
113
113
|
wrappers: Dict<ComponentType<any>>;
|
|
114
114
|
}
|
|
115
|
-
export
|
|
115
|
+
export type ErrorComponentsState = {
|
|
116
116
|
[P in keyof Errors]?: ComponentType<Errors[P]>;
|
|
117
117
|
};
|
|
118
118
|
/**
|
|
@@ -165,7 +165,7 @@ export interface PiralAction<T extends (...args: any) => any> {
|
|
|
165
165
|
/**
|
|
166
166
|
* A subset of the available app actions in Piral.
|
|
167
167
|
*/
|
|
168
|
-
export
|
|
168
|
+
export type PiralDefineActions = Partial<{
|
|
169
169
|
[P in keyof PiralActions]: PiralAction<PiralActions[P]>;
|
|
170
170
|
}>;
|
|
171
171
|
/**
|
package/lib/types/api.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ export interface PiralPageMeta extends PiralCustomPageMeta {
|
|
|
73
73
|
/**
|
|
74
74
|
* Shorthand for the definition of an extension component.
|
|
75
75
|
*/
|
|
76
|
-
export
|
|
76
|
+
export type AnyExtensionComponent<TName> = TName extends keyof PiralExtensionSlotMap ? AnyComponent<ExtensionComponentProps<TName>> : TName extends string ? AnyComponent<ExtensionComponentProps<any>> : AnyComponent<ExtensionComponentProps<TName>>;
|
|
77
77
|
/**
|
|
78
78
|
* Defines the Pilet API from piral-core.
|
|
79
79
|
* This interface will be consumed by pilet developers so that their pilet can interact with the piral instance.
|
package/lib/types/common.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ValuesOf<T> = T extends {
|
|
2
2
|
[_ in keyof T]: infer U;
|
|
3
3
|
} ? U : never;
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
4
|
+
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
5
|
+
export type RemainingArgs<T> = T extends (_: any, ...args: infer U) => any ? U : never;
|
|
6
|
+
export type DeepPartial<T> = {
|
|
7
7
|
[P in keyof T]?: T[P] extends Array<infer U> ? Array<DeepPartial<U>> : T[P] extends {} ? DeepPartial<T[P]> : T[P];
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type NestedPartial<T> = {
|
|
10
10
|
[P in keyof T]?: T[P] extends Array<infer U> ? Array<Partial<U>> : T[P] extends {} ? Partial<T[P]> : T[P];
|
|
11
11
|
};
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
12
|
+
export type Dict<T> = Record<string, T>;
|
|
13
|
+
export type Without<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
14
|
+
export type FirstParameter<T extends (arg: any) => any> = T extends (arg: infer P) => any ? P : never;
|
|
15
|
+
export type FirstParametersOf<T> = {
|
|
16
16
|
[K in keyof T]: T[K] extends (arg: any) => any ? FirstParameter<T[K]> : never;
|
|
17
17
|
}[keyof T];
|
|
18
|
-
export
|
|
18
|
+
export type UnionOf<T> = {
|
|
19
19
|
[K in keyof T]: T[K];
|
|
20
20
|
}[keyof T];
|
|
21
|
-
export
|
|
21
|
+
export type MaybeAsync<T> = T | (() => Promise<T>);
|
|
@@ -75,7 +75,7 @@ export interface ForeignComponent<TProps> {
|
|
|
75
75
|
/**
|
|
76
76
|
* Possible shapes for a component.
|
|
77
77
|
*/
|
|
78
|
-
export
|
|
78
|
+
export type AnyComponent<T> = ComponentType<T> | FirstParametersOf<ComponentConverters<T>>;
|
|
79
79
|
/**
|
|
80
80
|
* The error used when a route cannot be resolved.
|
|
81
81
|
*/
|
|
@@ -177,7 +177,7 @@ export interface Errors extends PiralCustomErrors {
|
|
|
177
177
|
/**
|
|
178
178
|
* The props for the ErrorInfo component.
|
|
179
179
|
*/
|
|
180
|
-
export
|
|
180
|
+
export type ErrorInfoProps = UnionOf<Errors>;
|
|
181
181
|
/**
|
|
182
182
|
* The props of a Loading indicator component.
|
|
183
183
|
*/
|
package/lib/types/config.d.ts
CHANGED
|
@@ -91,4 +91,4 @@ export interface PiralStateConfiguration {
|
|
|
91
91
|
/**
|
|
92
92
|
* The configuration to be used in the Piral instance.
|
|
93
93
|
*/
|
|
94
|
-
export
|
|
94
|
+
export type PiralConfiguration = PiralPiletConfiguration & PiralStateConfiguration;
|
package/lib/types/data.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface SharedData<TValue = any> {
|
|
|
10
10
|
/**
|
|
11
11
|
* Defines the potential targets when storing data.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type DataStoreTarget = 'memory' | 'local' | 'remote';
|
|
14
14
|
/**
|
|
15
15
|
* Defines the custom options for storing data.
|
|
16
16
|
*/
|
|
@@ -27,7 +27,7 @@ export interface CustomDataStoreOptions {
|
|
|
27
27
|
/**
|
|
28
28
|
* Defines the options to be used for storing data.
|
|
29
29
|
*/
|
|
30
|
-
export
|
|
30
|
+
export type DataStoreOptions = DataStoreTarget | CustomDataStoreOptions;
|
|
31
31
|
/**
|
|
32
32
|
* Defines the shape of a shared data item.
|
|
33
33
|
*/
|
package/lib/types/extension.d.ts
CHANGED
|
@@ -54,8 +54,8 @@ export interface BaseExtensionSlotProps<TName, TParams> {
|
|
|
54
54
|
/**
|
|
55
55
|
* Gives the extension params shape for the given extension slot name.
|
|
56
56
|
*/
|
|
57
|
-
export
|
|
57
|
+
export type ExtensionParams<TName> = TName extends keyof PiralExtensionSlotMap ? PiralExtensionSlotMap[TName] : TName extends string ? any : TName;
|
|
58
58
|
/**
|
|
59
59
|
* The props for defining an extension slot.
|
|
60
60
|
*/
|
|
61
|
-
export
|
|
61
|
+
export type ExtensionSlotProps<TName = string> = BaseExtensionSlotProps<TName extends string ? TName : string, ExtensionParams<TName>>;
|
package/lib/types/layout.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The mapping of breakpoints to layout type index.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type LayoutBreakpoints = [string, string, string];
|
|
5
5
|
/**
|
|
6
6
|
* The different known layout types.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type LayoutType = 'mobile' | 'tablet' | 'desktop';
|
|
9
9
|
/**
|
|
10
10
|
* The mapping of the layout types to breakpoint index.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type LayoutTypes = [LayoutType, LayoutType, LayoutType];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Disposable } from './utils';
|
|
2
|
-
export
|
|
2
|
+
export type NavigationAction = 'POP' | 'PUSH' | 'REPLACE';
|
|
3
3
|
export interface NavigationLocation {
|
|
4
4
|
/**
|
|
5
5
|
* The fully qualified URL incl. the origin and base path.
|
package/lib/types/state.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import type { ComponentConverters, LoadingIndicatorProps, ErrorInfoProps, Router
|
|
|
11
11
|
export interface StateDispatcher<TState> {
|
|
12
12
|
(state: TState): Partial<TState>;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export type WrappedComponent<TProps> = ComponentType<PropsWithChildren<Without<TProps, keyof BaseComponentProps>>>;
|
|
15
15
|
/**
|
|
16
16
|
* The base type for pilet component registration in the global state context.
|
|
17
17
|
*/
|
|
@@ -112,7 +112,7 @@ export interface RegistryState extends PiralCustomRegistryState {
|
|
|
112
112
|
*/
|
|
113
113
|
wrappers: Dict<ComponentType<any>>;
|
|
114
114
|
}
|
|
115
|
-
export
|
|
115
|
+
export type ErrorComponentsState = {
|
|
116
116
|
[P in keyof Errors]?: ComponentType<Errors[P]>;
|
|
117
117
|
};
|
|
118
118
|
/**
|
|
@@ -165,7 +165,7 @@ export interface PiralAction<T extends (...args: any) => any> {
|
|
|
165
165
|
/**
|
|
166
166
|
* A subset of the available app actions in Piral.
|
|
167
167
|
*/
|
|
168
|
-
export
|
|
168
|
+
export type PiralDefineActions = Partial<{
|
|
169
169
|
[P in keyof PiralActions]: PiralAction<PiralActions[P]>;
|
|
170
170
|
}>;
|
|
171
171
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-core",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.12-beta.5528",
|
|
4
4
|
"description": "The core library for creating a Piral instance.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"portal",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"piral-base": "0.15.
|
|
76
|
-
"piral-debug-utils": "0.15.
|
|
75
|
+
"piral-base": "0.15.12-beta.5528",
|
|
76
|
+
"piral-debug-utils": "0.15.12-beta.5528",
|
|
77
77
|
"zustand": "^3.0.0"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
"react-router-dom",
|
|
100
100
|
"tslib"
|
|
101
101
|
],
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "6d97a2baca7ae3e5fb19a754ba55d44b40ed137e"
|
|
103
103
|
}
|