@tramvai/react 2.40.0 → 2.45.0
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.
|
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
|
|
|
2
2
|
import type { Url } from '@tinkoff/url';
|
|
3
3
|
import type { ExtractDependencyType } from '@tinkoff/dippy';
|
|
4
4
|
import type { ERROR_BOUNDARY_TOKEN } from './tokens';
|
|
5
|
-
|
|
5
|
+
type AnyError = Error & {
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
};
|
|
8
8
|
export interface UniversalErrorBoundaryFallbackProps {
|
|
@@ -24,7 +24,7 @@ interface State {
|
|
|
24
24
|
error: AnyError | null;
|
|
25
25
|
url: Url;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
type Props = UniversalErrorBoundaryProps;
|
|
28
28
|
export declare class UniversalErrorBoundary extends Component<Props, State> {
|
|
29
29
|
constructor(props: Props);
|
|
30
30
|
static displayName: string;
|
package/lib/error/tokens.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { UniversalErrorBoundaryFallbackProps } from './UniversalErrorBoundary';
|
|
3
|
-
|
|
3
|
+
type ErrorBoundaryHandler = (error: Error, errorInfo: React.ErrorInfo) => void;
|
|
4
4
|
export declare const ERROR_BOUNDARY_TOKEN: import("@tinkoff/dippy").MultiTokenInterface<ErrorBoundaryHandler>;
|
|
5
5
|
export declare const ROOT_ERROR_BOUNDARY_COMPONENT_TOKEN: import("@tinkoff/dippy").BaseTokenInterface<React.ComponentType<UniversalErrorBoundaryFallbackProps>>;
|
|
6
6
|
/**
|
|
@@ -1,7 +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
|
-
export
|
|
4
|
+
export type LazyComponentWrapper<Component extends ComponentType<any>> = {
|
|
5
5
|
load: (props?: Component extends ComponentType<infer Props> ? Props : {}) => Promise<{
|
|
6
6
|
default: Component;
|
|
7
7
|
}>;
|
|
@@ -13,7 +13,7 @@ export interface PageComponentOptions {
|
|
|
13
13
|
}
|
|
14
14
|
export interface PageComponentProps {
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export type PageComponent = ComponentType<PageComponentProps> & Partial<PageComponentOptions>;
|
|
17
17
|
export interface LayoutComponentOptions {
|
|
18
18
|
}
|
|
19
19
|
export interface LayoutComponentProps {
|
|
@@ -21,6 +21,14 @@ export interface LayoutComponentProps {
|
|
|
21
21
|
Footer: ComponentType;
|
|
22
22
|
children?: ReactNode;
|
|
23
23
|
}
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
|
|
24
|
+
export type LayoutComponent = ComponentType<LayoutComponentProps> & Partial<LayoutComponentOptions>;
|
|
25
|
+
export interface NestedLayoutComponentOptions {
|
|
26
|
+
actions?: PageAction[];
|
|
27
|
+
reducers?: Reducer<any, any>[];
|
|
28
|
+
}
|
|
29
|
+
export interface NestedLayoutComponentProps {
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
export type NestedLayoutComponent = ComponentType<NestedLayoutComponentProps> & Partial<NestedLayoutComponentOptions>;
|
|
33
|
+
export type TramvaiComponent = PageComponent | LayoutComponent | NestedLayoutComponent;
|
|
34
|
+
export type TramvaiComponentDecl = TramvaiComponent | LazyComponentWrapper<TramvaiComponent>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.45.0",
|
|
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.
|
|
23
|
+
"@tramvai/types-actions-state-context": "2.45.0",
|
|
24
24
|
"hoist-non-react-statics": "^3.3.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|