earningscall
Version:
The EarningsCall JavaScript library provides convenient access to the EarningsCall API. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses.
34 lines • 1.22 kB
TypeScript
import { CompanyInfo } from '../types/company';
export declare const EXCHANGES_IN_ORDER: string[];
export declare function indexToExchange(index: number): string;
export declare class Symbols {
expiresDate: Date | null;
lastModified: Date | null;
cacheControlExpires: string | null;
private exchanges;
private byName;
private byExchangeAndSym;
add: (companyInfo: CompanyInfo) => void;
getExchangeSymbol: (exchangeSymbol: string) => CompanyInfo | undefined;
get: (exchange: string, symbol: string) => CompanyInfo | undefined;
getAll: (this: Symbols) => Generator<CompanyInfo, void, unknown>;
}
/**
* Loads the symbols from the API and returns a Symbols object.
*
* @returns {Promise<Symbols>} The Symbols object.
*/
export declare function loadSymbols(): Promise<Symbols>;
/**
* Returns the symbols object. If the symbols object is not loaded, it will load it.
*
* @returns {Promise<Symbols>} The Symbols object.
*/
export declare function getSymbols(): Promise<Symbols>;
/**
* Clears the symbols object.
*
* Forces a reload of the symbols from the API next time getSymbols is called.
*/
export declare function clearSymbols(): void;
//# sourceMappingURL=symbols.d.ts.map