import type { DriverSpecs } from './Driver.js'; import { type HasSql, type HasTable, type HasTarget, internalSql } from './Internal.js'; import { type Sql } from './Sql.js'; import type { Table, TableRow } from './Table.js'; import type { Expand } from './Types.js'; import type { Include } from './expr/Include.js'; import type { JoinOp } from './query/Query.js'; declare const nullable: unique symbol; export interface SelectionRecord extends Record { } export type IsNullable = { [nullable]: true; }; export type MakeNullable = Expand<{ [K in keyof T]: T[K] & IsNullable; }>; export type SelectionInput = HasSql | HasTable | HasTarget | SelectionRecord | Include; export type RowOfRecord = Expand<{ [Key in keyof Input as Key extends string ? Key : never]: SelectionRow; }>; export type SelectionRow = Input extends HasSql ? Value : Input extends IsNullable ? RowOfRecord | null : Input extends SelectionRecord ? RowOfRecord : Input extends Table ? TableRow : never; export interface MapRowContext { values: Array; index: number; specs: DriverSpecs; } export declare class Selection implements HasSql { #private; input: SelectionInput; nullable: Set; mapRow: (ctx: MapRowContext) => unknown; constructor(input: SelectionInput, nullable?: Set); makeVirtual(name: string): Input & HasTarget; fieldNames(): Array; get [internalSql](): Sql; join(right: HasTarget | Sql, operator: JoinOp): Selection; } export declare class TableSelection extends Selection { table: HasTable; constructor(table: HasTable); join(right: HasTarget | Sql, operator: JoinOp): Selection; } export declare class JoinSelection extends Selection { tables: Array; constructor(tables: Array, nullable: Set); join(right: HasTarget | Sql, operator: JoinOp): Selection; } export declare function selection(input: SelectionInput): Selection; export {};