@types/apicalypse
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

Installation

npm install --save @types/apicalypse

Summary

This package contains type definitions for apicalypse (https://github.com/igdb/node-apicalypse).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/apicalypse.

index.d.ts

import { AxiosRequestConfig, AxiosResponse } from "axios";

export interface Apicalypse {
    request(url: string): Promise<AxiosResponse>;
    requestAll(url: string, options?: RequestAllConfig): Promise<any[]>;

    multi(queries: readonly Apicalypse[]): Apicalypse;
    query(endpoint: string, name: string): Apicalypse;

    fields(fields: string | readonly string[]): Apicalypse;
    sort(field: string, direction?: SortDirection): Apicalypse;
    limit(limit: number): Apicalypse;
    offset(offset: number): Apicalypse;
    search(search: string): Apicalypse;
    where(filters: string | readonly string[]): Apicalypse;
}

export interface RequestAllConfig {
    concurrency?: number | undefined;
    delay?: number | undefined;
}

export type SortDirection = "asc" | "desc";

declare function apicalypseFactory(options?: ApicalypseConfig): Apicalypse;
declare function apicalypseFactory(rawQueryString: string, options?: ApicalypseConfig): Apicalypse;

export interface ApicalypseConfig extends AxiosRequestConfig {
    queryMethod?: QueryMethod | undefined;
}

export type QueryMethod = "body" | "url";

export default apicalypseFactory;

Additional Details

  • Last updated: Mon, 20 Nov 2023 23:36:23 GMT
  • Dependencies: axios

Credits

These definitions were written by Susam.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/apicalypse

Weekly Downloads

159

Version

0.1.5

License

MIT

Unpacked Size

4.91 kB

Total Files

5

Last publish

Collaborators

  • types