708466e54a8608a4bf0f096e083febaf11e5f66584478c9b1b70889c561553d754626659086f25829dcc8b2ec2af6d57a98810b2b5a44e956e8848977122c7 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { TimeAxisLabelFormatterOption } from './../coord/axisCommonTypes.js';
  2. import { TimeScaleTick } from './types.js';
  3. import { LocaleOption } from '../core/locale.js';
  4. import Model from '../model/Model.js';
  5. export declare const ONE_SECOND = 1000;
  6. export declare const ONE_MINUTE: number;
  7. export declare const ONE_HOUR: number;
  8. export declare const ONE_DAY: number;
  9. export declare const ONE_YEAR: number;
  10. export declare const defaultLeveledFormatter: {
  11. year: string;
  12. month: string;
  13. day: string;
  14. hour: string;
  15. minute: string;
  16. second: string;
  17. millisecond: string;
  18. none: string;
  19. };
  20. export declare const fullLeveledFormatter: {
  21. year: string;
  22. month: string;
  23. day: string;
  24. hour: string;
  25. minute: string;
  26. second: string;
  27. millisecond: string;
  28. };
  29. export declare type PrimaryTimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year';
  30. export declare type TimeUnit = PrimaryTimeUnit | 'half-year' | 'quarter' | 'week' | 'half-week' | 'half-day' | 'quarter-day';
  31. export declare const primaryTimeUnits: PrimaryTimeUnit[];
  32. export declare const timeUnits: TimeUnit[];
  33. export declare function pad(str: string | number, len: number): string;
  34. export declare function getPrimaryTimeUnit(timeUnit: TimeUnit): PrimaryTimeUnit;
  35. export declare function isPrimaryTimeUnit(timeUnit: TimeUnit): boolean;
  36. export declare function getDefaultFormatPrecisionOfInterval(timeUnit: PrimaryTimeUnit): PrimaryTimeUnit;
  37. export declare function format(time: unknown, template: string, isUTC: boolean, lang?: string | Model<LocaleOption>): string;
  38. export declare function leveledFormat(tick: TimeScaleTick, idx: number, formatter: TimeAxisLabelFormatterOption, lang: string | Model<LocaleOption>, isUTC: boolean): string;
  39. export declare function getUnitFromValue(value: number | string | Date, isUTC: boolean): PrimaryTimeUnit;
  40. export declare function getUnitValue(value: number | Date, unit: TimeUnit, isUTC: boolean): number;
  41. export declare function fullYearGetterName(isUTC: boolean): "getUTCFullYear" | "getFullYear";
  42. export declare function monthGetterName(isUTC: boolean): "getUTCMonth" | "getMonth";
  43. export declare function dateGetterName(isUTC: boolean): "getUTCDate" | "getDate";
  44. export declare function hoursGetterName(isUTC: boolean): "getUTCHours" | "getHours";
  45. export declare function minutesGetterName(isUTC: boolean): "getUTCMinutes" | "getMinutes";
  46. export declare function secondsGetterName(isUTC: boolean): "getUTCSeconds" | "getSeconds";
  47. export declare function millisecondsGetterName(isUTC: boolean): "getUTCMilliseconds" | "getMilliseconds";
  48. export declare function fullYearSetterName(isUTC: boolean): "setUTCFullYear" | "setFullYear";
  49. export declare function monthSetterName(isUTC: boolean): "setUTCMonth" | "setMonth";
  50. export declare function dateSetterName(isUTC: boolean): "setUTCDate" | "setDate";
  51. export declare function hoursSetterName(isUTC: boolean): "setUTCHours" | "setHours";
  52. export declare function minutesSetterName(isUTC: boolean): "setUTCMinutes" | "setMinutes";
  53. export declare function secondsSetterName(isUTC: boolean): "setUTCSeconds" | "setSeconds";
  54. export declare function millisecondsSetterName(isUTC: boolean): "setUTCMilliseconds" | "setMilliseconds";