/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * * Typed Parquet writer. Two static constructors mirror the base class: * * - `openStream`: wrap an existing writable stream. * - `openFile`: open a path on disk, ensuring the parent directory exists first. * * Implements `AsyncDisposable` so `await using writer = await ParquetWriter.openFile(...)` flushes * and closes cleanly. `close()` internally serializes against any in-flight flush so back-to-back * dispose calls don't race. */ import { ParquetWriter as BaseParquetWriter } from "@dsnp/parquetjs"; import type { WriterOptions } from "@dsnp/parquetjs/dist/lib/declare.js"; import { type WriteStreamMinimal } from "@dsnp/parquetjs/dist/lib/util.js"; import { type ParquetRecordLike, ParquetSchema, type ParquetSchemaDefinition, ParquetSchemaDefinitionCache } from "./schema.ts"; /** * A typed Parquet writer, wrapping the base Parquet writer. */ export declare class ParquetWriter extends BaseParquetWriter implements AsyncDisposable { #private; schema: ParquetSchema; protected static readonly SchemaDefinitionCache: ParquetSchemaDefinitionCache; static openStream(schemaLike: ParquetSchema | ParquetSchemaDefinition, outputStream: WriteStreamMinimal, opts?: WriterOptions): Promise>; /** * Convenience method to create a new buffered parquet writer that writes to the specified file. */ static openFile(schemaLike: ParquetSchema | ParquetSchemaDefinition, sourcePath: string | Buffer | URL, opts?: WriterOptions): Promise>; /** * Set a metadata key-value pair on the writer. */ setMetadata(key: string, value: string): void; /** * Append a row to the buffer. If the buffer is full, the data will be written to disk. */ appendRow(row: T): Promise; /** * Flush all buffered data to disk, close the file, and release resources. */ close(): Promise; [Symbol.asyncDispose](): Promise; dispose(): Promise; } //# sourceMappingURL=writer.d.ts.map