@zengenti/contensis-react-base 4.0.0-beta.63 → 4.0.0-beta.64
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.
|
@@ -15,7 +15,7 @@ export type ContentTypeMapping = {
|
|
|
15
15
|
/**
|
|
16
16
|
* Optional entry mapper to transform entry data before passing it to the component.
|
|
17
17
|
*/
|
|
18
|
-
entryMapper?: EntryMapper
|
|
18
|
+
entryMapper?: EntryMapper<any, any>;
|
|
19
19
|
/**
|
|
20
20
|
* An array of field IDs used to restrict the fields returned for an entry.
|
|
21
21
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Entry } from 'contensis-delivery-api';
|
|
1
2
|
import { AppState } from './AppState';
|
|
2
3
|
import { RouteNode } from './RouteNode';
|
|
3
|
-
export type EntryMapper =
|
|
4
|
+
export type EntryMapper<MappedProps = any, RouteEntryType extends Entry = Entry> = (node: RouteNode<RouteEntryType>, state: AppState) => MappedProps | Promise<MappedProps>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { Node } from 'contensis-delivery-api';
|
|
2
|
-
export type RouteNode = Node & {
|
|
1
|
+
import { Entry, Node } from 'contensis-delivery-api';
|
|
2
|
+
export type RouteNode<T extends Entry = Entry> = Node<T> & {
|
|
3
3
|
ancestors: Node[];
|
|
4
4
|
children: Node[];
|
|
5
|
+
siblings: Node[];
|
|
6
|
+
entry: T;
|
|
5
7
|
};
|
|
@@ -45,7 +45,7 @@ export type StaticRoute = Omit<RouteObject, 'children'> & {
|
|
|
45
45
|
/**
|
|
46
46
|
* Optional entry mapper to transform entry data before passing it to the component.
|
|
47
47
|
*/
|
|
48
|
-
entryMapper?: EntryMapper
|
|
48
|
+
entryMapper?: EntryMapper<any, any>;
|
|
49
49
|
};
|
|
50
50
|
/** The depth of descendants to include for the node. */
|
|
51
51
|
fetchNodeLevel?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zengenti/contensis-react-base",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.64",
|
|
4
4
|
"repository": "https://github.com/zengenti/contensis-react-base",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"description": "Turbocharge your React web apps with Contensis. This package handles all dependencies for creating full featured web apps in React with Contensis and Site View. Routing is driven by Site View, Redux is used for global state management and server-side rendering (SSR) is handled for you. Also taking care of intricate hosting issues such as cache invalidation and supporting authenticated content where required.",
|