comic-vine-sdk
Version:
A JS/TS client for the Comic Vine API
30 lines (29 loc) • 1.21 kB
TypeScript
import { ResourceType } from '../resources/index.js';
import { RetrieveOptions, ListOptions } from '../types/index.js';
export declare class UrlBuilder {
private apiKey;
private baseUrl;
constructor(apiKey: string, baseUrl: string);
private getParam;
private getFormatParm;
private getApiKeyParm;
private getSortParam;
private getLimitParam;
private getOffsetParam;
private getFieldListParams;
private getFilterParams;
private buildUrl;
/**
* @param resourceType A unique identifier for the resource type
* @param id A unique identifier for the resource
* @returns A url for requesting the resource
* @example https://comicvine.gamespot.com/api/issue/4000-719442?format=json&api_key=123abc
*/
retrieve<Key>(resourceType: ResourceType, id: number, options?: RetrieveOptions<Key>): string;
/**
* @param resourceType A unique identifier for the resource type
* @returns A url for requesting a list of resources
* @example https://comicvine.gamespot.com/api/issues?format=json&api_key=123abc
*/
list<Resource, FilterType>(resourceType: ResourceType, options?: ListOptions<Resource, FilterType>): string;
}