///
import { IncomingMessage } from "http";
import { ParsedUrlQuery } from "querystring";
import { ReactNode } from "react";
import { AppContext, AppInitialProps, AppProps } from "next/app";
import { DehydratedState } from "./GlobalAppState";
import { GlobalAppStatePropertyParameters } from "./GlobalAppStateProperty";
/**
* An object literal. All fields are optional.
*/
interface AppFactoryOptions {
/**
* You can pass a Next.js `Head` component here
* that will be included in every page.
*/
Head?: ReactNode;
/**
* Any component that wraps its children. Here
* you can inject UI that persists across all
* the site's pages.
*/
Wrapper?: (props: {
children: ReactNode;
}) => JSX.Element;
/**
* An array of objects describing the global app state properties
* that `appFactory` will implement into the `App` component.
* Read the documentation for `GlobalAppStatePropertyParameters`
* for more on what the objects should look like.
*/
properties?: GlobalAppStatePropertyParameters[];
}
interface App {
(props: AppInitialPropsExtended & AppProps): JSX.Element;
getInitialProps(appContext: AppContext): Promise;
getInitialState(req: IncomingMessage): Promise;
getURLParams(query: ParsedUrlQuery): Promise;
}
interface AppInitialPropsExtended extends AppInitialProps {
dehydratedState: DehydratedState;
urlParams: URLParams;
}
export interface URLParams {
[key: string]: string;
}
/**
* Function that returns a Next.js custom `App` component.
* Takes an optional argument where you can specify
* options to customize the output of the factory.
* @param options An optional argument where you can specify options to customize the output of the factory
* @return A Next.js custom `App` component
*/
declare function appFactory(options?: AppFactoryOptions): App;
export default appFactory;
//# sourceMappingURL=index.d.ts.map