UNPKG

fejn-kline

Version:

kline chart

97 lines (94 loc) 3.3 kB
/** * 多语言映射 * https://i18ns.com/languagecode.html */ declare enum Lang { 'en-US' = "en-US",// 英语(美国) 'zh-CN' = "zh-CN",// 中文(简体) 'zh-TW' = "zh-TW",// 中文(繁体) 'ja-JP' = "ja-JP",// 日语 'vi-VN' = "vi-VN",// 越南语 'es-ES' = "es-ES",// 西班牙语(国际) 'ru-RU' = "ru-RU",// 俄语 'tr-TR' = "tr-TR",// 土耳其语 'pt-BR' = "pt-BR",// 葡萄牙语(巴西) 'fr-FR' = "fr-FR",// 法语(法国) 'th-TH' = "th-TH",// 泰语 'id-ID' = "id-ID",// 印度尼西亚语 'ko-KR' = "ko-KR" } /** Trading View 多语言映射 */ declare enum TvLang { 'en-US' = "en",// 英语(美国) 'zh-CN' = "zh",// 中文(简体) 'zh-TW' = "zh_TW",// 中文(繁体) 'ja-JP' = "ja",// 日语 'vi-VN' = "vi",// 越南语 'es-ES' = "es",// 西班牙语(国际) 'ru-RU' = "ru",// 俄语 'tr-TR' = "tr",// 土耳其语 'pt-BR' = "pt",// 葡萄牙语(巴西) 'fr-FR' = "fr",// 法语(法国) 'th-TH' = "th",// 泰语 'id-ID' = "id_ID",// 印度尼西亚语 'ko-KR' = "ko" } /** kline数据类型 */ type KLineData = { timestamp: number; open: number; high: number; low: number; close: number; volume?: number; turnover?: number; }; /** tradingView数据类型 */ type TvKlineData = Omit<KLineData, 'turnover' | 'timestamp'> & { time: number; id: string; }; /** 支持的周期 */ type Interval = '1' | '3' | '5' | '15' | '30' | '60' | '120' | '240' | '360' | '720' | '1D' | '3D' | '1W' | '1M'; /** 图表类型 */ type KlineType = 'simple' | 'tv'; /** 支持的主题 */ type Theme = 'dark' | 'light'; /** 默认主题 */ declare const theme = "dark"; /** 默认语言 */ declare const lang = Lang['en-US']; /** 储存key */ declare const storeKey = "kline_chart"; /** 默认周期 */ declare const interval: Interval; /** 支持的周期列表 */ declare const intervals: Interval[]; /** 默认展示周期列表 */ declare const showIntervals: Interval[]; /** 图表图形支持列表 */ declare const graphs: { tv: number[]; simple: number[]; simple_map: Record<number, string>; }; type config_Interval = Interval; type config_KLineData = KLineData; type config_KlineType = KlineType; type config_Lang = Lang; declare const config_Lang: typeof Lang; type config_Theme = Theme; type config_TvKlineData = TvKlineData; type config_TvLang = TvLang; declare const config_TvLang: typeof TvLang; declare const config_graphs: typeof graphs; declare const config_interval: typeof interval; declare const config_intervals: typeof intervals; declare const config_lang: typeof lang; declare const config_showIntervals: typeof showIntervals; declare const config_storeKey: typeof storeKey; declare const config_theme: typeof theme; declare namespace config { export { type config_Interval as Interval, type config_KLineData as KLineData, type config_KlineType as KlineType, config_Lang as Lang, type config_Theme as Theme, type config_TvKlineData as TvKlineData, config_TvLang as TvLang, config_graphs as graphs, config_interval as interval, config_intervals as intervals, config_lang as lang, config_showIntervals as showIntervals, config_storeKey as storeKey, config_theme as theme }; } export { Lang as L, type Theme as T, config as c };