@tramvai/react 2.59.4 → 2.61.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.
@@ -1,6 +1,7 @@
1
1
  import type { ComponentType, ReactNode } from 'react';
2
2
  import type { PageAction, Reducer } from '@tramvai/types-actions-state-context';
3
3
  import type { LoadableComponent } from '@loadable/component';
4
+ import type { UniversalErrorBoundaryFallbackProps } from '../error/UniversalErrorBoundary';
4
5
  export type LazyComponentWrapper<Component extends ComponentType<any>> = {
5
6
  load: (props?: Component extends ComponentType<infer Props> ? Props : {}) => Promise<{
6
7
  default: Component;
@@ -22,13 +23,14 @@ export interface LayoutComponentProps {
22
23
  children?: ReactNode;
23
24
  }
24
25
  export type LayoutComponent = ComponentType<LayoutComponentProps> & Partial<LayoutComponentOptions>;
25
- export interface NestedLayoutComponentOptions {
26
+ export interface MetaComponentOptions {
26
27
  actions?: PageAction[];
27
28
  reducers?: Reducer<any, any>[];
28
29
  }
29
30
  export interface NestedLayoutComponentProps {
30
31
  children?: ReactNode;
31
32
  }
32
- export type NestedLayoutComponent = ComponentType<NestedLayoutComponentProps> & Partial<NestedLayoutComponentOptions>;
33
- export type TramvaiComponent = PageComponent | LayoutComponent | NestedLayoutComponent;
33
+ export type NestedLayoutComponent = ComponentType<NestedLayoutComponentProps> & Partial<MetaComponentOptions>;
34
+ export type ErrorBoundaryComponent = ComponentType<UniversalErrorBoundaryFallbackProps> & Partial<MetaComponentOptions>;
35
+ export type TramvaiComponent = PageComponent | LayoutComponent | NestedLayoutComponent | ErrorBoundaryComponent;
34
36
  export type TramvaiComponentDecl = TramvaiComponent | LazyComponentWrapper<TramvaiComponent>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/react",
3
- "version": "2.59.4",
3
+ "version": "2.61.2",
4
4
  "description": "",
5
5
  "main": "lib/react.js",
6
6
  "typings": "lib/react.d.ts",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "@loadable/component": "^5.15.2",
22
22
  "@types/loadable__component": "^5.13.4",
23
- "@tramvai/types-actions-state-context": "2.59.4",
23
+ "@tramvai/types-actions-state-context": "2.61.2",
24
24
  "hoist-non-react-statics": "^3.3.0"
25
25
  },
26
26
  "peerDependencies": {