UNPKG

@matheustrres/brasilapi

Version:

Lightweight, easy-to-use & free of dependencies wrapper for BrasilAPI

34 lines (33 loc) 1.32 kB
import { Source } from './source'; import { type ListParams, type Broker } from '../typings'; import { type Result } from '../typings/result'; import { Paginator } from '../utils/paginator'; interface IBroker { get(cnpj: string): Promise<Result<Broker>>; list(params?: ListParams): Promise<Result<Paginator<Broker>>>; } /** * Represents the source from BrasilAPI Brokers' endpoint responses */ export declare class BrasilAPIBroker extends Source implements IBroker { protected readonly URL = "https://brasilapi.com.br/api/cvm/corretoras/v1"; /** * Gets information from a broker in the CVM archives * * @param {String} cnpj - The broker's CNPJ * @returns {Promise<Result<Broker>>} */ get(cnpj: string): Promise<Result<Broker>>; /** * Lists all the brokers in the CVM archives * * @param {ListParams} [params] - The listing parameters * @param {Number} [params.itemsPerPage] - The limit of items per page * @param {Number} [params.page] - The page number to start with * @param {Number} [params.skip] - The amount of items to skip * @param {Number} [params.take] - The amount of items to take * @returns {Promise<Result<Paginator<Broker>>>} */ list(params?: ListParams): Promise<Result<Paginator<Broker>>>; } export {};