28 lines
1.2 KiB
TypeScript
28 lines
1.2 KiB
TypeScript
import type { AdminSortBy } from './userRepository';
|
|
import type { UserListRow } from '../dto';
|
|
export type AdminSortDir = 'asc' | 'desc';
|
|
export type AdminListCursor = {
|
|
sortBy: AdminSortBy;
|
|
sortDir: AdminSortDir;
|
|
keys: (string | number | boolean | null)[];
|
|
};
|
|
export type AdminListPageResult = {
|
|
users: UserListRow[];
|
|
total: number | null;
|
|
totalIsExact: boolean;
|
|
nextCursor: string | null;
|
|
hasMore: boolean;
|
|
};
|
|
/** Opaque cursor token (base64url JSON). */
|
|
export declare function encodeAdminListCursor(cursor: AdminListCursor): string;
|
|
export declare function decodeAdminListCursor(token: string): AdminListCursor | null;
|
|
export declare function buildCursorFromRow(sortBy: AdminSortBy, sortDir: AdminSortDir, row: UserListRow): string;
|
|
/**
|
|
* Keyset condition for rows strictly after `cursor` in the current sort order.
|
|
*/
|
|
export declare function buildKeysetSql(sortBy: AdminSortBy, sortDir: AdminSortDir, cursor: AdminListCursor, values: unknown[], paramStart: number): {
|
|
sql: string;
|
|
nextParam: number;
|
|
};
|
|
export declare function adminListOrderBySql(sortBy: AdminSortBy, sortDir: AdminSortDir): string;
|
|
//# sourceMappingURL=adminListCursor.d.ts.map
|