@shapediver/sdk.sdtf-v1
Version:
Official sdTF SDK for TypeScript
22 lines (15 loc) • 677 B
text/typescript
import { ISdtfBuffer } from '@shapediver/sdk.sdtf-core';
import { SdtfBasePartialComponent } from './SdtfBasePartialComponent';
export class SdtfPartialBuffer extends SdtfBasePartialComponent implements Partial<ISdtfBuffer> {
byteLength?: number;
uri?: string;
additionalProperties: Record<string, unknown> = {};
toJson(): Record<string, unknown> {
const json: Record<string, unknown> = { ...this.additionalProperties };
if (this.byteLength !== undefined) json.byteLength = this.byteLength;
else delete json.byteLength;
if (this.uri !== undefined) json.uri = this.uri;
delete json.uri;
return json;
}
}