/** * Eastmoney Data SDK - 客户端主入口 * * 提供统一的 API 调用入口 */ import { getKLine, getDailyKLine, getWeeklyKLine, getMonthlyKLine, getMinuteKLine, getBatchKLine } from './api/kline'; import { getQuote, getQuoteBySecid, getBatchQuote, getQuoteCore } from './api/quote'; import { getTrend, getIntradayTrend, get5DayTrend, getBatchTrend, calculateAveragePrice, getTrendHighLow } from './api/intraday'; import { getStockList, getAShareList, getETFList, getChiNextList, getStarList, getTopGainers, getTopLosers, getTopVolume, getTopTurnover, toStockInfo } from './api/stocklist'; import { buildSecid, detectMarket, parseSecid } from './utils/helper'; import { KLineOptions, KLine } from './types/kline'; import { Quote, TrendData } from './types/quote'; /** * Eastmoney Data SDK 客户端 * * 提供统一的 API 调用接口,方便使用和管理 * * @example * ```ts * import { EastmoneyClient } from 'eastmoney-data-sdk'; * * const client = new EastmoneyClient(); * * // 获取 K 线 * const klines = await client.kline({ secid: '1.600519', limit: 100 }); * * // 获取实时行情 * const quote = await client.quote('1.600519'); * * // 获取分时 * const trend = await client.trend('1.600519'); * * // 使用工具方法 * const secid = client.utils.buildSecid('600519'); // => '1.600519' * ``` */ export declare class EastmoneyClient { /** * 获取 K 线数据(支持多种周期和复权方式) */ kline: typeof getKLine; /** * 获取日线数据(前复权) */ dailyKline: typeof getDailyKLine; /** * 获取周线数据 */ weeklyKline: typeof getWeeklyKLine; /** * 获取月线数据 */ monthlyKline: typeof getMonthlyKLine; /** * 获取分钟线数据 */ minuteKline: typeof getMinuteKLine; /** * 批量获取 K 线数据 */ batchKline: typeof getBatchKLine; /** * 获取实时行情(完整数据) */ quote: typeof getQuoteBySecid; /** * 获取实时行情(详细选项) */ getQuote: typeof getQuote; /** * 获取实时行情(核心数据) */ quoteCore: typeof getQuoteCore; /** * 批量获取实时行情 */ batchQuote: typeof getBatchQuote; /** * 获取分时数据(支持多日) */ trend: typeof getTrend; /** * 获取当日分时 */ intradayTrend: typeof getIntradayTrend; /** * 获取 5 日分时 */ fiveDayTrend: typeof get5DayTrend; /** * 批量获取分时 */ batchTrend: typeof getBatchTrend; /** * 获取股票列表 */ stockList: typeof getStockList; /** * 获取沪深 A 股列表 */ aShareList: typeof getAShareList; /** * 获取 ETF 列表 */ etfList: typeof getETFList; /** * 获取创业板列表 */ chiNextList: typeof getChiNextList; /** * 获取科创板列表 */ starList: typeof getStarList; /** * 获取涨幅榜 */ topGainers: typeof getTopGainers; /** * 获取跌幅榜 */ topLosers: typeof getTopLosers; /** * 获取成交额榜 */ topVolume: typeof getTopVolume; /** * 获取换手率榜 */ topTurnover: typeof getTopTurnover; /** * 板块代码 */ SECTOR_CODE: { readonly A_SHARE: "m:0+t:6,m:0+t:80,m:1+t:2,m:1+t:23"; readonly SH_A: "m:1+t:2,m:1+t:23"; readonly SZ_A: "m:0+t:6,m:0+t:80"; readonly CHINEXT: "m:0+t:80"; readonly STAR: "m:1+t:23"; readonly ETF: "b:MK0021,b:MK0022,b:MK0023,b:MK0024"; readonly SH_ETF: "b:MK0021"; readonly SZ_ETF: "b:MK0022"; readonly BJ: "m:0+t:81+s:2048"; }; /** * 工具方法集合 */ utils: { /** * 根据股票代码构建 secid * @example buildSecid('600519') => '1.600519' */ buildSecid: typeof buildSecid; /** * 自动检测市场类型 */ detectMarket: typeof detectMarket; /** * 解析 secid */ parseSecid: typeof parseSecid; /** * 转换为 StockInfo 格式 */ toStockInfo: typeof toStockInfo; /** * 计算分时均价 */ calculateAveragePrice: typeof calculateAveragePrice; /** * 获取分时高低价 */ getTrendHighLow: typeof getTrendHighLow; }; /** * 快捷方法:通过股票代码获取数据(自动识别市场) * * @param code - 股票代码(如 600519、000001) * @returns 常用数据的快捷访问对象 */ stock(code: string): { /** * 获取日线 K 线 */ daily: (limit?: number) => Promise; /** * 获取周线 K 线 */ weekly: (limit?: number) => Promise; /** * 获取月线 K 线 */ monthly: (limit?: number) => Promise; /** * 获取分钟线 */ minute: (period?: 1 | 5 | 15 | 30 | 60, limit?: number) => Promise; /** * 获取实时行情 */ quote: () => Promise; /** * 获取当日分时 */ trend: () => Promise; /** * 获取 5 日分时 */ trend5: () => Promise; /** * 获取完整 K 线数据 */ kline: (options?: Omit) => Promise; }; } /** * 默认客户端实例 */ export declare const eastmoney: EastmoneyClient; //# sourceMappingURL=client.d.ts.map