forked from VirtueMe/oai-pmh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
26 lines (25 loc) · 904 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
declare module 'oai-pmh2' {
export interface IOaiPmhOptions {
userAgent?: string;
/** Whether to retry on 503. Defaults to `true`. */
retry?: boolean;
/** Number of retries. Only used if {@link IOaiPmhOptions.retry} is `true`. */
retryMax?: number;
}
export interface IRecordsQueryOptions {
metadataPrefix: string,
set?: string,
from?: string,
until?: string
}
export class OaiPmhError extends Error {}
export class OaiPmh {
constructor( baseUrl: string, options?: IOaiPmhOptions );
public identify(): Promise<any>;
public listIdentifiers(options: IRecordsQueryOptions): AsyncGenerator<any>;
public listRecords(options: IRecordsQueryOptions): AsyncGenerator<any>;
public listMetadataFormats(options?: {identifier?: string}): Promise<any>;
public listSets(): AsyncGenerator<any>;
public getRecord( identifier: string, metadataPrefix: string ): Promise<unknown>
}
}