import { HttpServerInfo } from "./http_helpers.js"; import { AxisValueType, BinaryPartitionedDataInfo, Branded, ColumnValueType, JsonDataInfo, JsonPartitionedDataInfo, PObjectId, ParquetChunk, ParquetPartitionedDataInfo } from "@milaboratories/pl-model-common"; //#region src/pframe/internal_api/api_factory.d.ts /** PColumn spec file extension */ declare const SpecExtension: ".spec"; /** PColumn data info file extension */ declare const DataInfoExtension: ".datainfo"; /** Abstract identifier of a data blob that can be requested from the storage backend */ type PFrameBlobId = Branded; /** Path of the file containing requested data (blob). This path is returned by * {@link BlobPathResolver} as soon as blob materialized in the file system. */ type FilePath = string; /** Data source allows PFrame to retrieve the data blobs for columns with assigned data info. */ interface PFrameDataSourceV2 { /** * PFrame may notify storage backend about its plans to use particular blobs in the future. * Storage backend will do its best to preload specified blob so the subsequent * {@link resolveBlob} will quickly return preloaded file path. */ preloadBlob(blobIds: PFrameBlobId[]): Promise; /** Returns raw blob data given the blob id from {@link DataInfo}. */ resolveBlobContent(blobId: PFrameBlobId): Promise; /** * Parquet HTTP(S) server connection settings, {@link HttpHelpers.createHttpServer} * When not provided, parquet BlobIds would be treated as local file paths. */ parquetServer?: HttpServerInfo; } /** * Structural type information for a single PColumn needed by the data side: * the axis value types (in canonical order) and the column value type. Mirrors * the on-disk `typeSpec` shape (`{ axes, column }`). */ type PColumnValueTypeSpec = { readonly axes: AxisValueType[]; readonly column: ColumnValueType; }; /** * Union type representing all possible data storage formats for PColumn data. * The specific format used depends on data size, access patterns, and performance requirements. * * @template Blob - Type parameter representing the storage reference type (could be ResourceInfo, PFrameBlobId, etc.) */ type DataInfo = (JsonDataInfo | JsonPartitionedDataInfo | BinaryPartitionedDataInfo | ParquetPartitionedDataInfo>) & { /** * Self-contained structural type info. Present in data info produced by the * new converter, absent in data info produced by the old one. */ readonly typeSpec?: PColumnValueTypeSpec; }; /** * Self-contained data info: {@link DataInfo} with a required * {@link PColumnValueTypeSpec}, so the data layer can interpret the values * without a separate spec. This is the on-disk `.datainfo` shape and the * payload accepted by {@link PFrameFactoryAPIV6.addColumns}. * * @template Blob - Type parameter representing the storage reference type (could be ResourceInfo, PFrameBlobId, etc.) */ type DataInfoV2 = DataInfo & { readonly typeSpec: PColumnValueTypeSpec; }; /** * Single column entry for {@link PFrameFactoryAPIV6.addColumns}. The structural * type info is carried inside {@link DataInfoV2.typeSpec} rather than as a * separate field, so `data` is self-describing. */ interface AddColumnEntryV2 { /** Unique column identifier within the PFrame. */ readonly id: PObjectId; /** Self-contained data info (carries its own `typeSpec`). */ readonly data: DataInfoV2; } /** * API for populating a PFrame with columns and a data source. Each column's * structural type info is embedded in its self-contained * {@link AddColumnEntryV2.data} instead of a separate field. */ interface PFrameFactoryAPIV6 extends Disposable { /** Associates data source with this PFrame. */ setDataSource(dataSource: PFrameDataSourceV2): void; /** * Registers all PColumns at once: data info (self-contained, carrying its own * `typeSpec`) is attached atomically. For parquet data info, schema resolution * via network is performed during this call. */ addColumns(columns: AddColumnEntryV2[], options?: { signal?: AbortSignal; }): Promise; /** Releases all the data previously added to PFrame using methods above, * any interactions with disposed PFrame will result in exception */ dispose(): void; } //#endregion export { AddColumnEntryV2, DataInfo, DataInfoExtension, DataInfoV2, FilePath, PColumnValueTypeSpec, PFrameBlobId, PFrameDataSourceV2, PFrameFactoryAPIV6, SpecExtension }; //# sourceMappingURL=api_factory.d.ts.map