import type { Encoder, EncoderResult, Uint8ArrayBuffer } from '@openobserve/browser-core'; import type { BrowserRecord, BrowserSegmentMetadata, CreationReason, SegmentContext } from '../../types'; import type { SerializationStats } from '../record'; export type FlushReason = Exclude | 'stop'; export type FlushCallback = (metadata: BrowserSegmentMetadata, stats: SerializationStats, encoderResult: EncoderResult) => void; export type AddRecordCallback = (encodedBytesCount: number) => void; export interface Segment { addRecord: (record: BrowserRecord, stats: SerializationStats | undefined, callback: AddRecordCallback) => void; flush: (callback: FlushCallback) => void; } export declare function createSegment({ context, creationReason, encoder, }: { context: SegmentContext; creationReason: CreationReason; encoder: Encoder; }): Segment;