import { n as MoqtObject } from '../byte_buffer-BOK6VPTF.cjs'; /** * Copyright 2025 The MOQtail Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ declare class NetworkTelemetry { private events; private windowMs; constructor(windowMs?: number); push({ latency, size }: { latency: number; size: number; }): void; private clean; get throughput(): number; get latency(): number; } /** * Copyright 2025 The MOQtail Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ interface BufferedObject { object: MoqtObject; createdAt: number; } interface Clock { now(): number; } /** * A playout buffer that manages timed delivery of MoQT objects. * * The buffer automatically extracts capture timestamps from extension headers * to determine when objects should be played out, maintaining consistent latency * and dropping old GOPs when necessary. * * Usage: * ```typescript * const buffer = new PlayoutBuffer(objectStream, { * targetLatencyMs: 500, * maxLatencyMs: 2000, * clock * }); * buffer.onObject = (obj) => { * if (obj) { * // Process the object * } else { * // End of stream * } * }; * ``` */ declare class PlayoutBuffer { #private; readonly options?: { targetLatencyMs: number; maxLatencyMs: number; clock: Clock; } | undefined; onObject: ((obj: MoqtObject | null) => void) | null; constructor(objectStream: ReadableStream, options?: { targetLatencyMs: number; maxLatencyMs: number; clock: Clock; } | undefined); hasObjectReady(): Promise; getStatus(): { bufferSize: number; isRunning: boolean; oldestTimestamp?: number; }; cleanup(): void; } /** * Copyright 2025 The MOQtail Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ declare class PullPlayoutBuffer { #private; readonly options: { bucketCapacity?: number; targetLatencyMs?: number; maxLatencyMs?: number; }; constructor(writeStream: ReadableStream, options: { bucketCapacity?: number; targetLatencyMs?: number; maxLatencyMs?: number; }); nextObject(callback: (obj: MoqtObject | null) => void): void; hasObjectReady(): boolean; getStatus(): { bufferSize: number; isRunning: boolean; }; cleanup(): void; } /** * Copyright 2025 The MOQtail Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ declare class ClockNormalizer { private offset; private timeServerUrl; private numSamples; private constructor(); static create(timeServerUrl?: string, numberOfSamples?: number): Promise; getSkew(): number; now(): number; recalibrate(): Promise; private static calculateSkew; private static takeSingleSample; } /** * Copyright 2025 The MOQtail Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @deprecated This class is deprecated and will be removed in a future version. * Use ClockNormalizer (see ./clock_normalizer.ts) instead for better time synchronization. * * @see {@link ClockNormalizer} - Modern replacement with better accuracy * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Performance/now} Performance.now() for basic timing * * @example * ```typescript * // ❌ Deprecated - Don't use * const offset = await AkamaiOffset.getClockSkew() * * // ✅ Use ClockNormalizer instead * import { ClockNormalizer } from './clock_normalizer' * const normalizer = await ClockNormalizer.create() * const offset = normalizer.getSkew() * const normalizedTime = normalizer.now() * ``` */ declare class AkamaiOffset { private static _offset; private static _promise; static getClockSkew(): Promise; private static ClockSkew; } export { AkamaiOffset, type BufferedObject, type Clock, ClockNormalizer, NetworkTelemetry, PlayoutBuffer, PullPlayoutBuffer };