"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.SendNotificationT = exports.SendNotification = void 0;
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
const flatbuffers = require("flatbuffers");
class SendNotification {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsSendNotification(bb, obj) {
        return (obj || new SendNotification()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsSendNotification(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new SendNotification()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    data(index) {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
    }
    dataLength() {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
    }
    dataArray() {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
    }
    static startSendNotification(builder) {
        builder.startObject(1);
    }
    static addData(builder, dataOffset) {
        builder.addFieldOffset(0, dataOffset, 0);
    }
    static createDataVector(builder, data) {
        builder.startVector(1, data.length, 1);
        for (let i = data.length - 1; i >= 0; i--) {
            builder.addInt8(data[i]);
        }
        return builder.endVector();
    }
    static startDataVector(builder, numElems) {
        builder.startVector(1, numElems, 1);
    }
    static endSendNotification(builder) {
        const offset = builder.endObject();
        builder.requiredField(offset, 4); // data
        return offset;
    }
    static createSendNotification(builder, dataOffset) {
        SendNotification.startSendNotification(builder);
        SendNotification.addData(builder, dataOffset);
        return SendNotification.endSendNotification(builder);
    }
    unpack() {
        return new SendNotificationT(this.bb.createScalarList(this.data.bind(this), this.dataLength()));
    }
    unpackTo(_o) {
        _o.data = this.bb.createScalarList(this.data.bind(this), this.dataLength());
    }
}
exports.SendNotification = SendNotification;
class SendNotificationT {
    data;
    constructor(data = []) {
        this.data = data;
    }
    pack(builder) {
        const data = SendNotification.createDataVector(builder, this.data);
        return SendNotification.createSendNotification(builder, data);
    }
}
exports.SendNotificationT = SendNotificationT;
