import type { TimeDataItem } from './Timeline'; import type { EventDefinition } from './core/EventHandler'; /** CSS 属性键值对 */ declare type Style = CSSStyleDeclaration & Record<':hover' | ':active' | '::before' | '::after' | ':disabled', CSSStyleDeclaration>; /** 主题 */ export declare const THEME: { /** 移动端 */ readonly MOBILE: "mobile"; /** v0.0.6+ 移动端-夜间版 */ readonly MOBILE_DARK: "mobile-dark"; /** v0.0.5+ 移动端-外部显示刻度值(刻度值上下布局) */ readonly MOBILE_WITH_VALUE_OUTER: "mobile-withValueOuter"; /** v0.0.6+ 移动端-外部显示刻度值(刻度值上下布局)-夜间版 */ readonly MOBILE_WITH_VALUE_OUTER_DARK: "mobile-withValueOuter-dark"; /** v0.2.0+ 移动端-窄版 */ readonly MOBILE_COMPACT: "mobile-compact"; /** v0.2.0+ 移动端-窄版-夜间版 */ readonly MOBILE_COMPACT_DARK: "mobile-compact-dark"; /** v0.2.0+ 移动端-窄版-外部显示刻度值(刻度值上下布局) */ readonly MOBILE_COMPACT_WITH_VALUE_OUTER: "mobile-compact-withValueOuter"; /** v0.2.0+ 移动端-窄版-外部显示刻度值(刻度值上下布局)-夜间版 */ readonly MOBILE_COMPACT_WITH_VALUE_OUTER_DARK: "mobile-compact-withValueOuter-dark"; /** v0.2.0+ 移动端-简单版(无操作按钮) */ readonly MOBILE_SIMPLE: "mobile-simple"; /** v0.2.0+ 移动端-简单版(无操作按钮)-夜间版 */ readonly MOBILE_SIMPLE_DARK: "mobile-simple-dark"; /** PC 端 */ readonly PC: "pc"; /** PC 端-夜间版 */ readonly PC_DARK: "pc-dark"; /** v0.4.0+ PC 端-简单版 */ readonly PC_SIMPLE: "pc-simple"; /** v0.4.0+ PC 端-简单版-夜间版 */ readonly PC_SIMPLE_DARK: "pc-simple-dark"; /** v0.4.0+ 海外主题 */ readonly MOBILE_AINVEST_LIGHT: "mobile-ainvest-light"; /** v0.4.0+ 海外主题-夜间版 */ readonly MOBILE_AINVEST_DARK: "mobile-ainvest-dark"; }; export declare const SPEED_TEXT_MAP: { readonly '0.5': "0.5"; readonly '0.75': "0.75"; readonly '1': "1.0"; readonly '1.25': "1.25"; readonly '1.5': "1.5"; readonly '2': "2.0"; }; /** * 时间轴配置项 */ export declare type Option = { /** 时间轴数据 */ data: TimeDataItem[]; /** 主题配置,默认为 'mobile' */ theme?: typeof THEME[keyof typeof THEME]; /** 配置项 */ config: { /** 时间轴 */ axis?: { /** 轴线 */ background?: { /** 样式(自定义) */ style?: Style; }; /** v0.0.2+ 区间进度条(配置了 dataIndexRange 后自动显示) */ progressRange?: { style?: Style; }; /** 累积进度条 */ progress?: { /** 显示 */ show: boolean; style?: Style; }; /** 刻度线 */ tickLine?: { /** 主刻度 */ main?: { minSpace?: number; style?: Style; }; /** 次要刻度 */ sub?: { style?: Style; /** v0.3.0+ 两个刻度之间最小间距(像素宽度),小于时隐藏次要刻度线,默认为 4 像素 */ minSpace?: number; }; }; /** 刻度值 */ tickValue?: { style?: Style; /** 刻度值(自定义) */ formatter?: (timeData: TimeDataItem, index: number) => string; /** v0.3.0+ 两个标签文本之间最小间距(像素宽度),小于时认为发生重叠则隐藏,默认为 8 像素 */ minSpace?: number; /** v0.3.0+ 是否隐藏重叠的标签,默认为 true */ hideOverlap?: boolean; }; /** 按钮 */ marker?: { style?: Style; }; /** 提示框 */ tooltip?: { style?: Style; /** v0.1.1+ 箭头样式 */ arrowStyle?: Style; /** v0.1.1+ 文本样式 */ textStyle?: Style; /** 提示(自定义) */ formatter?: (timeData: TimeDataItem, index: number) => string; }; /** 交互 */ action?: { /** 禁止轴上的点击交互 */ clickDisabled?: boolean; /** v0.1.0+ 开启拖动滑块实时触发 change 事件 */ enableDragChange?: boolean; /** v0.2.7+ 索引区间交互(配置了 dataIndexRange 后有效) */ dataIndexRange?: { /** 禁止区间起始位置的拖动按钮 */ disableStartBtn?: boolean; /** 禁止结束位置的拖动按钮改变索引区间 */ disableEndBtnChangeRange?: boolean; }; }; /** v0.5.0+ 不支持的文本提示 */ unsupportedText?: { style?: Style; /** 自定义文本内容 */ content?: string; }; }; /** 操作栏 */ operation?: { /** 播放按钮 */ playButton?: { style?: Style; /** v0.3.0+ 用来作为按钮的 title 属性,鼠标悬浮显示 */ text?: string; }; /** v0.3.0+ 重新播放按钮 */ replayButton?: { style?: Style; /** v0.3.0+ 用来作为按钮的 title 属性,鼠标悬浮显示 */ text?: string; }; /** 暂停按钮 */ pauseButton?: { style?: Style; /** v0.3.0+ 用来作为按钮的 title 属性,鼠标悬浮显示 */ text?: string; }; /** 上一期按钮 */ previousButton?: { style?: Style; /** 按钮文本,同时也会作为按钮的 title 属性 */ text?: string; }; /** 下一期按钮 */ nextButton?: { style?: Style; /** 按钮文本,同时也会作为按钮的 title 属性 */ text?: string; }; /** v0.2.0+ 倍速设置按钮 */ speed?: { /** 是否开启 */ enable: boolean; /** 按钮样式 */ style?: Style; /** 按钮文本样式 */ textStyle?: Style; /** 按钮右上角标签样式 */ labelStyle?: Style; /** 弹窗菜单背景遮罩样式 */ menuListBackgroundMaskStyle?: Style; /** 弹窗菜单列表样式 */ menuListStyle?: Style; /** 弹窗菜单列表项样式 */ menuListItemStyle?: Style; /** 弹窗菜单列表项文本样式 */ menuListItemTextStyle?: Style; }; }; /** 起始位置的数据索引 */ dataIndex?: number; /** v0.0.2+ 数据索引区间限制 开闭 [,) */ dataIndexRange?: [number, number]; /** 动画配置项 */ animation: { /** 动画播放单个周期持续时长(毫秒) */ intervalTime: number; /** v0.2.0+ 默认播放速度(1.0) */ speed?: keyof typeof SPEED_TEXT_MAP; /** v0.2.1+ 在什么交互情况下要触发动画(默认所有交互情况都触发动画,连续两次交互会等待前一周期动画播放完毕再触发 change 事件),不触发动画的交互可以立即触发 change 事件,不用等待前一周期动画播放完毕 */ causeBy?: Parameters[0]['causeBy'][]; }; }; }; export {};