import type { BlockPublishRunner, BlockViewer, SignedHydratedBlockWithHashMeta, XL1BlockNumber, XL1BlockRange } from '@xyo-network/xl1-protocol/protocol-lib'; import { z } from 'zod'; import { AbstractS3Provider } from './AbstractS3Provider.ts'; /** A progress event emitted while publishing blocks. */ export interface BlockPublishProgress { /** Source block most recently completed by the publishing pass. */ blockNumber: XL1BlockNumber; /** Number of blocks completed by the current publishing pass. */ published: number; /** Total number of blocks scheduled by the current publishing pass. */ total: number; } /** Concurrency and progress options for static block publication (`config.options`). */ export declare const S3BlockPublishRunnerOptionsZod: z.ZodObject<{ concurrency: z.ZodDefault>; progressInterval: z.ZodDefault>; }, z.core.$strip>; /** Concurrency and progress options for static block publication. */ export type S3BlockPublishRunnerOptions = z.infer; /** * Publishes finalized blocks (and their payloads) as the static REST file layout that * `RestBlockViewer` reads (see `@xyo-network/xl1-network-model` static REST layout). * * Publishing is idempotent: keys are deterministic and contents immutable, so re-publishing * any range is safe. `sync(from)` resumes from a caller-supplied cursor (typically the block * after the last published head); omitting it republishes from genesis, which is safe. */ export declare class S3BlockPublishRunner extends AbstractS3Provider implements BlockPublishRunner { /** Connection kinds supported by this provider. */ static readonly connectionTypes: readonly ["s3"]; /** Primary moniker used to resolve this provider. */ static readonly defaultMoniker: "BlockPublishRunner"; /** Provider monikers that must resolve before this provider can be created. */ static readonly dependencies: "BlockViewer"[]; /** Provider monikers implemented by this provider class. */ static readonly monikers: "BlockPublishRunner"[]; /** Read, write, or mixed capability surface exposed by the provider. */ static readonly surface: "node"; /** Moniker implemented by this provider instance. */ moniker: "BlockPublishRunner"; /** * Called every `progressInterval` blocks (and at pass completion). Assign after creation; * when unset, the same events are logged so long backfills are observable out of the box. */ onProgress?: (event: BlockPublishProgress) => void; protected _source?: BlockViewer; private _options?; /** Maximum concurrent S3 block publications; defaults to eight. */ get concurrency(): number; /** Number of completed blocks between progress reports. */ get progressInterval(): number; /** Finalized block viewer from which static files are published. */ get source(): BlockViewer; /** Options parsed once from the materialized provider options. */ private get options(); /** Creates the provider instance after its dependencies and configuration have resolved. */ createHandler(): Promise; /** * Finds where a catch-up sync should start: walks backwards from the source head probing * by-number paths (in batches of `concurrency`) until it finds an already published block, * never probing below `floor`, and returns the block after it. * * This is what makes resuming cheap after a bucket was primed externally (an importer * CLI) or after publishing was toggled off and on: already published blocks above a * stale or missing head pointer are skipped instead of republished. * * Scope: only the topmost contiguous gap is healed. The walk stops at the first published * block, so holes below it are not probed — deep verification belongs to an importer or * audit tool. The walk also trusts that whoever published a block also published its * payloads and step files. As a fast path, a missing genesis block with `floor` at * genesis is treated as an empty bucket (full backfill) without walking the whole range. */ findCatchUpStart(floor?: XL1BlockNumber): Promise; /** True when the block is already published at its by-number path. */ hasBlock(blockNumber: XL1BlockNumber): Promise; /** Publishes one block at its by-number and by-hash paths, plus its payload files. */ publishBlock(blockNumber: XL1BlockNumber): Promise; /** Publishes the finalized layout descriptor (idempotent; refreshed on each sync). */ publishManifest(): Promise; /** * Publishes every block from `from` (inclusive, default genesis) through the source head. * Returns the published range, or null when already up to date. */ sync(from?: XL1BlockNumber): Promise; /** Emits a progress event to the onProgress callback, or logs it when no callback is set. */ private report; } //# sourceMappingURL=S3BlockPublishRunner.d.ts.map