node-twstock
Version:
A client library for scraping Taiwan stock market data
198 lines (197 loc) • 8.55 kB
TypeScript
import { RateLimitOptions, Ticker } from './interfaces';
export declare class TwStock {
private readonly _scraper;
private readonly _stocks;
private readonly _indices;
private readonly _futopt;
constructor(options?: RateLimitOptions);
get stocks(): {
list: (options?: {
exchange: "TWSE" | "TPEx";
} | undefined) => Promise<import("./interfaces").Stock[]>;
quote: (options: {
symbol: string;
odd?: boolean | undefined;
}) => Promise<import("./interfaces").StockQuote | null | undefined>;
historical: (options: {
date: string;
exchange?: "TWSE" | "TPEx" | undefined;
symbol?: string | undefined;
}) => Promise<import("./interfaces").StockHistorical | import("./interfaces").StockHistorical[] | null | undefined>;
institutional: (options: {
date: string;
exchange?: "TWSE" | "TPEx" | undefined;
symbol?: string | undefined;
}) => Promise<import("./interfaces").StockInstitutional | import("./interfaces").StockInstitutional[] | null | undefined>;
values: (options: {
date: string;
exchange?: "TWSE" | "TPEx" | undefined;
symbol?: string | undefined;
}) => Promise<import("./interfaces").StockValues | import("./interfaces").StockValues[] | null | undefined>;
finiHoldings: (options: {
date: string;
exchange?: "TWSE" | "TPEx" | undefined;
symbol?: string | undefined;
}) => Promise<import("./interfaces").StockFiniHoldings | import("./interfaces").StockFiniHoldings[] | null | undefined>;
marginTrades: (options: {
date: string;
exchange?: "TWSE" | "TPEx" | undefined;
symbol?: string | undefined;
}) => Promise<import("./interfaces").StockMarginTrades | import("./interfaces").StockMarginTrades[] | null | undefined>;
shortSales: (options: {
date: string;
exchange?: "TWSE" | "TPEx" | undefined;
symbol?: string | undefined;
}) => Promise<import("./interfaces").StockShortSales | import("./interfaces").StockShortSales[] | null | undefined>;
shareholders: (options?: {
date?: string | undefined;
symbol: string;
} | undefined) => Promise<import("./interfaces").StockShareholders | import("./interfaces").StockShareholders[] | null | undefined>;
eps: (options: {
year: number;
quarter: number;
exchange?: "TWSE" | "TPEx" | undefined;
symbol?: string | undefined;
}) => Promise<import("./interfaces").StockEps | import("./interfaces").StockEps[] | null | undefined>;
revenue: (options: {
exchange?: "TWSE" | "TPEx" | undefined;
year: number;
month: number;
foreign?: boolean | undefined;
symbol?: string | undefined;
}) => Promise<import("./interfaces").StockRevenue | import("./interfaces").StockRevenue[] | null | undefined>;
dividends: (options: {
startDate: string;
endDate: string;
exchange?: "TWSE" | "TPEx" | undefined;
symbol?: string | undefined;
}) => Promise<import("./interfaces").StockDividends[]>;
capitalReductions: (options: {
exchange?: "TWSE" | "TPEx" | undefined;
startDate: string;
endDate: string;
symbol?: string | undefined;
}) => Promise<import("./interfaces").StockCapitalReductions[]>;
splits: (options: {
exchange?: "TWSE" | "TPEx" | undefined;
startDate: string;
endDate: string;
symbol?: string | undefined;
}) => Promise<import("./interfaces").StockSplits[]>;
etfSplits: (options: {
exchange?: "TWSE" | "TPEx" | undefined;
startDate: string;
endDate: string;
symbol?: string | undefined;
reverseSplit?: boolean | undefined;
}) => Promise<import("./interfaces").StockSplits[]>;
};
get indices(): {
list: (options?: {
exchange: "TWSE" | "TPEx";
} | undefined) => Promise<Pick<any, string | number | symbol>[]>;
quote: (options: {
symbol: string;
}) => Promise<import("./interfaces").IndexQuote | null | undefined>;
historical: (options: {
date: string;
exchange?: "TWSE" | "TPEx" | undefined;
symbol?: string | undefined;
}) => Promise<import("./interfaces").IndexHistorical | import("./interfaces").IndexHistorical[] | null | undefined>;
trades: (options: {
date: string;
exchange?: "TWSE" | "TPEx" | undefined;
symbol?: string | undefined;
}) => Promise<import("./interfaces").IndexTrades | import("./interfaces").IndexTrades[] | null | undefined>;
};
get market(): {
trades: (options: {
date: string;
exchange?: "TWSE" | "TPEx" | undefined;
}) => Promise<import("./interfaces").MarketTrades | null>;
breadth: (options: {
date: string;
exchange?: "TWSE" | "TPEx" | undefined;
}) => Promise<import("./interfaces").MarketBreadth | null>;
institutional: (options: {
date: string;
exchange?: "TWSE" | "TPEx" | undefined;
}) => Promise<import("./interfaces").MarketInstitutional | null>;
marginTrades: (options: {
date: string;
exchange?: "TWSE" | "TPEx" | undefined;
}) => Promise<import("./interfaces").MarketMarginTrades | null>;
};
get futopt(): {
list: (options?: {
type?: "F" | "O" | undefined;
availableContracts?: boolean | undefined;
} | undefined) => Promise<import("./interfaces").FutOpt[] | Ticker[]>;
quote: (options: {
symbol: string;
afterhours?: boolean | undefined;
}) => Promise<import("./interfaces").FutOptQuote | import("./interfaces").FutOptQuote[] | null | undefined>;
historical: (options: {
date: string;
type?: "F" | "O" | undefined;
symbol?: string | undefined;
afterhours?: boolean | undefined;
}) => Promise<import("./interfaces").FutOptHistorical[] | null>;
institutional: (options: {
date: string;
symbol: string;
}) => Promise<import("./interfaces").FutOptInstitutional | null>;
largeTraders: (options: {
date: string;
symbol: string;
}) => Promise<import("./interfaces").FutOptLargeTraders | null>;
mxfRetailPosition: (options: {
date: string;
}) => Promise<import("./interfaces").FutOptMxfRetailPosition | null>;
tmfRetailPosition: (options: {
date: string;
}) => Promise<import("./interfaces").FutOptTmfRetailPosition | null>;
txoPutCallRatio: (options: {
date: string;
}) => Promise<import("./interfaces").FutOptTxoPutCallRatio | null>;
exchangeRates: (options: {
date: string;
}) => Promise<import("./interfaces/futopt-exchange-rates.interface").FutOptExchangeRates | null>;
};
private loadStocks;
private loadIndices;
private loadFutOpt;
private loadFutOptContracts;
private fetchStocksList;
private fetchStocksQuote;
private fetchStocksHistorical;
private fetchStocksInstitutional;
private fetchStocksValues;
private fetchStocksSplits;
private fetchStocksEtfSplits;
private fetchStocksCapitalReductions;
private fetchStocksDividends;
private fetchStocksFiniHoldings;
private fetchStocksMarginTrades;
private fetchStocksShortSales;
private fetchStocksShareholders;
private fetchStocksEps;
private fetchStocksRevenue;
private getIndicesList;
private getIndicesQuote;
private getIndicesHistorical;
private getIndicesTrades;
private getMarketTrades;
private getMarketBreadth;
private getMarketInstitutional;
private getMarketMarginTrades;
private getFutOptList;
private getFutOptQuote;
private getFutOptHistorical;
private getFutOptInstitutional;
private getFutOptLargeTraders;
private getFutOptMxfRetailPosition;
private getFutOptTmfRetailPosition;
private getFutOptTxoPutCallRatio;
private getFutOptExchangeRates;
}