import type { Future, Present } from "../types/futures"; import type { KVP } from "../types/key-value-pair"; import type { Entries } from "../types/object-entries"; /** * An object containing both present and future (Promise or Observable) values. * @example * const c = { * key1: 'present', * key2: Promise.resolve('future'), * key3: Observable.from(['many', 'futures']), * } */ export interface Chronosympton { [key: string]: Present | Future | Chronosympton; } /** * A function used to tell "collapse" a present from a future value, in relation * to whether it's to be baked in static HTML code or bound after mounting */ export type Collapser = (kv: KVP) => kv is [string, Future]; /** * Split a {@link Chronosympton} into separate present and future object entries * @param obj the Chronosympton to split * @param collapse a function that returns true for future entries, false for present ones * @returns a tuple of two arrays: the first with present entries, the second with future entries * @example * const collapse = ([, v]: KVP) => v instanceof Promise || (typeof v === 'object' && 'subscribe' in v && typeof v.subscribe === 'function'); * const [presentEntries, futureEntries] = chronolyze(obj, collapse) */ export declare const chronolyze: (obj: Chronosympton, collapse: Collapser) => [Entries>, Entries>]; //# sourceMappingURL=chronolyze.d.ts.map