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.

42 lines (41 loc) 1.69 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 { _DucElementBase } from '../duc/duc-element-base'; export class DucEmbeddableElement { constructor() { this.bb = null; this.bb_pos = 0; } __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } static getRootAsDucEmbeddableElement(bb, obj) { return (obj || new DucEmbeddableElement()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } static getSizePrefixedRootAsDucEmbeddableElement(bb, obj) { bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new DucEmbeddableElement()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } base(obj) { const offset = this.bb.__offset(this.bb_pos, 4); return offset ? (obj || new _DucElementBase()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; } static startDucEmbeddableElement(builder) { builder.startObject(1); } static addBase(builder, baseOffset) { builder.addFieldOffset(0, baseOffset, 0); } static endDucEmbeddableElement(builder) { const offset = builder.endObject(); return offset; } static createDucEmbeddableElement(builder, baseOffset) { DucEmbeddableElement.startDucEmbeddableElement(builder); DucEmbeddableElement.addBase(builder, baseOffset); return DucEmbeddableElement.endDucEmbeddableElement(builder); } }