import type { CompoundKey, System } from '../../../zero-protocol/src/ast.ts';
import type { Row, Value } from '../../../zero-protocol/src/data.ts';
import type { PrimaryKey } from '../../../zero-protocol/src/primary-key.ts';
import type { Node } from './data.ts';
import { type FetchRequest, type Input, type Output, type Storage } from './operator.ts';
import type { SourceSchema } from './schema.ts';
import { type Stream } from './stream.ts';
type Args = {
    parent: Input;
    child: Input;
    storage: Storage;
    parentKey: CompoundKey;
    childKey: CompoundKey;
    relationshipName: string;
    hidden: boolean;
    system: System;
};
/**
 * The Join operator joins the output from two upstream inputs. Zero's join
 * is a little different from SQL's join in that we output hierarchical data,
 * not a flat table. This makes it a lot more useful for UI programming and
 * avoids duplicating tons of data like left join would.
 *
 * The Nodes output from Join have a new relationship added to them, which has
 * the name #relationshipName. The value of the relationship is a stream of
 * child nodes which are the corresponding values from the child source.
 */
export declare class Join implements Input {
    #private;
    constructor({ parent, child, storage, parentKey, childKey, relationshipName, hidden, system, }: Args);
    destroy(): void;
    setOutput(output: Output): void;
    getSchema(): SourceSchema;
    fetch(req: FetchRequest): Stream<Node>;
    cleanup(req: FetchRequest): Stream<Node>;
}
/** Exported for testing. */
export declare function makeStorageKeyForValues(values: readonly Value[]): string;
/** Exported for testing. */
export declare function makeStorageKeyPrefix(row: Row, key: CompoundKey): string;
/** Exported for testing.
 * This storage key tracks the primary keys seen for each unique
 * value joined on. This is used to know when to cleanup a child's state.
 */
export declare function makeStorageKey(key: CompoundKey, primaryKey: PrimaryKey, row: Row): string;
export {};
//# sourceMappingURL=join.d.ts.map