0.1.5 • Published 6 months ago

@types/apicalypse v0.1.5

Weekly downloads
16
License
MIT
Repository
github
Last release
6 months ago

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

// Type definitions for apicalypse 0.1
// Project: https://github.com/igdb/node-apicalypse
// Definitions by: Susam <https://github.com/susam-projects>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import { AxiosRequestConfig, AxiosResponse } from 'axios';

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

    multi(queries: ReadonlyArray<Apicalypse>): Apicalypse;
    query(endpoint: string, name: string): Apicalypse;

    fields(fields: string | ReadonlyArray<string>): Apicalypse;
    sort(field: string, direction?: SortDirection): Apicalypse;
    limit(limit: number): Apicalypse;
    offset(offset: number): Apicalypse;
    search(search: string): Apicalypse;
    where(filters: string | ReadonlyArray<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: Wed, 07 Jul 2021 21:44:26 GMT
  • Dependencies: @types/axios
  • Global values: none

Credits

These definitions were written by Susam.

0.1.2

8 months ago

0.1.4

6 months ago

0.1.3

7 months ago

0.1.5

6 months ago

0.1.1

3 years ago

0.1.0

4 years ago