Skip to content

Missing DataSet constructor in Typescript definitions #279

@sgielen

Description

@sgielen

In issue #112, it's suggested to create a DataSet like this:

const dataSet = new dicomParser.DataSet(byteStream.byteArrayParser, byteStream.byteArray, {});

I see in dataSet.js that this is supported:

export default class DataSet {
  constructor (byteArrayParser, byteArray, elements) {
    this.byteArrayParser = byteArrayParser;
    this.byteArray = byteArray;
    this.elements = elements;
  }
// ...

However, the Typescript definition does not allow this because here, DataSet is an interface and not a class with a constructor:

  export interface DataSet {
    byteArray: ByteArray;
    byteArrayParser : ByteArrayParser;
    /**
     * Access element with the DICOM tag in the format xGGGGEEEE.
     */
    elements: {
      [tag: string]: Element;
    };
    warnings: string[];

    /* ... no constructor ... */
  }

Is there a way to do this in proper Typescript that I'm missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions