UNPKG

@snap/camera-kit

Version:
78 lines 3.05 kB
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; export const protobufPackage = "snapchat.cdp.cof"; function createBaseBoltSignals() { return { boltUseCase: 0, boltCdnExperimentationId: 0, boltIsContentPopular: false, boltClientAppState: 0 }; } export const BoltSignals = { encode(message, writer = new BinaryWriter()) { if (message.boltUseCase !== 0) { writer.uint32(8).uint32(message.boltUseCase); } if (message.boltCdnExperimentationId !== 0) { writer.uint32(16).uint32(message.boltCdnExperimentationId); } if (message.boltIsContentPopular !== false) { writer.uint32(24).bool(message.boltIsContentPopular); } if (message.boltClientAppState !== 0) { writer.uint32(32).int32(message.boltClientAppState); } return writer; }, decode(input, length) { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBoltSignals(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.boltUseCase = reader.uint32(); continue; } case 2: { if (tag !== 16) { break; } message.boltCdnExperimentationId = reader.uint32(); continue; } case 3: { if (tag !== 24) { break; } message.boltIsContentPopular = reader.bool(); continue; } case 4: { if (tag !== 32) { break; } message.boltClientAppState = reader.int32(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, create(base) { return BoltSignals.fromPartial(base !== null && base !== void 0 ? base : {}); }, fromPartial(object) { var _a, _b, _c, _d; const message = createBaseBoltSignals(); message.boltUseCase = (_a = object.boltUseCase) !== null && _a !== void 0 ? _a : 0; message.boltCdnExperimentationId = (_b = object.boltCdnExperimentationId) !== null && _b !== void 0 ? _b : 0; message.boltIsContentPopular = (_c = object.boltIsContentPopular) !== null && _c !== void 0 ? _c : false; message.boltClientAppState = (_d = object.boltClientAppState) !== null && _d !== void 0 ? _d : 0; return message; }, }; //# sourceMappingURL=bolt_provided_signals.js.map