import { Ref } from 'vue';
import { DurationResultType } from './utils';
export type TimeAgoResultType = {
    /**
     * 差值（绝对值ms）
     */
    diffMs: number;
    /**
     * 差值类型(之前/之后)
     */
    type: 'ago' | 'late';
    /**
     * 差值应使用最近单位
     */
    unit: 's' | 'm' | 'h' | 'd' | 'M' | 'y';
    /**
     * 差值数量（向下取整）
     */
    count: number;
    /**
     * 差值，格式化后
     */
    diffFormatted: DurationResultType;
};
type DateType = Date | number | string;
export declare function getTimeAgo(ts: number, baseline: number): TimeAgoResultType;
export interface TimeAgoRecord {
    ts: number;
    timeAgo: Ref<TimeAgoResultType>;
    interval: false | number;
    updated: number;
}
export declare function getId(): number;
export declare function subscribe(id: number, record: TimeAgoRecord): void;
export declare function unsubscribe(id: number): void;
declare const useTimeGo: (target: Ref<DateType>, base: DateType, interval: Ref<false | number>) => Ref<{
    diffMs: number;
    type: "ago" | "late";
    unit: "s" | "m" | "h" | "d" | "M" | "y";
    count: number;
    diffFormatted: {
        year: number;
        month: number;
        day: number;
        hour: number;
        min: number;
        sec: number;
    };
}, TimeAgoResultType | {
    diffMs: number;
    type: "ago" | "late";
    unit: "s" | "m" | "h" | "d" | "M" | "y";
    count: number;
    diffFormatted: {
        year: number;
        month: number;
        day: number;
        hour: number;
        min: number;
        sec: number;
    };
}>;
export default useTimeGo;
