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.

45 lines (44 loc) 1.8 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 { ElementBackground } from '../duc/element-background'; import { ElementStroke } from '../duc/element-stroke'; export class DucLayerOverrides { constructor() { this.bb = null; this.bb_pos = 0; } __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } static getRootAsDucLayerOverrides(bb, obj) { return (obj || new DucLayerOverrides()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } static getSizePrefixedRootAsDucLayerOverrides(bb, obj) { bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH); return (obj || new DucLayerOverrides()).__init(bb.readInt32(bb.position()) + bb.position(), bb); } stroke(obj) { const offset = this.bb.__offset(this.bb_pos, 4); return offset ? (obj || new ElementStroke()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; } background(obj) { const offset = this.bb.__offset(this.bb_pos, 6); return offset ? (obj || new ElementBackground()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null; } static startDucLayerOverrides(builder) { builder.startObject(2); } static addStroke(builder, strokeOffset) { builder.addFieldOffset(0, strokeOffset, 0); } static addBackground(builder, backgroundOffset) { builder.addFieldOffset(1, backgroundOffset, 0); } static endDucLayerOverrides(builder) { const offset = builder.endObject(); return offset; } }