import { LogBlockContainerOptions } from './types';
import { LogBlockModel } from './log-block-model';
import { IKosModelHolder, PublicModelInterface } from '../../../core/types';
import { IKosIdentifiable } from '../../../core/core/types';
import { IKosDataModel, KosCreationContext } from '../../../core/core/kosModel';
import { IKosModelContainer } from '../../../core/core/kos-container-model';

export declare const MODEL_TYPE = "log-block-container-model";
/**
 * Log Block Container Model - Manages multiple log blocks with automatic sorting and organization.
 *
 * This container model manages collections of LogBlockModel instances, providing organized access
 * to log blocks with automatic sorting by block number. It serves as the storage layer within
 * LogStreamModel instances, handling the efficient organization and retrieval of log blocks
 * that make up a complete log stream.
 *
 * ## Key Features
 * - **Automatic Sorting** - Maintains blocks sorted by block number for sequential access
 * - **Block Management** - Add, remove, and retrieve log blocks efficiently
 * - **Memory Organization** - Organized storage of log blocks within streams
 * - **Stream Integration** - Essential component of LogStreamModel architecture
 * - **Sequential Access** - Optimized for accessing blocks in chronological order
 *
 * ## Architecture Role
 * The container fits into the log streaming architecture as:
 * - **LogStreamModel** uses LogBlockContainerModel to organize its blocks
 * - **LogBlockContainerModel** manages multiple LogBlockModel instances
 * - **LogBlockModel** contains the actual log lines and metadata
 * - Automatic sorting by blockNum ensures proper sequential log ordering
 *
 * ## Common Use Cases
 * - **Stream Block Storage** - Central storage for all blocks within a log stream
 * - **Sequential Block Access** - Navigate through log blocks in chronological order
 * - **Block Organization** - Maintain sorted collections of log segments
 * - **Memory Management** - Efficiently organize log data for stream processing
 * - **Block Lifecycle** - Handle adding and removing blocks as streams evolve
 *
 * @example Container Usage Within Stream
 * ```typescript
 * // Typically used internally by LogStreamModel
 * const logStream = LogStream.instance('system-logs').build();
 * await logStream.load();
 *
 * // Access the container through the stream
 * const blockContainer = logStream._blocks; // Internal container
 * const blocks = logStream.blocks; // Public access to blocks
 *
 * // Container automatically sorts blocks by blockNum
 * console.log(`Stream has ${blocks.length} blocks`);
 * blocks.forEach(block => {
 *   console.log(`Block ${block.blockNum}: ${block.lineCount} lines`);
 * });
 * ```
 *
 * @example Direct Container Operations
 * ```typescript
 * // Create container (typically done internally)
 * const container = LogBlockContainer.instance('log-blocks')
 *   .options({})
 *   .build();
 *
 * // Add blocks to container
 * const block1 = LogBlock.instance('block-1')
 *   .options({
 *     nodeId: 'primary',
 *     stream: 'app-logs',
 *     blockNum: 1,
 *     startLineNum: 1,
 *     endLineNum: 100,
 *     startTime: new Date('2024-01-01T10:00:00Z'),
 *     endTime: new Date('2024-01-01T10:05:00Z'),
 *     lineCount: 100
 *   })
 *   .build();
 *
 * const block2 = LogBlock.instance('block-2')
 *   .options({
 *     nodeId: 'primary',
 *     stream: 'app-logs',
 *     blockNum: 2,
 *     startLineNum: 101,
 *     endLineNum: 200,
 *     startTime: new Date('2024-01-01T10:05:00Z'),
 *     endTime: new Date('2024-01-01T10:10:00Z'),
 *     lineCount: 100
 *   })
 *   .build();
 *
 * container.addModel(block1);
 * container.addModel(block2);
 *
 * // Blocks are automatically sorted by blockNum
 * const sortedBlocks = container.data;
 * console.log(`First block: ${sortedBlocks[0].blockNum}`); // 1
 * console.log(`Second block: ${sortedBlocks[1].blockNum}`); // 2
 * ```
 *
 * @example React Block List Component
 * ```typescript
 * const BlockList: React.FC<{ container: LogBlockContainerModel }> = kosComponent(({ container }) => {
 *   return (
 *     <div className="block-list">
 *       <h3>Log Blocks ({container.data.length})</h3>
 *       <div className="blocks">
 *         {container.data.map(block => (
 *           <div key={block.id} className="block-item">
 *             <div className="block-header">
 *               <span className="block-num">Block {block.blockNum}</span>
 *               <span className="line-range">
 *                 Lines {block.startLineNum}-{block.endLineNum}
 *               </span>
 *             </div>
 *             <div className="block-details">
 *               <span>Stream: {block.stream}</span>
 *               <span>Lines: {block.lineCount}</span>
 *               <span>Loaded: {block.lines.length}</span>
 *             </div>
 *             <div className="block-time">
 *               {block.startTime.toLocaleString()} - {block.endTime.toLocaleString()}
 *             </div>
 *           </div>
 *         ))}
 *       </div>
 *     </div>
 *   );
 * });
 * ```
 *
 * @group KOS Model
 * @category Device Logging
 * @interface
 *
 * @see {@link LogStreamModel} - Parent stream model that uses this container
 * @see {@link LogBlockModel} - Individual log blocks managed by this container
 * @see {@link LogBlockContainerOptions} - Configuration options for the container
 */
export type LogBlockContainerModel = PublicModelInterface<LogBlockContainerModelImpl>;
/**
 * @ignore
 * @internal
 */
export declare class LogBlockContainerModelImpl implements IKosIdentifiable, IKosModelHolder<LogBlockModel>, IKosDataModel {
    id: string;
    private logger;
    private _models;
    constructor(modelId: string, options: LogBlockContainerOptions, context: KosCreationContext);
    getModel(id: string): LogBlockModel | undefined;
    get models(): IKosModelContainer<LogBlockModel>;
    get data(): LogBlockModel[];
    addModel(model: LogBlockModel): void;
    removeModel(id: string): void;
    init(): Promise<void>;
    load(): Promise<void>;
}
//# sourceMappingURL=log-block-container-model.d.ts.map