import { loadQkforceTestData } from './qkforce-test-data.mjs'; export type QkforceScalarType = 'string' | 'integer' | 'number' | 'boolean' | 'date'; export interface QkforceTypeDescriptor { type: QkforceScalarType; nullable?: boolean; } export type QkforceTypeRule = QkforceScalarType | QkforceTypeDescriptor; export type QkforceTypedSchema = Readonly>; export type QkforceRawRow = Readonly>; export type QkforceTypedRow = Readonly>; export interface QkforceDatasetMetadata { readonly datasetId:string; readonly versionId:string; readonly versionNumber:number; readonly logicalName:string; readonly path:string; readonly sha256:string; readonly rowCount:number; readonly contentType:'text/csv; charset=utf-8'; } export interface QkforceDataset { readonly metadata:QkforceDatasetMetadata; readonly headers:readonly string[]; readonly rowCount:number; rows():readonly QkforceRawRow[]; row(index:number):QkforceRawRow; where(criteria:Readonly>):readonly QkforceRawRow[]; first(criteria:Readonly>):QkforceRawRow; typedRow(index:number,schema:QkforceTypedSchema):QkforceTypedRow; } export interface QkforceTestDataProvenance { readonly testDataLockSha256?:string; readonly testData?:readonly Readonly<{datasetId:string;versionId:string;sha256:string}>[]; } export interface QkforceTestDataProvider { readonly size:number; datasets():readonly QkforceDatasetMetadata[]; has(nameOrId:string):boolean; dataset(nameOrId:string):QkforceDataset; provenance():QkforceTestDataProvenance; } export interface LoadQkforceTestDataOptions { required?: boolean; } export function loadTestData(rootDirectory:string = process.cwd(), options:LoadQkforceTestDataOptions = {}):QkforceTestDataProvider { return loadQkforceTestData(rootDirectory, options) as QkforceTestDataProvider; }