Merge pull request #31166 from schultzp2020/constructor-parameters
refactor: convert constructor parameter properties for erasableSyntaxOnly compatibility
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user