-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
39 lines (31 loc) · 857 Bytes
/
types.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
34
35
36
37
38
39
import { NextPage } from "next";
import { AppProps } from "next/app";
import { ReactElement, ReactNode } from "react";
export type TEnvironment = "production" | "development";
export type TNetworkType = "mainnet" | "testnet";
export type TPunkType = "cryptopunks" | "wrappedpunks";
/**
* Default API response without any data
*/
export interface DefaultRequestResponse {
success: boolean;
}
export interface BaseRequestResponse<Data = any> {
result: Data;
statusCode: number;
}
export interface BaseErrorResponse<R = any> {
error?: string;
statusCode: number;
message: string | string[];
data?: R;
}
export type AppPropsWithLayout = AppProps & {
Component: NextPageWithLayout;
};
export type NextPageWithLayout<P = Record<string, unknown>, IP = P> = NextPage<
P,
IP
> & {
getLayout?: (page: ReactElement<P>) => ReactNode;
};