updated docs
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// Define request parameters interface without query
|
||||
interface ApiPaginationRequest {
|
||||
page: number;
|
||||
size: number;
|
||||
orderFields: string[];
|
||||
orderTypes: string[];
|
||||
}
|
||||
|
||||
// Define request parameters interface with query
|
||||
interface ApiPaginationRequestWithQuery extends ApiPaginationRequest {
|
||||
query: Record<string, string>;
|
||||
}
|
||||
|
||||
export type { ApiPaginationRequest, ApiPaginationRequestWithQuery };
|
||||
@@ -0,0 +1,31 @@
|
||||
// Define pagination interface
|
||||
interface ApiPaginationResponse {
|
||||
page: number;
|
||||
size: number;
|
||||
totalCount: number;
|
||||
allCount: number;
|
||||
totalPages: number;
|
||||
orderFields: string[];
|
||||
orderTypes: string[];
|
||||
pageCount: number;
|
||||
next: string;
|
||||
prev: string;
|
||||
}
|
||||
|
||||
// Define default response interface
|
||||
interface ApiDefaultResponse {
|
||||
completed: boolean;
|
||||
message: string;
|
||||
data?: Record<string, any> | null;
|
||||
}
|
||||
|
||||
// Define default response interface with pagination
|
||||
interface ApiDefaultResponseWithPagination extends ApiDefaultResponse {
|
||||
pagination?: ApiPaginationResponse | null;
|
||||
}
|
||||
|
||||
export type {
|
||||
ApiPaginationResponse,
|
||||
ApiDefaultResponse,
|
||||
ApiDefaultResponseWithPagination,
|
||||
};
|
||||
@@ -0,0 +1,54 @@
|
||||
import { LanguageTypes } from "@/validations/mutual/language/validations";
|
||||
|
||||
type ParamsType = { page: string[] | undefined };
|
||||
|
||||
interface MaindasboardPageProps {
|
||||
params: Promise<ParamsType>;
|
||||
searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
|
||||
}
|
||||
|
||||
interface DashboardLayoutProps {
|
||||
params: ParamsType;
|
||||
searchParams: { [key: string]: string | string[] | undefined };
|
||||
lang: LanguageTypes;
|
||||
}
|
||||
|
||||
type ModeTypes = "shortList" | "fullList" | "create" | "update" | "view";
|
||||
const ModeTypesList = ["shortList", "fullList", "create", "update", "view"];
|
||||
|
||||
interface ContentProps {
|
||||
lang: LanguageTypes;
|
||||
translations: Record<string, string>;
|
||||
activePageUrl: string;
|
||||
isMulti?: boolean;
|
||||
mode?: ModeTypes;
|
||||
}
|
||||
|
||||
interface MenuProps {
|
||||
lang: LanguageTypes;
|
||||
menuItems: Record<string, Record<string, any>>;
|
||||
activePageUrl: string;
|
||||
menuTranslationsFlatten: Record<string, Record<string, any>>;
|
||||
}
|
||||
|
||||
interface FooterProps {
|
||||
translations: Record<string, string>;
|
||||
}
|
||||
|
||||
interface HeaderProps {
|
||||
translations: Record<string, string>;
|
||||
lang: LanguageTypes;
|
||||
activePageUrl: string;
|
||||
}
|
||||
|
||||
export type {
|
||||
MaindasboardPageProps,
|
||||
DashboardLayoutProps,
|
||||
ContentProps,
|
||||
MenuProps,
|
||||
FooterProps,
|
||||
HeaderProps,
|
||||
ModeTypes,
|
||||
};
|
||||
|
||||
export { ModeTypesList };
|
||||
@@ -0,0 +1,44 @@
|
||||
interface FetcherRequest {
|
||||
url: string;
|
||||
isNoCache: boolean;
|
||||
}
|
||||
|
||||
interface PostFetcherRequest<T> extends FetcherRequest {
|
||||
body: Record<string, T>;
|
||||
}
|
||||
|
||||
interface GetFetcherRequest extends FetcherRequest {
|
||||
url: string;
|
||||
}
|
||||
|
||||
interface DeleteFetcherRequest extends GetFetcherRequest {}
|
||||
interface PutFetcherRequest<T> extends PostFetcherRequest<T> {}
|
||||
interface PatchFetcherRequest<T> extends PostFetcherRequest<T> {}
|
||||
|
||||
interface FetcherRespose {
|
||||
success: boolean;
|
||||
}
|
||||
interface PaginationResponse {
|
||||
onPage: number;
|
||||
onPageCount: number;
|
||||
totalPage: number;
|
||||
totalCount: number;
|
||||
next: boolean;
|
||||
back: boolean;
|
||||
}
|
||||
|
||||
interface FetcherDataResponse<T> extends FetcherRespose {
|
||||
data: Record<string, T> | null;
|
||||
pagination?: PaginationResponse;
|
||||
}
|
||||
|
||||
export type {
|
||||
FetcherRequest,
|
||||
PostFetcherRequest,
|
||||
GetFetcherRequest,
|
||||
DeleteFetcherRequest,
|
||||
PutFetcherRequest,
|
||||
PatchFetcherRequest,
|
||||
FetcherRespose,
|
||||
FetcherDataResponse,
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
interface UpdateFormProps {
|
||||
schemas: Record<string, any>;
|
||||
selectedRow: Record<string, any>;
|
||||
rollbackTo: string;
|
||||
labels: Record<string, string>;
|
||||
}
|
||||
interface CreateFormProps {
|
||||
schemas: Record<string, any>;
|
||||
selectedRow: Record<string, any>;
|
||||
labels: Record<string, string>;
|
||||
}
|
||||
|
||||
interface ViewFormProps {
|
||||
schemas: Record<string, any>;
|
||||
selectedRow: Record<string, any>;
|
||||
rollbackTo: string;
|
||||
labels: Record<string, string>;
|
||||
}
|
||||
|
||||
export type { UpdateFormProps, CreateFormProps, ViewFormProps };
|
||||
@@ -0,0 +1,3 @@
|
||||
type LanguageTypes = "en" | "tr";
|
||||
|
||||
export type { LanguageTypes };
|
||||
@@ -0,0 +1,19 @@
|
||||
interface ClientMenuProps {
|
||||
siteUrls: string[];
|
||||
lang?: string;
|
||||
activePage?: string;
|
||||
}
|
||||
|
||||
interface UserSelection {
|
||||
userType: string;
|
||||
selected: any;
|
||||
}
|
||||
|
||||
interface DynamicPage {
|
||||
header: Record<string, any>;
|
||||
menu: Record<string, any>;
|
||||
content: Record<string, any>;
|
||||
footer: Record<string, any>;
|
||||
}
|
||||
|
||||
export type { ClientMenuProps, UserSelection, DynamicPage };
|
||||
@@ -0,0 +1,29 @@
|
||||
interface LowerPaginationProps {
|
||||
pagination: any;
|
||||
handleBack: () => void;
|
||||
handleNext: () => void;
|
||||
}
|
||||
|
||||
interface PaginationProps {
|
||||
apiPagination: any;
|
||||
pagination: any;
|
||||
setPagination: (pagination: any) => void;
|
||||
defaultPagination: any;
|
||||
}
|
||||
|
||||
interface PaginationDetailsProps {
|
||||
pagination: any;
|
||||
setPagination: (pagination: any) => void;
|
||||
defaultPagination: any;
|
||||
}
|
||||
interface PaginationShowProps {
|
||||
apiPagination: any;
|
||||
}
|
||||
|
||||
|
||||
export type {
|
||||
PaginationProps,
|
||||
LowerPaginationProps,
|
||||
PaginationDetailsProps,
|
||||
PaginationShowProps,
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
interface ResolverProps {
|
||||
activePageUrl: string;
|
||||
}
|
||||
|
||||
export type { ResolverProps };
|
||||
@@ -0,0 +1,34 @@
|
||||
import { ApiPaginationRequestWithQuery } from "@/validations/mutual/api/requests/validations";
|
||||
|
||||
interface TableProps {
|
||||
data: any;
|
||||
orgData: any;
|
||||
columns: string[];
|
||||
translations?: Record<string, string>;
|
||||
redirectUrls?: Record<string, Record<string, React.ReactNode>>;
|
||||
setSelectedRow?: React.Dispatch<React.SetStateAction<any>>;
|
||||
}
|
||||
|
||||
interface TableComponentProps {
|
||||
urls: Record<string, string>;
|
||||
schemas: Record<string, any>;
|
||||
translations: Record<string, string>;
|
||||
columns: Record<string, any>;
|
||||
redirectUrls: Record<string, Record<string, React.ReactNode>>;
|
||||
initPagination?: ApiPaginationRequestWithQuery;
|
||||
setSelectedRow?: React.Dispatch<React.SetStateAction<any>>;
|
||||
RenderListChangeSize?: React.ReactNode;
|
||||
}
|
||||
|
||||
interface TableCardProps {
|
||||
data: any;
|
||||
columns: string[];
|
||||
translations?: Record<string, string>;
|
||||
}
|
||||
|
||||
interface SearchProps {
|
||||
pagination: any;
|
||||
setPagination: (pagination: any) => void;
|
||||
}
|
||||
|
||||
export type { TableProps, TableComponentProps, TableCardProps, SearchProps };
|
||||
Reference in New Issue
Block a user