export namespace FnPeriodicallyNamespace { export type FnCallbackParams = { // 手动run触发运行 isFirstRun: boolean } export type ConstructorOption = { // 需要运行的函数 fn(params?: FnCallbackParams, ...arg: any[]): Promise, // 每次运行间隔 delay: number // 立即运行,不等待,否则先等待(timeout)再执行,缺省值:true immediate?: boolean // 启动循环,缺省值:false run?: boolean // 向fn传递的参数 arg?: any[] // Vue中在onBeforeUnmount事件中销毁,缺省值:false isUnmountStop?: boolean } } export namespace FnBatchPeriodicallyNamespace { export type AddOption = (FnPeriodicallyNamespace.ConstructorOption & { key?: string }) export type FnPeriodicallyOptions = FnBatchPeriodicallyNamespace.AddOption[] export type ConstructorOption = { // Vue中在onBeforeUnmount事件中销毁,缺省值:false isUnmountStop?: boolean } }