Merge pull request #31166 from schultzp2020/constructor-parameters

refactor: convert constructor parameter properties for erasableSyntaxOnly compatibility
This commit is contained in:
Patrik Oldsberg
2025-10-15 18:56:42 +02:00
committed by GitHub
187 changed files with 1893 additions and 728 deletions
+1 -1
View File
@@ -518,7 +518,7 @@ export class WithPagination<
constructor(
createUrl: (options: PaginationOptions) => URL,
fetch: (url: URL) => Promise<TPage>,
pagelen?: number | undefined,
pagelen?: number,
);
// (undocumented)
getPage(options?: PaginationOptions): Promise<TPage>;
@@ -27,11 +27,19 @@ export class WithPagination<
TPage extends Models.Paginated<TResultItem>,
TResultItem,
> {
private readonly createUrl: (options: PaginationOptions) => URL;
private readonly fetch: (url: URL) => Promise<TPage>;
private readonly pagelen?: number;
constructor(
private readonly createUrl: (options: PaginationOptions) => URL,
private readonly fetch: (url: URL) => Promise<TPage>,
private readonly pagelen?: number,
) {}
createUrl: (options: PaginationOptions) => URL,
fetch: (url: URL) => Promise<TPage>,
pagelen?: number,
) {
this.createUrl = createUrl;
this.fetch = fetch;
this.pagelen = pagelen;
}
getPage(options?: PaginationOptions): Promise<TPage> {
const opts = { page: 1, pagelen: this.pagelen ?? 100, ...options };