@sentry/react 7.67.0 → 7.69.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.
- package/cjs/profiler.js +1 -3
- package/cjs/profiler.js.map +1 -1
- package/cjs/reactrouter.js +2 -2
- package/cjs/reactrouter.js.map +1 -1
- package/cjs/reactrouterv6.js +30 -26
- package/cjs/reactrouterv6.js.map +1 -1
- package/cjs/redux.js +18 -0
- package/cjs/redux.js.map +1 -1
- package/esm/profiler.js +1 -3
- package/esm/profiler.js.map +1 -1
- package/esm/reactrouter.js +2 -2
- package/esm/reactrouter.js.map +1 -1
- package/esm/reactrouterv6.js +30 -26
- package/esm/reactrouterv6.js.map +1 -1
- package/esm/redux.js +19 -1
- package/esm/redux.js.map +1 -1
- package/package.json +5 -5
- package/types/profiler.d.ts.map +1 -1
- package/types/reactrouterv6.d.ts.map +1 -1
- package/types/redux.d.ts +5 -0
- package/types/redux.d.ts.map +1 -1
- package/types-ts3.8/constants.d.ts +4 -0
- package/types-ts3.8/errorboundary.d.ts +70 -0
- package/types-ts3.8/index.d.ts +10 -0
- package/types-ts3.8/profiler.d.ts +60 -0
- package/types-ts3.8/reactrouter.d.ts +25 -0
- package/types-ts3.8/reactrouterv3.d.ts +26 -0
- package/types-ts3.8/reactrouterv6.d.ts +8 -0
- package/types-ts3.8/redux.d.ts +38 -0
- package/types-ts3.8/sdk.d.ts +6 -0
- package/types-ts3.8/types.d.ts +163 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Transaction, TransactionContext } from '@sentry/types';
|
|
3
|
+
export type Action = 'PUSH' | 'REPLACE' | 'POP';
|
|
4
|
+
export type Location = {
|
|
5
|
+
pathname: string;
|
|
6
|
+
action?: Action;
|
|
7
|
+
} & Record<string, any>;
|
|
8
|
+
export type ReactRouterInstrumentation = <T extends Transaction>(startTransaction: (context: TransactionContext) => T | undefined, startTransactionOnPageLoad?: boolean, startTransactionOnLocationChange?: boolean) => void;
|
|
9
|
+
export interface NonIndexRouteObject {
|
|
10
|
+
caseSensitive?: boolean;
|
|
11
|
+
children?: RouteObject[];
|
|
12
|
+
element?: React.ReactNode | null;
|
|
13
|
+
errorElement?: React.ReactNode | null;
|
|
14
|
+
index?: any;
|
|
15
|
+
path?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface IndexRouteObject {
|
|
18
|
+
caseSensitive?: boolean;
|
|
19
|
+
children?: undefined;
|
|
20
|
+
element?: React.ReactNode | null;
|
|
21
|
+
errorElement?: React.ReactNode | null;
|
|
22
|
+
index: any;
|
|
23
|
+
path?: string;
|
|
24
|
+
}
|
|
25
|
+
export type RouteObject = (IndexRouteObject | NonIndexRouteObject) & Record<string, any>;
|
|
26
|
+
export type Params<Key extends string = string> = {
|
|
27
|
+
readonly [key in Key]: string | undefined;
|
|
28
|
+
};
|
|
29
|
+
export type UseRoutes = (routes: RouteObject[], locationArg?: Partial<Location> | string) => React.ReactElement | null;
|
|
30
|
+
export interface RouteMatch<ParamKey extends string = string> {
|
|
31
|
+
/**
|
|
32
|
+
* The names and values of dynamic parameters in the URL.
|
|
33
|
+
*/
|
|
34
|
+
params: Params<ParamKey>;
|
|
35
|
+
/**
|
|
36
|
+
* The portion of the URL pathname that was matched.
|
|
37
|
+
*/
|
|
38
|
+
pathname: string;
|
|
39
|
+
/**
|
|
40
|
+
* The portion of the URL pathname that was matched before child routes.
|
|
41
|
+
*/
|
|
42
|
+
pathnameBase: string;
|
|
43
|
+
/**
|
|
44
|
+
* The route object that was used to match.
|
|
45
|
+
*/
|
|
46
|
+
route: RouteObject;
|
|
47
|
+
}
|
|
48
|
+
export type UseEffect = (cb: () => void, deps: unknown[]) => void;
|
|
49
|
+
export type UseLocation = () => Location;
|
|
50
|
+
export type UseNavigationType = () => Action;
|
|
51
|
+
export type RouteObjectArrayAlias = any;
|
|
52
|
+
export type RouteMatchAlias = any;
|
|
53
|
+
export type CreateRoutesFromChildren = (children: JSX.Element[]) => RouteObjectArrayAlias;
|
|
54
|
+
export type MatchRoutes = (routes: RouteObjectArrayAlias, location: Location, basename?: string) => RouteMatchAlias[] | null;
|
|
55
|
+
export type ShouldRevalidateFunction = (args: any) => boolean;
|
|
56
|
+
interface DataFunctionArgs {
|
|
57
|
+
request: Request;
|
|
58
|
+
params: Params;
|
|
59
|
+
}
|
|
60
|
+
type LoaderFunctionArgs = DataFunctionArgs;
|
|
61
|
+
type ActionFunctionArgs = DataFunctionArgs;
|
|
62
|
+
export interface LoaderFunction {
|
|
63
|
+
(args: LoaderFunctionArgs): Promise<Response> | Response | Promise<any> | any;
|
|
64
|
+
}
|
|
65
|
+
export interface ActionFunction {
|
|
66
|
+
(args: ActionFunctionArgs): Promise<Response> | Response | Promise<any> | any;
|
|
67
|
+
}
|
|
68
|
+
declare type AgnosticBaseRouteObject = {
|
|
69
|
+
caseSensitive?: boolean;
|
|
70
|
+
path?: string;
|
|
71
|
+
id?: string;
|
|
72
|
+
loader?: LoaderFunction;
|
|
73
|
+
action?: ActionFunction;
|
|
74
|
+
hasErrorBoundary?: boolean;
|
|
75
|
+
shouldRevalidate?: ShouldRevalidateFunction;
|
|
76
|
+
handle?: any;
|
|
77
|
+
};
|
|
78
|
+
export declare type AgnosticIndexRouteObject = AgnosticBaseRouteObject & Record<string, any>;
|
|
79
|
+
export declare type AgnosticNonIndexRouteObject = AgnosticBaseRouteObject & Record<string, any>;
|
|
80
|
+
export declare type AgnosticDataIndexRouteObject = AgnosticIndexRouteObject & {
|
|
81
|
+
id: string;
|
|
82
|
+
};
|
|
83
|
+
export declare type AgnosticDataNonIndexRouteObject = AgnosticNonIndexRouteObject & {
|
|
84
|
+
children?: AgnosticDataRouteObject[];
|
|
85
|
+
id: string;
|
|
86
|
+
};
|
|
87
|
+
export interface AgnosticRouteMatch<ParamKey extends string = string, RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject> {
|
|
88
|
+
params: Params<ParamKey>;
|
|
89
|
+
pathname: string;
|
|
90
|
+
pathnameBase: string;
|
|
91
|
+
route: RouteObjectType;
|
|
92
|
+
}
|
|
93
|
+
export type AgnosticDataRouteMatch = AgnosticRouteMatch<string, AgnosticDataRouteObject>;
|
|
94
|
+
interface UseMatchesMatch {
|
|
95
|
+
id: string;
|
|
96
|
+
pathname: string;
|
|
97
|
+
params: AgnosticRouteMatch['params'];
|
|
98
|
+
data: unknown;
|
|
99
|
+
handle: unknown;
|
|
100
|
+
}
|
|
101
|
+
export interface GetScrollRestorationKeyFunction {
|
|
102
|
+
(location: Location, matches: UseMatchesMatch[]): string | null;
|
|
103
|
+
}
|
|
104
|
+
export interface Path {
|
|
105
|
+
pathname: string;
|
|
106
|
+
search: string;
|
|
107
|
+
hash: string;
|
|
108
|
+
}
|
|
109
|
+
export interface RouterSubscriber<TState extends RouterState = RouterState> {
|
|
110
|
+
(state: TState): void;
|
|
111
|
+
}
|
|
112
|
+
export interface GetScrollPositionFunction {
|
|
113
|
+
(): number;
|
|
114
|
+
}
|
|
115
|
+
declare type LinkNavigateOptions = {
|
|
116
|
+
replace?: boolean;
|
|
117
|
+
state?: any;
|
|
118
|
+
preventScrollReset?: boolean;
|
|
119
|
+
};
|
|
120
|
+
export declare type AgnosticDataRouteObject = AgnosticDataIndexRouteObject | AgnosticDataNonIndexRouteObject;
|
|
121
|
+
export declare type To = string | Partial<Path>;
|
|
122
|
+
export declare type HydrationState = any;
|
|
123
|
+
export declare type FormMethod = 'get' | 'post' | 'put' | 'patch' | 'delete';
|
|
124
|
+
export declare type FormEncType = 'application/x-www-form-urlencoded' | 'multipart/form-data';
|
|
125
|
+
export declare type RouterNavigateOptions = LinkNavigateOptions | SubmissionNavigateOptions;
|
|
126
|
+
export declare type AgnosticRouteObject = AgnosticIndexRouteObject | AgnosticNonIndexRouteObject;
|
|
127
|
+
declare type SubmissionNavigateOptions = {
|
|
128
|
+
replace?: boolean;
|
|
129
|
+
state?: any;
|
|
130
|
+
formMethod?: FormMethod;
|
|
131
|
+
formEncType?: FormEncType;
|
|
132
|
+
formData: FormData;
|
|
133
|
+
};
|
|
134
|
+
export interface RouterInit {
|
|
135
|
+
basename: string;
|
|
136
|
+
routes: AgnosticRouteObject[];
|
|
137
|
+
history: History;
|
|
138
|
+
hydrationData?: HydrationState;
|
|
139
|
+
}
|
|
140
|
+
export type NavigationStates = {
|
|
141
|
+
Idle: any;
|
|
142
|
+
Loading: any;
|
|
143
|
+
Submitting: any;
|
|
144
|
+
};
|
|
145
|
+
export type Navigation = NavigationStates[keyof NavigationStates];
|
|
146
|
+
export type RouteData = any;
|
|
147
|
+
export type Fetcher = any;
|
|
148
|
+
export declare enum HistoryAction {
|
|
149
|
+
Pop = "POP",
|
|
150
|
+
Push = "PUSH",
|
|
151
|
+
Replace = "REPLACE"
|
|
152
|
+
}
|
|
153
|
+
export interface RouterState {
|
|
154
|
+
historyAction: Action | HistoryAction | any;
|
|
155
|
+
location: Location;
|
|
156
|
+
}
|
|
157
|
+
export interface Router<TState extends RouterState = RouterState> {
|
|
158
|
+
state: TState;
|
|
159
|
+
subscribe(fn: RouterSubscriber<TState>): () => void;
|
|
160
|
+
}
|
|
161
|
+
export type CreateRouterFunction<TState extends RouterState = RouterState, TRouter extends Router<TState> = Router<TState>> = (routes: RouteObject[], opts?: any) => TRouter;
|
|
162
|
+
export {};
|
|
163
|
+
//# sourceMappingURL=types.d.ts.map
|