/**
 * @fileoverview Schema inference for canvas table registration. Engine-agnostic
 * — produces `ColumnSchema[]` from observed JS values; providers map those
 * tags to native types when needed. `VARCHAR` is the safe fallback for
 * ambiguous unions. Used by the DuckDB provider for the no-explicit-schema
 * sync path and by the spillover helper to infer a schema from its preview
 * buffer when the source is async.
 * @module src/services/canvas/core/schemaSniffer
 */
import type { ColumnSchema } from '../types.js';
/** Row shape — mirrors what registerTable accepts. */
type Row = Record<string, unknown>;
/**
 * Sniff outcome. Callers must drain via `remaining`; re-iterating the original
 * input would lose data on generators or duplicate rows on fresh-iterator
 * iterables.
 */
export interface SniffedSchema {
    /**
     * Iterator positioned just past `sniffedRows`. May yield zero items when the
     * input fit entirely inside the sniff window.
     */
    remaining: Iterator<Row>;
    schema: ColumnSchema[];
    /** Rows already consumed; append these first. */
    sniffedRows: Row[];
}
/**
 * Infer a `ColumnSchema[]` from a set of fully-buffered rows. Column ordering
 * follows first appearance. All inferred columns are `nullable: true` — a
 * sample can prove a column nullable, but can never prove NOT NULL (a null may
 * appear past the sniff window). Pass an explicit `RegisterTableOptions.schema`
 * to enforce NOT NULL constraints. Throws if `rows` is empty.
 */
export declare function inferSchemaFromRows(rows: readonly Row[]): ColumnSchema[];
/**
 * Buffer up to `sniffRowCount` rows and return the inferred schema, the
 * buffered rows, and a continuation iterator. Throws if the input is empty.
 *
 * Column ordering follows first appearance. All inferred columns are
 * `nullable: true` — pass an explicit schema to enforce NOT NULL.
 */
export declare function sniffSchema(iterable: Iterable<Row>, sniffRowCount: number): SniffedSchema;
export {};
//# sourceMappingURL=schemaSniffer.d.ts.map