import { a as ICountdownTask, i as ICountdownOptions, o as ICountdownTaskOptions, s as TCountdownDeadline } from "./types-Cezkmn_V.mjs"; import { a as ICountupTask, r as ICountupFullOptions, t as ICountupBaseOptions } from "./type-DMLv8nNY.mjs"; //#region src/groups.d.ts interface IGroup { config?: C; /** id → task 映射,保证按 id 删除为 O(1) */ queue: Map; } //#endregion //#region src/count-up/count-up.d.ts declare function pause$1(id: number, label?: string): void; declare function resume$1(id: number, label?: string): void; declare function install$1(options?: ICountupBaseOptions): IPlugin; declare function add$1(options: ICountupFullOptions): number; declare function add$1(to: number, label?: string): number; declare function add$1(to: number, options?: ICountupBaseOptions): number; declare function add$1(from: number, to: number, label?: string): number; declare function add$1(from: number, to: number, options?: ICountupBaseOptions): number; declare const counter$1: typeof add$1 & { add: typeof add$1; remove: (id: number, label?: string) => void; clear: (label?: string) => void; group: (label?: string, options?: ICountupBaseOptions | undefined) => IGroup; pause: typeof pause$1; resume: typeof resume$1; install: typeof install$1; defaults: Required>; }; //#endregion //#region src/core/types.d.ts interface IPlugin { /** 插件名,同时作为 api 挂载到 gt 上的 key,需与类型增强声明的字段一致 */ name: string; /** * 每帧回调,接收 (elapsed, dt):elapsed 为 RAF 时间戳,dt 为距上一帧的毫秒数。 * 返回 false 表示当前没有待处理任务;所有插件都返回 false 时核心自动停止 RAF。 * 返回 true 或 undefined 均视为"仍有任务"。 */ install(elapsed: number, dt: number): boolean | void; /** 插件暴露给 gt 的 API,会以 plugin.name 作为 key 挂到 gt 上 */ api?: unknown; /** 释放钩子:counter.destroy() 时调用,用于清空该插件的任务/观察者等资源 */ dispose?: () => void; } /** * gt 的类型形状。内置插件的 api 以 type-only import 直接声明(运行时无依赖环), * 第三方插件可通过 declare module "@codejoo/counter" 扩展此接口。 */ interface Counter { start(): void; stop(): void; use(plugin: IPlugin): void; /** 销毁:停止 RAF、清空所有插件任务与观察者、卸载已挂载 api。之后再调用 countup/countdown 会自动重建 */ destroy(): void; /** countup 插件 api,首次调用 countup(...) 自举注册后挂载(或手动 use(countup.install()));注册前为 undefined */ up?: typeof counter$1; /** countdown 插件 api,首次调用 countdown(...) 自举注册后挂载(或手动 use(countdown.install()));注册前为 undefined */ down?: typeof counter; } //#endregion //#region src/count-down/count-down.d.ts declare function add(deadline: TCountdownDeadline, el: string | Element, label?: string): number; declare function add(deadline: TCountdownDeadline, el: string | Element, options?: ICountdownTaskOptions): number; declare function pause(id: number, label?: string): void; declare function resume(id: number, label?: string): void; declare function install(options?: ICountdownOptions): IPlugin; declare const counter: typeof add & { add: typeof add; remove: (id: number, label?: string) => void; clear: (label?: string) => void; group: (label?: string, options?: ICountdownOptions | undefined) => IGroup; pause: typeof pause; resume: typeof resume; install: typeof install; defaults: Required>; }; //#endregion export { counter$1 as i, Counter as n, IPlugin as r, counter as t };