/** * React higher-order component (HoC) which wraps the App component, captures any exceptions thrown * in `getInitialProps`, and emits them to Sentry. * * See also: * - https://reactjs.org/docs/higher-order-components.html * - https://github.com/zeit/next.js/blob/1babde1026a89b538d2caebd5d74ef6351871566/examples/with-apollo/lib/with-apollo-client.js */ import { NextComponentType } from 'next'; import { AppInitialProps } from 'next/app'; import * as React from 'react'; import { CaptureExceptionFn } from './initSentry'; export interface AppWithSentryInitialProps extends AppInitialProps { wrappedAppInitialProps: TWrappedAppInitialProps; } /** * @param captureException * A function which emits the passed exception to Sentry when called. * @template TWrappedAppParams * The parameters which WrappedApp expects via props _and_ getInitialProps context. For example, * WrappedApp may expect a `cookies` parameter as `ctx.cookies` and `props.cookies`. * @template TWrappedAppInitialProps * The initial props returned by WrappedApp.getInitialProps(). By default, this is AppInitialProps, * but may be extended by WrappedApp. */ declare const appWithSentry: (captureException: CaptureExceptionFn) => (WrappedApp: NextComponentType & TWrappedAppParams, TWrappedAppInitialProps, AppInitialProps & { Component: NextComponentType; router: import("next/router").Router; } & TWrappedAppParams & TWrappedAppInitialProps>) => React.ComponentClass; router: import("next/router").Router; } & TWrappedAppParams & AppWithSentryInitialProps, any> & { getInitialProps?(context: import("next/dist/next-server/lib/utils").AppContextType & TWrappedAppParams): AppWithSentryInitialProps | Promise>; }; export default appWithSentry;