@tanstack/db
Version:
A reactive client store for building super fast apps on sync
32 lines (31 loc) • 1.17 kB
TypeScript
import { CompilationResult } from '../compiler/index.js';
import { IStreamBuilder } from '@tanstack/db-ivm';
import { ResultStream } from '../../types.js';
export type BucketRow = {
publicKey: unknown;
value: Record<PropertyKey, any>;
order: string | undefined;
};
export type BucketFacadeCompilation = {
edgeId: string;
rows: IStreamBuilder<[string, BucketRow]>;
activeBuckets: IStreamBuilder<[string, true]>;
hasOrderBy: boolean;
};
export declare const BUCKET_FACADE_REF: unique symbol;
export type BucketFacadeRef = {
[BUCKET_FACADE_REF]: {
edgeId: string;
bucketKey: string;
};
};
export type MaterializedCompilation = {
pipeline: ResultStream;
facades: Array<BucketFacadeCompilation>;
};
/**
* Compiles inline includes into the same D2 graph as their parent relation.
* Collection-valued includes become inert bucket references. The public facade
* adapter resolves those references after the graph reaches quiescence.
*/
export declare function materializeCompilation(compilation: CompilationResult, getRootKey?: (row: any) => unknown, reduceJoinedPublicKeys?: boolean): MaterializedCompilation;