UNPKG

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.

59 lines (58 loc) 2.38 kB
// 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'; import { LeaderContentData } from '../duc/leader-content-data'; export class LeaderContent { constructor() { this.bb = null; this.bb_pos = 0; } __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } static getRootAsLeaderContent(bb, obj) { return (obj || new LeaderContent()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } static getSizePrefixedRootAsLeaderContent(bb, obj) { bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new LeaderContent()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } leaderContentType() { const offset = this.bb.__offset(this.bb_pos, 4); return offset ? this.bb.readUint8(this.bb_pos + offset) : null; } contentType() { const offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.readUint8(this.bb_pos + offset) : LeaderContentData.NONE; } content(obj) { const offset = this.bb.__offset(this.bb_pos, 8); return offset ? this.bb.__union(obj, this.bb_pos + offset) : null; } static startLeaderContent(builder) { builder.startObject(3); } static addLeaderContentType(builder, leaderContentType) { builder.addFieldInt8(0, leaderContentType, null); } static addContentType(builder, contentType) { builder.addFieldInt8(1, contentType, LeaderContentData.NONE); } static addContent(builder, contentOffset) { builder.addFieldOffset(2, contentOffset, 0); } static endLeaderContent(builder) { const offset = builder.endObject(); return offset; } static createLeaderContent(builder, leaderContentType, contentType, contentOffset) { LeaderContent.startLeaderContent(builder); if (leaderContentType !== null) LeaderContent.addLeaderContentType(builder, leaderContentType); LeaderContent.addContentType(builder, contentType); LeaderContent.addContent(builder, contentOffset); return LeaderContent.endLeaderContent(builder); } }