livekit-client
Version:
JavaScript/TypeScript client SDK for LiveKit
26 lines • 1.27 kB
TypeScript
import { type Throws } from '@livekit/throws-transformer/throws';
import { LivekitReasonedError } from '../errors';
export declare enum DataTrackHandleErrorReason {
Reserved = 0,
TooLarge = 1
}
export declare class DataTrackHandleError<Reason extends DataTrackHandleErrorReason = DataTrackHandleErrorReason> extends LivekitReasonedError<DataTrackHandleErrorReason> {
readonly name = "DataTrackHandleError";
reason: Reason;
reasonName: string;
constructor(message: string, reason: Reason);
isReason<R extends DataTrackHandleErrorReason>(reason: R): this is DataTrackHandleError<R>;
static tooLarge(): DataTrackHandleError<DataTrackHandleErrorReason.TooLarge>;
static reserved(value: number): DataTrackHandleError<DataTrackHandleErrorReason.Reserved>;
}
export type DataTrackHandle = number;
export declare const DataTrackHandle: {
fromNumber(raw: number): Throws<DataTrackHandle, DataTrackHandleError>;
};
/** Manage allocating new handles which don't conflict over the lifetime of the client. */
export declare class DataTrackHandleAllocator {
value: number;
/** Returns a unique track handle for the next publication, if one can be obtained. */
get(): DataTrackHandle | null;
}
//# sourceMappingURL=handle.d.ts.map