mirror of
https://github.com/LukeHagar/relay.git
synced 2025-12-11 04:21:28 +00:00
saving
This commit is contained in:
24
node_modules/@msgpack/msgpack/dist/ExtensionCodec.d.ts
generated
vendored
Normal file
24
node_modules/@msgpack/msgpack/dist/ExtensionCodec.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { ExtData } from "./ExtData";
|
||||
export declare type ExtensionDecoderType<ContextType> = (data: Uint8Array, extensionType: number, context: ContextType) => unknown;
|
||||
export declare type ExtensionEncoderType<ContextType> = (input: unknown, context: ContextType) => Uint8Array | null;
|
||||
export declare type ExtensionCodecType<ContextType> = {
|
||||
__brand?: ContextType;
|
||||
tryToEncode(object: unknown, context: ContextType): ExtData | null;
|
||||
decode(data: Uint8Array, extType: number, context: ContextType): unknown;
|
||||
};
|
||||
export declare class ExtensionCodec<ContextType = undefined> implements ExtensionCodecType<ContextType> {
|
||||
static readonly defaultCodec: ExtensionCodecType<undefined>;
|
||||
__brand?: ContextType;
|
||||
private readonly builtInEncoders;
|
||||
private readonly builtInDecoders;
|
||||
private readonly encoders;
|
||||
private readonly decoders;
|
||||
constructor();
|
||||
register({ type, encode, decode, }: {
|
||||
type: number;
|
||||
encode: ExtensionEncoderType<ContextType>;
|
||||
decode: ExtensionDecoderType<ContextType>;
|
||||
}): void;
|
||||
tryToEncode(object: unknown, context: ContextType): ExtData | null;
|
||||
decode(data: Uint8Array, type: number, context: ContextType): unknown;
|
||||
}
|
||||
Reference in New Issue
Block a user