pond-ts API Reference (core)
    Preparing search index...

    Class LivePartitionedView<SBase, R, K, ByCol>

    Chained typed view over a LivePartitionedSeries. Returned by every sugar method on the root partitioned series and on this view, composing the operator factory at each step.

    The view is lazy: factories aren't run until a terminal (collect(), apply(), toMap()) is called. Each terminal delegates back to the root's per-partition state, applying the composed factory chain to each partition's LiveSeries.

    Lifecycle. All real state lives on the root LivePartitionedSeries — chained views are just deferred factories that point back at the root. They don't register their own subscriptions on the source. Disposing the root disposes everything: terminals subscribed to factory outputs are tracked on the root's internal disposers, including outputs created by view.toMap().

    const cpuSmoothed = live
    .partitionBy('host')
    .fill({ cpu: 'hold' }) // → LivePartitionedView<S, S, K, ByCol>
    .rolling('1m', { cpu: 'avg' }) // → LivePartitionedView<S, R, K, ByCol>
    .collect(); // → LiveSeries<R>

    Type Parameters

    • SBase extends SeriesSchema

      schema of the root partitioned series's per-partition LiveSeries (kept so the composed factory's input type is correct).

    • R extends SeriesSchema

      schema of the current chained output.

    • K extends string = string

      partition key type.

    • ByCol extends keyof EventDataForSchema<SBase> & string = keyof EventDataForSchema<SBase> & string

      partition column name (literal). Threaded through from the root LivePartitionedSeries so chained-rolling typing chains (e.g. partitionBy('host').fill(...).rolling({...})) resolve FusedPartitionedRollingSchema<R, ByCol, FM> correctly.

    Index

    Properties

    schema: R

    Schema of the chained output. Captured by running the factory once on a stub LiveSeries<SBase> at construction.

    Methods

    • Partition column drops by default. rolling's output schema only retains columns named in mapping. Include the partition column with a passthrough reducer (e.g. host: 'last') to keep it visible in the unified output.

      Type Parameters

      • const M extends
            | Readonly<
                Record<
                    string,
                    | AggregateReducer
                    | Readonly<
                        {
                            from: ValueColumnsForSchema<R>[number]["name"];
                            kind?: ScalarKind | undefined;
                            using: AggregateFunctionsForKind<
                                Extract<
                                    ValueColumnsForSchema<(...)>[number],
                                    ColumnDef<(...)[(...)], ScalarKind>,
                                >["kind"],
                            >;
                        },
                    >,
                >,
            >
            | {
                readonly [K in string
                | number
                | symbol]: K extends ValueColumnsForSchema<R>[number]["name"]
                    ?
                        | Readonly<
                            {
                                from: ValueColumnsForSchema<R>[number]["name"];
                                kind?: ScalarKind;
                                using: AggregateFunctionsForKind<
                                    Extract<
                                        ValueColumnsForSchema<(...)>[number],
                                        ColumnDef<(...)[(...)], ScalarKind>,
                                    >["kind"],
                                >;
                            },
                        >
                        | AggregateFunctionsForKind<
                            ColumnKindByName<ValueColumnsForSchema<R>, K & string>,
                        >
                    : string extends K
                        ? | AggregateReducer
                        | Readonly<
                            {
                                from: ValueColumnsForSchema<R>[number]["name"];
                                kind?: ScalarKind | undefined;
                                using: AggregateFunctionsForKind<
                                    Extract<(...)[(...)], ColumnDef<(...), (...)>>["kind"],
                                >;
                            },
                        >
                        : Readonly<
                            {
                                from: ValueColumnsForSchema<R>[number]["name"];
                                kind?: ScalarKind;
                                using: AggregateFunctionsForKind<
                                    Extract<
                                        ValueColumnsForSchema<(...)>[number],
                                        ColumnDef<(...)[(...)], ScalarKind>,
                                    >["kind"],
                                >;
                            },
                        >
            }

      Parameters

      Returns LivePartitionedView<
          SBase,
          readonly [R[0], AggregateColumns<ValueColumnsForSchema<R>, M>],
          K,
          ByCol,
      >

    • Partition column drops by default. rolling's output schema only retains columns named in mapping. Include the partition column with a passthrough reducer (e.g. host: 'last') to keep it visible in the unified output.

      Type Parameters

      • const M extends
            | Readonly<
                Record<
                    string,
                    | AggregateReducer
                    | Readonly<
                        {
                            from: ValueColumnsForSchema<R>[number]["name"];
                            kind?: ScalarKind | undefined;
                            using: AggregateFunctionsForKind<
                                Extract<
                                    ValueColumnsForSchema<(...)>[number],
                                    ColumnDef<(...)[(...)], ScalarKind>,
                                >["kind"],
                            >;
                        },
                    >,
                >,
            >
            | {
                readonly [K in string
                | number
                | symbol]: K extends ValueColumnsForSchema<R>[number]["name"]
                    ?
                        | Readonly<
                            {
                                from: ValueColumnsForSchema<R>[number]["name"];
                                kind?: ScalarKind;
                                using: AggregateFunctionsForKind<
                                    Extract<
                                        ValueColumnsForSchema<(...)>[number],
                                        ColumnDef<(...)[(...)], ScalarKind>,
                                    >["kind"],
                                >;
                            },
                        >
                        | AggregateFunctionsForKind<
                            ColumnKindByName<ValueColumnsForSchema<R>, K & string>,
                        >
                    : string extends K
                        ? | AggregateReducer
                        | Readonly<
                            {
                                from: ValueColumnsForSchema<R>[number]["name"];
                                kind?: ScalarKind | undefined;
                                using: AggregateFunctionsForKind<
                                    Extract<(...)[(...)], ColumnDef<(...), (...)>>["kind"],
                                >;
                            },
                        >
                        : Readonly<
                            {
                                from: ValueColumnsForSchema<R>[number]["name"];
                                kind?: ScalarKind;
                                using: AggregateFunctionsForKind<
                                    Extract<
                                        ValueColumnsForSchema<(...)>[number],
                                        ColumnDef<(...)[(...)], ScalarKind>,
                                    >["kind"],
                                >;
                            },
                        >
            }

      Parameters

      Returns LivePartitionedSyncRolling<R, K, SeriesSchema>

    • Partition column drops by default. rolling's output schema only retains columns named in mapping. Include the partition column with a passthrough reducer (e.g. host: 'last') to keep it visible in the unified output.

      Type Parameters

      • const M extends
            | Readonly<
                Record<
                    string,
                    | AggregateReducer
                    | Readonly<
                        {
                            from: ValueColumnsForSchema<R>[number]["name"];
                            kind?: ScalarKind | undefined;
                            using: AggregateFunctionsForKind<
                                Extract<
                                    ValueColumnsForSchema<(...)>[number],
                                    ColumnDef<(...)[(...)], ScalarKind>,
                                >["kind"],
                            >;
                        },
                    >,
                >,
            >
            | {
                readonly [K in string
                | number
                | symbol]: K extends ValueColumnsForSchema<R>[number]["name"]
                    ?
                        | Readonly<
                            {
                                from: ValueColumnsForSchema<R>[number]["name"];
                                kind?: ScalarKind;
                                using: AggregateFunctionsForKind<
                                    Extract<
                                        ValueColumnsForSchema<(...)>[number],
                                        ColumnDef<(...)[(...)], ScalarKind>,
                                    >["kind"],
                                >;
                            },
                        >
                        | AggregateFunctionsForKind<
                            ColumnKindByName<ValueColumnsForSchema<R>, K & string>,
                        >
                    : string extends K
                        ? | AggregateReducer
                        | Readonly<
                            {
                                from: ValueColumnsForSchema<R>[number]["name"];
                                kind?: ScalarKind | undefined;
                                using: AggregateFunctionsForKind<
                                    Extract<(...)[(...)], ColumnDef<(...), (...)>>["kind"],
                                >;
                            },
                        >
                        : Readonly<
                            {
                                from: ValueColumnsForSchema<R>[number]["name"];
                                kind?: ScalarKind;
                                using: AggregateFunctionsForKind<
                                    Extract<
                                        ValueColumnsForSchema<(...)>[number],
                                        ColumnDef<(...)[(...)], ScalarKind>,
                                    >["kind"],
                                >;
                            },
                        >
            }

      Parameters

      Returns
          | LivePartitionedSyncRolling<R, K, SeriesSchema>
          | LivePartitionedView<
              SBase,
              readonly [R[0], AggregateColumns<ValueColumnsForSchema<R>, M>],
              K,
              ByCol,
          >

    • Keyed-form fused multi-window rolling on a chained LivePartitionedView. Same shape as the root variant — each partition's chain output flows into one fused rolling that maintains N windows in one ingest pass and emits one merged event per partition per boundary.

      Clock trigger required (same constraint as the root partitioned fused — synced cross-partition emission).

      Type Parameters

      Parameters

      Returns LivePartitionedFusedRolling<
          R,
          K,
          readonly [
              ColumnDef<"time", "time">,
              ColumnDef<ByCol, FromColumnKind<R, ByCol> & string> & { required: false },
              FusedRollingColumns<R, FM>,
          ],
      >

    • Materialize the chained view per-partition as a Map<K, LiveSource<R>>. Runs the composed factory once per existing partition; auto-spawn from the root partitioned series is not propagated into this map (the snapshot reflects partitions at the time of the call).

      Each factory output (a LiveView / LiveRollingAggregation / etc.) holds an internal subscription to its source. To avoid accumulating listeners across repeated calls, every factory output's dispose() is registered on the root's disposer set — calling partitioned.dispose() on the root cleans up every toMap-created subscription chain.

      For a live-updating per-partition view, subscribe to the root partitionBy directly with toMap() and call the factory yourself, or use collect() for a unified buffer.

      Returns Map<K, LiveSource<R>>