Skip to content

Commit 767ac75

Browse files
Add PaginatedResult Interface
Adding a `PaginatedResult` interface with generics to allow for better typed pagination between Laravel and Inertia/Vue
1 parent 56b3d93 commit 767ac75

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

resources/js/types/index.d.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,28 @@ export interface User {
3636
updated_at: string;
3737
}
3838

39+
export interface PaginatedResult<T> {
40+
data: T[];
41+
links: {
42+
first: string;
43+
last: string;
44+
next?: string;
45+
prev?: string;
46+
};
47+
meta: {
48+
current_page: number;
49+
from?: number;
50+
last_page: number;
51+
links: {
52+
active: boolean;
53+
label: string;
54+
url?: string;
55+
}[];
56+
path: string;
57+
per_page: number;
58+
to?: number;
59+
total: number;
60+
};
61+
};
62+
3963
export type BreadcrumbItemType = BreadcrumbItem;

0 commit comments

Comments
 (0)