ducjs
Version:
The duc 2D CAD file format is a cornerstone of our advanced design system, conceived to cater to professionals seeking precision and efficiency in their design work.
49 lines (48 loc) • 1.84 kB
JavaScript
// automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
import * as flatbuffers from 'flatbuffers';
export class BoundElement {
constructor() {
this.bb = null;
this.bb_pos = 0;
}
__init(i, bb) {
this.bb_pos = i;
this.bb = bb;
return this;
}
static getRootAsBoundElement(bb, obj) {
return (obj || new BoundElement()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
static getSizePrefixedRootAsBoundElement(bb, obj) {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new BoundElement()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
id(optionalEncoding) {
const offset = this.bb.__offset(this.bb_pos, 4);
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
}
type(optionalEncoding) {
const offset = this.bb.__offset(this.bb_pos, 6);
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
}
static startBoundElement(builder) {
builder.startObject(2);
}
static addId(builder, idOffset) {
builder.addFieldOffset(0, idOffset, 0);
}
static addType(builder, typeOffset) {
builder.addFieldOffset(1, typeOffset, 0);
}
static endBoundElement(builder) {
const offset = builder.endObject();
return offset;
}
static createBoundElement(builder, idOffset, typeOffset) {
BoundElement.startBoundElement(builder);
BoundElement.addId(builder, idOffset);
BoundElement.addType(builder, typeOffset);
return BoundElement.endBoundElement(builder);
}
}