import type { CollectionEvent, CollectionCallback } from "../chip-types/collection.js"; import type { App, Collection } from "../main.js"; import type Context from "../context.js"; export type RefreshCallbackArguments = [context: Context, ...args: unknown[]]; export type ResourceIDGetter = (arg: A) => Promise; export type RefreshConditionCallback = (arg: A) => Promise; export declare abstract class RefreshCondition { resource_id_getter: ResourceIDGetter; constructor(resource_id_getter: ResourceIDGetter); abstract attachTo(app: App, collection: Collection, // refresh conditions are always used in some kind of automatically refreshing field types. This stores the collection to which that refreshing field belongs to callback: RefreshConditionCallback): void; } export type CollectionRefreshConditionArgs = Parameters[0]; export declare class CollectionRefreshCondition extends RefreshCondition { collection_name: string; resource_id_getter: ResourceIDGetter; event_names: CollectionEvent[]; constructor(collection_name: string, event_name: CollectionEvent | CollectionEvent[], resource_id_getter: ResourceIDGetter); attachTo(app: App, _: unknown, callback: RefreshConditionCallback): void; } export declare class ClockEventDescription extends RefreshCondition<[Context]> { cron_description: string; resource_id_getter: ResourceIDGetter<[Context]>; make_context: (app: App) => Context; constructor(cron_description: string, resource_id_getter: ResourceIDGetter<[Context]>, make_context: (app: App) => Context); attachTo(app: App, _: Collection, callback: RefreshConditionCallback<[Context]>): void; }