@duongtrungnguyen/next-helper
Version:
Helper library for Next.js 15
61 lines (54 loc) • 1.37 kB
TypeScript
export * from "./auth";
export * from "./query";
export * from "./swr";
export * from "./components";
export * from "./hooks";
export * from "./utils";
//# sourceMappingURL=index.d.ts.map/* */
// Global environment variable definitions
type Env = {
NEXT_PUBLIC_API_BASE_URL: string;
NODE_ENV: "production" | "development";
NEXT_PUBLIC_AUTH_GLOBAL_PREFIX?: string;
NEXT_PUBLIC_LOGIN_ENDPOINT?: string;
NEXT_PUBLIC_LOGOUT_ENDPOINT?: string;
NEXT_PUBLIC_REFRESH_TOKEN_ENDPOINT?: string;
NEXT_PUBLIC_USER_ENDPOINT?: string;
NEXT_PUBLIC_ACCESS_TOKEN_PREFIX?: string;
NEXT_PUBLIC_REFRESH_TOKEN_PREFIX?: string;
NEXT_PUBLIC_AUTH_TOKEN_TYPE?: string;
};
type LibConfigs = {
baseUrl: string;
tokenType: string;
auth: {
globalPrefix: string;
endpoints: {
login: string;
logout: string;
refresh: string;
user: string;
};
cookies: {
accessToken: string;
refreshToken: string;
};
};
};
type RequestBody =
| Record<string, unknown>
| FormData
| URLSearchParams
| Blob
| ArrayBuffer
| null;
type BaseRequestConfigs = Omit<RequestInit, "body"> & {
query?: Record<string, string | number | undefined>;
rawResponse?: boolean;
};
type RequestConfigs<T extends boolean = false> = BaseRequestConfigs & {
rawResponse?: T;
};
declare namespace NodeJS {
interface ProcessEnv extends Env {}
}