import type { Readable } from 'stream'; import { type CustomerState } from '../entities/customer/customerValidator.js'; import type { HeaderInfo, ValidationContext } from '../entities/definition.js'; import type { CustomerPlan } from '../plan/customerPlan.js'; import type { Clock } from '../ports/clock.js'; import type { EntityServices } from '../ports/services.js'; import type { CsvLimits } from '../reader/readCsv.js'; import type { WriteOutcome } from './categoryWriter.js'; export interface CustomerWriterArgs { open: () => Readable; limits?: Partial; header: HeaderInfo; state: CustomerState; plan: CustomerPlan; /** The reading context: the store to ask, the mode, the time, the hash. */ context: ValidationContext; services: EntityServices; clock: Pick; /** The job is a resumed one (IMP-07): a customer that exists is updated even in mode `create`. */ resumed?: boolean; include?: (unit: { unit: number; rowNumber: number; key: string; }) => boolean; signal?: AbortSignal; /** Rows whose current state is asked of the store together. */ batchSize?: number; } /** * Writes the customers of a file that has been checked, in the order of the file * (ยง 4.3: they depend on nothing). A customer is created without the welcome * e-mail, with the password the file gives (a hash as it is, a plain one, or one * that nobody knows, D-27); a customer that exists is updated, and the password * columns are not read (CUS-09). The custom fields are saved after the customer, * with a call of their own, because core has no create-time path (CUS-10): when * that call fails the row is failed with the customer saved, and a re-run * completes it. */ export declare function writeCustomers(args: CustomerWriterArgs): AsyncGenerator;