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.47 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';
import { DucTextDynamicSourceData } from '../duc/duc-text-dynamic-source-data';
export class DucTextDynamicSource {
constructor() {
this.bb = null;
this.bb_pos = 0;
}
__init(i, bb) {
this.bb_pos = i;
this.bb = bb;
return this;
}
static getRootAsDucTextDynamicSource(bb, obj) {
return (obj || new DucTextDynamicSource()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
static getSizePrefixedRootAsDucTextDynamicSource(bb, obj) {
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
return (obj || new DucTextDynamicSource()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
textSourceType() {
const offset = this.bb.__offset(this.bb_pos, 4);
return offset ? this.bb.readUint8(this.bb_pos + offset) : null;
}
sourceType() {
const offset = this.bb.__offset(this.bb_pos, 6);
return offset ? this.bb.readUint8(this.bb_pos + offset) : DucTextDynamicSourceData.NONE;
}
source(obj) {
const offset = this.bb.__offset(this.bb_pos, 8);
return offset ? this.bb.__union(obj, this.bb_pos + offset) : null;
}
static startDucTextDynamicSource(builder) {
builder.startObject(3);
}
static addTextSourceType(builder, textSourceType) {
builder.addFieldInt8(0, textSourceType, null);
}
static addSourceType(builder, sourceType) {
builder.addFieldInt8(1, sourceType, DucTextDynamicSourceData.NONE);
}
static addSource(builder, sourceOffset) {
builder.addFieldOffset(2, sourceOffset, 0);
}
static endDucTextDynamicSource(builder) {
const offset = builder.endObject();
return offset;
}
static createDucTextDynamicSource(builder, textSourceType, sourceType, sourceOffset) {
DucTextDynamicSource.startDucTextDynamicSource(builder);
if (textSourceType !== null)
DucTextDynamicSource.addTextSourceType(builder, textSourceType);
DucTextDynamicSource.addSourceType(builder, sourceType);
DucTextDynamicSource.addSource(builder, sourceOffset);
return DucTextDynamicSource.endDucTextDynamicSource(builder);
}
}