import { protobuf_encode, protobuf_decode } from '@snowluma/proton'; export function encodeViaWrapper(value: T): Uint8Array { return protobuf_encode(value); } export function decodeViaWrapper(data: Uint8Array): T { return protobuf_decode(data); } export const encodeArrowWrapper = (value: T): Uint8Array => protobuf_encode(value); export const decodeArrowWrapper = (data: Uint8Array): T => protobuf_decode(data); export function encodeSecondGeneric(_ignored: Ignored, value: T): Uint8Array { return protobuf_encode(value); } export function passthroughOnly(value: T): T { return value; } export const wrapperObject = { encode(value: T): Uint8Array { return protobuf_encode(value); }, decode(data: Uint8Array): T { return protobuf_decode(data); }, encodeArrow: (value: T): Uint8Array => protobuf_encode(value), }; export function encodeWithBranch(value: T, enabled: boolean): Uint8Array { if (enabled) { return protobuf_encode(value); } return protobuf_encode(value); } export function encodeWithNestedHelper(value: T): Uint8Array { function inner(payload: T): Uint8Array { return protobuf_encode(payload); } return inner(value); } export function encodeChained(value: T): Uint8Array { return encodeViaWrapper(value); }