piral-core 1.10.2-beta.c944cfd → 1.10.2-beta.dc71cd5
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/lib/types/api.d.ts +2 -37
- package/package.json +4 -4
- package/src/types/api.ts +5 -39
package/lib/types/api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { RouteComponentProps } from 'react-router';
|
|
3
3
|
import type { PiletApi, Pilet, PiletEntry, PiletEntries, PiletMetadata, EventEmitter, PiletLoader, PiletLoadingStrategy } from 'piral-base';
|
|
4
4
|
import type { PiletCustomApi } from './custom';
|
|
5
5
|
import type { AnyComponent, PiralPageMeta } from './components';
|
|
@@ -38,47 +38,12 @@ export interface ExtensionComponentProps<T> extends BaseComponentProps {
|
|
|
38
38
|
*/
|
|
39
39
|
children?: ReactNode;
|
|
40
40
|
}
|
|
41
|
-
/**
|
|
42
|
-
* The match object determining what exactly has been matched for the current navigation.
|
|
43
|
-
*/
|
|
44
|
-
export interface RouteMatch<Params extends {
|
|
45
|
-
[K in keyof Params]?: string;
|
|
46
|
-
} = {}> {
|
|
47
|
-
/**
|
|
48
|
-
* The parameters extracted from the current navigation.
|
|
49
|
-
*/
|
|
50
|
-
params: Params;
|
|
51
|
-
/**
|
|
52
|
-
* Indicates if the parameters have been matched exactly.
|
|
53
|
-
*/
|
|
54
|
-
isExact: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* The relative path.
|
|
57
|
-
*/
|
|
58
|
-
path: string;
|
|
59
|
-
/**
|
|
60
|
-
* The fully qualified URL.
|
|
61
|
-
*/
|
|
62
|
-
url: string;
|
|
63
|
-
}
|
|
64
41
|
/**
|
|
65
42
|
* The props that every registered page component obtains.
|
|
66
43
|
*/
|
|
67
44
|
export interface RouteBaseProps<UrlParams extends {
|
|
68
45
|
[K in keyof UrlParams]?: string;
|
|
69
|
-
} = {}, UrlState = any> extends BaseComponentProps {
|
|
70
|
-
/**
|
|
71
|
-
* The history API to navigate.
|
|
72
|
-
*/
|
|
73
|
-
history: History<UrlState>;
|
|
74
|
-
/**
|
|
75
|
-
* Information about the current location.
|
|
76
|
-
*/
|
|
77
|
-
location: Location<UrlState>;
|
|
78
|
-
/**
|
|
79
|
-
* Information about the matching of the current route.
|
|
80
|
-
*/
|
|
81
|
-
match: RouteMatch<UrlParams>;
|
|
46
|
+
} = {}, UrlState = any> extends RouteComponentProps<UrlParams, {}, UrlState>, BaseComponentProps {
|
|
82
47
|
}
|
|
83
48
|
/**
|
|
84
49
|
* The props used by a page component.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-core",
|
|
3
|
-
"version": "1.10.2-beta.
|
|
3
|
+
"version": "1.10.2-beta.dc71cd5",
|
|
4
4
|
"description": "The core library for creating a Piral instance.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"portal",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"piral-base": "1.10.2-beta.
|
|
67
|
-
"piral-debug-utils": "1.10.2-beta.
|
|
66
|
+
"piral-base": "1.10.2-beta.dc71cd5",
|
|
67
|
+
"piral-debug-utils": "1.10.2-beta.dc71cd5",
|
|
68
68
|
"zustand": "^3.0.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"react-router-dom",
|
|
85
85
|
"tslib"
|
|
86
86
|
],
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "dc71cd52424153bf2a1b56e05ccf03d6ad2a3fd8"
|
|
88
88
|
}
|
package/src/types/api.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { RouteComponentProps } from 'react-router';
|
|
3
3
|
import type {
|
|
4
4
|
PiletApi,
|
|
5
5
|
Pilet,
|
|
@@ -53,46 +53,12 @@ export interface ExtensionComponentProps<T> extends BaseComponentProps {
|
|
|
53
53
|
children?: ReactNode;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
/**
|
|
57
|
-
* The match object determining what exactly has been matched for the current navigation.
|
|
58
|
-
*/
|
|
59
|
-
export interface RouteMatch<Params extends { [K in keyof Params]?: string } = {}> {
|
|
60
|
-
/**
|
|
61
|
-
* The parameters extracted from the current navigation.
|
|
62
|
-
*/
|
|
63
|
-
params: Params;
|
|
64
|
-
/**
|
|
65
|
-
* Indicates if the parameters have been matched exactly.
|
|
66
|
-
*/
|
|
67
|
-
isExact: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* The relative path.
|
|
70
|
-
*/
|
|
71
|
-
path: string;
|
|
72
|
-
/**
|
|
73
|
-
* The fully qualified URL.
|
|
74
|
-
*/
|
|
75
|
-
url: string;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
56
|
/**
|
|
79
57
|
* The props that every registered page component obtains.
|
|
80
58
|
*/
|
|
81
59
|
export interface RouteBaseProps<UrlParams extends { [K in keyof UrlParams]?: string } = {}, UrlState = any>
|
|
82
|
-
extends
|
|
83
|
-
|
|
84
|
-
* The history API to navigate.
|
|
85
|
-
*/
|
|
86
|
-
history: History<UrlState>;
|
|
87
|
-
/**
|
|
88
|
-
* Information about the current location.
|
|
89
|
-
*/
|
|
90
|
-
location: Location<UrlState>;
|
|
91
|
-
/**
|
|
92
|
-
* Information about the matching of the current route.
|
|
93
|
-
*/
|
|
94
|
-
match: RouteMatch<UrlParams>;
|
|
95
|
-
}
|
|
60
|
+
extends RouteComponentProps<UrlParams, {}, UrlState>,
|
|
61
|
+
BaseComponentProps {}
|
|
96
62
|
|
|
97
63
|
/**
|
|
98
64
|
* The props used by a page component.
|
|
@@ -114,8 +80,8 @@ export interface PageComponentProps<T extends { [K in keyof T]?: string } = {},
|
|
|
114
80
|
export type AnyExtensionComponent<TName> = TName extends keyof PiralExtensionSlotMap
|
|
115
81
|
? AnyComponent<ExtensionComponentProps<TName>>
|
|
116
82
|
: TName extends string
|
|
117
|
-
|
|
118
|
-
|
|
83
|
+
? AnyComponent<ExtensionComponentProps<any>>
|
|
84
|
+
: AnyComponent<ExtensionComponentProps<TName>>;
|
|
119
85
|
|
|
120
86
|
/**
|
|
121
87
|
* Defines the Pilet API from piral-core.
|