cowin-api-wrapper
Version:
API wrapper for COWIN's public API with TypeScript support.
45 lines • 1.39 kB
TypeScript
import { Appointment } from "./format-response";
/**
* Search for appointments using pin.
* @param { string | number } pin
* @param { Options } opts Allows you to switch between per day or per week results
*/
export declare const findAppointmentsByPin: (pin: string | number, opts?: Options) => Promise<AppointmentResponse>;
/**
* Search for appointments using district.
* @param { string | number } pin
* @param { Options } opts Allows you to switch between per day or per week results
*/
export declare const findAppointmentsByDistrict: (districtId: number, opts?: Options) => Promise<AppointmentResponse>;
/**
* Fetch the list of available states.
*/
export declare const getStates: () => Promise<State[]>;
/**
* Fetch districts corresponding to the given state id.
* @param { number } stateId
*/
export declare const getDistricts: (stateId: number) => Promise<District[]>;
declare type BadRequest = {
errorCode: string;
error: string;
};
export declare type Options = {
date?: Date;
week?: boolean;
};
export declare type AppointmentResponse = {
appointments: Appointment[] | null;
isError: boolean;
error: BadRequest | null;
};
export declare type State = {
state_id: number;
state_name: string;
};
export declare type District = {
district_id: number;
district_name: string;
};
export {};
//# sourceMappingURL=index.d.ts.map