-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtypes.d.ts
33 lines (26 loc) · 888 Bytes
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import type { AppProps } from "next/app";
import type { NextComponentType, NextPageContext } from "next";
import * as React from "react";
/** To be or not to be... */
export type Maybe<T> = T | void;
export type Optional<T> = T | undefined;
export type Nullable<T> = Optional<T> | null;
export type GetLayout = () => (page: React.ReactNode) => React.ReactNode;
export type NextComponentTypeWithLayout<P = Record<string, never>> =
NextComponentType<NextPageContext, unknown, P> & {
getLayout?: GetLayout;
};
export type NextPageWithLayout<
P = Record<string, never>,
IP = P
> = NextComponentType<NextPageContext, IP, P> & {
getLayout?: GetLayout;
};
export type AppPropsWithLayout<P = Record<string, never>> = AppProps<P> & {
Component: NextComponentTypeWithLayout<P>;
};
export interface MDXMeta {
title: string;
description: string;
getLayout?: GetLayout;
}