/** @packageDocumentation
 * @module ECDb
 */
import { Id64String } from "@itwin/core-bentley";
import { IModelDb } from "./IModelDb";
import { ChangeInstance, ChangesetReaderArgs, ChangeSource } from "./ChangesetReaderTypes";
import { AnyDb, SqliteChangeOp } from "./SqliteChangesetReader";
/**
 * Reads EC-typed changeset data natively from a changeset file, changeset group,
 * in-memory transaction, or local un-pushed changes.
 *
 * Implements [ChangeSource]($backend) so rows can be fed directly into
 * [PartialChangeUnifier]($backend) to merge partial (per-table) instances into
 * complete EC instances.
 *
 * When the current row is a non-EC internal SQLite table, [[isECTable]] is `false`
 * and both [[inserted]] and [[deleted]] remain `undefined`.
 *
 * @note The native reader operates one SQLite table-row at a time. Multi-table EC
 * instances must be merged using [PartialChangeUnifier]($backend).
 * @beta
 */
export declare class ChangesetReader implements Disposable, ChangeSource {
    private readonly _nativeReader;
    private _rowOptions?;
    private _propFilter;
    private _changeIndex;
    private _op?;
    private _isECTable?;
    private _tableName?;
    private _isIndirectChange?;
    /** The db used for EC schema resolution. */
    readonly db: AnyDb;
    /**
     * `true` when the current row belongs to an EC-mapped table.
     * Valid only after a successful call to [[step]].
     * @beta
     */
    get isECTable(): boolean;
    /**
     * Name of the SQLite table for the current change row.
     * Valid only after a successful call to [[step]].
     * @beta
     */
    get tableName(): string;
    /**
     * `true` when the current change was applied indirectly
     * Valid only after a successful call to [[step]].
     * @beta
     */
    get isIndirectChange(): boolean;
    /**
     * Post-change (inserted or updated-new) EC instance, populated after each [[step]] call.
     * `undefined` when the current row is a Delete or a non-EC table row or [[step]] returned false.
     * @beta
     */
    inserted?: ChangeInstance;
    /**
     * Pre-change (deleted or updated-old) EC instance, populated after each [[step]] call.
     * `undefined` when the current row is an Insert or a non-EC table row or [[step]] returned false.
     * @beta
     */
    deleted?: ChangeInstance;
    private constructor();
    /** Map public RowFormatOptions to the native adaptor options.
     * @internal */
    private toNativeRowOptions;
    /**
     * Open a changeset file from disk.
     * @param args.fileName Absolute path to the changeset file.
     * @param args.db Database at or after the changeset's ending state, used for schema resolution.
     * @param args.invert When `true`, invert all operations (Insert↔Delete).
     * @param args.valueOptions Row adaptor options controlling how EC property values are formatted.
     * @param args.propFilter Controls which properties are included. Defaults to `All`.
     * @beta
     */
    static openFile(args: {
        readonly fileName: string;
    } & ChangesetReaderArgs): ChangesetReader;
    /**
     * Concatenate multiple changeset files and read them as a single logical stream.
     * @param args.changesetFiles Ordered list of changeset file paths.
     * @param args.db Database with schema at or ahead of the last changeset.
     * @param args.valueOptions Row adaptor options controlling how EC property values are formatted.
     * @param args.propFilter Controls which properties are included. Defaults to `All`.
     * @beta
     */
    static openGroup(args: {
        readonly changesetFiles: string[];
    } & ChangesetReaderArgs): ChangesetReader;
    /**
     * Read pending (not yet pushed) local changes from an open IModelDb.
     * @param args.db Must be an [IModelDb]($backend) (not [ECDb]($backend)).
     * @param args.includeInMemoryChanges Also include in-memory (not yet saved to disk) changes.
     * @param args.valueOptions Row adaptor options controlling how EC property values are formatted.
     * @param args.propFilter Controls which properties are included. Defaults to `All`.
     * @beta
     */
    static openLocalChanges(args: Omit<ChangesetReaderArgs, "db"> & {
        db: IModelDb;
        includeInMemoryChanges?: boolean;
    }): ChangesetReader;
    /**
     * Read the in-memory (not yet saved to disk) changes of an open IModelDb.
     * @param args.db Must be an [IModelDb]($backend).
     * @param args.valueOptions Row adaptor options controlling how EC property values are formatted.
     * @param args.propFilter Controls which properties are included. Defaults to `All`.
     * @beta
     */
    static openInMemoryChanges(args: Omit<ChangesetReaderArgs, "db"> & {
        db: IModelDb;
    }): ChangesetReader;
    /**
     * Read a single saved transaction by its id.
     * @param args.db Must be an [IModelDb]($backend) ([ECDb]($backend) does not support transactions).
     * @param args.txnId The id of the saved transaction to read.
     * @param args.valueOptions Row adaptor options controlling how EC property values are formatted.
     * @param args.propFilter Controls which properties are included. Defaults to `All`.
     * @beta
     */
    static openTxn(args: Omit<ChangesetReaderArgs, "db"> & {
        db: IModelDb;
        txnId: Id64String;
    }): ChangesetReader;
    /**
     * Restrict iteration to changes from the named SQLite tables.
     * That means the rows for changes from other tables will be skipped entirely and won't be visible through the reader.
     * @param tableNames SQLite table names to include.
     * Note: Table names must be provided in the correct case for proper filtering.
     * @beta
     */
    setTableNameFilters(tableNames: Set<string>): void;
    /**
     * Restrict iteration to changes with the given operation types.
     * That means the rows for changes with other operation types will be skipped entirely and won't be visible through the reader.
     * @param ops Operations to include.
     * @beta
     */
    setOpCodeFilters(ops: Set<SqliteChangeOp>): void;
    /**
     * Restrict iteration to changes for the given EC class names.
     * That means the rows for changes from other EC classes will be skipped entirely and won't be visible through the reader.
     * @param classNames EC class names to include. The classNames should be in the full name format(i.e. "SchemaName:ClassName").
     * Note: Schema names and class names must be provided in the correct case for proper filtering. Derived classes are not automatically included, so they must be specified explicitly if needed.
     * @beta
     */
    setClassNameFilters(classNames: Set<string>): void;
    /**
     * Remove the table-name filters
     * @beta
     */
    clearTableNameFilters(): void;
    /**
     * Remove the op-code filters
     * @beta
     */
    clearOpCodeFilters(): void;
    /**
     * Remove the class-name filters
     * @beta
     */
    clearClassNameFilters(): void;
    /**
     * Advance to the next change and populate `inserted` and/or `deleted`.
     * @returns `true` while positioned on a valid change; `false` when the stream is exhausted.
     * @beta
     */
    step(): boolean;
    /**
     * SQLite opcode of the current change.
     * Valid only after a successful call to [[step]].
     * @beta
     */
    get op(): SqliteChangeOp;
    /**
     * Close the reader and release all native resources.
     * @beta
     */
    close(): void;
    /**
     * Implements the `Disposable` contract — calls [[close]].
     * @beta
     */
    [Symbol.dispose](): void;
}
//# sourceMappingURL=ChangesetReader.d.ts.map