Skip to content

Commit

Permalink
Merge pull request #209 from kmannislands/208-align-dataset-returns
Browse files Browse the repository at this point in the history
fix: correct DataSet method return type declarations
  • Loading branch information
yagni authored Sep 16, 2022
2 parents 0003d0f + 6ec467b commit df314f5
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,62 +37,62 @@ declare module 'dicom-parser' {
/**
* Finds the element for tag and returns an unsigned int 16 if it exists and has data. Use this function for VR type US.
*/
uint16: (tag: string, index?: number) => number;
uint16: (tag: string, index?: number) => number | undefined;

/**
* Finds the element for tag and returns a signed int 16 if it exists and has data. Use this function for VR type SS.
*/
int16: (tag: string, index?: number) => number;
int16: (tag: string, index?: number) => number | undefined;

/**
* Finds the element for tag and returns an unsigned int 32 if it exists and has data. Use this function for VR type UL.
*/
uint32: (tag: string, index?: number) => number;
uint32: (tag: string, index?: number) => number | undefined;

/**
* Finds the element for tag and returns a signed int 32 if it exists and has data. Use this function for VR type SL.
*/
int32: (tag: string, index?: number) => number;
int32: (tag: string, index?: number) => number | undefined;

/**
* Finds the element for tag and returns a 32 bit floating point number if it exists and has data. Use this function for VR type FL.
*/
float: (tag: string, index?: number) => number;
float: (tag: string, index?: number) => number | undefined;

/**
* Finds the element for tag and returns a 64 bit floating point number if it exists and has data. Use this function for VR type FD.
*/
double: (tag: string, index?: number) => number;
double: (tag: string, index?: number) => number | undefined;

/**
* Returns the actual Value Multiplicity of an element - the number of values in a multi-valued element.
*/
numStringValues: (tag: string) => number;
numStringValues: (tag: string) => number | undefined;

/**
* Finds the element for tag and returns a string if it exists and has data. Use this function for VR types AE, CS, SH, and LO.
*/
string: (tag: string, index?: number) => string;
string: (tag: string, index?: number) => string | undefined;

/**
* Finds the element for tag and returns a string with the leading spaces preserved and trailing spaces removed if it exists and has data. Use this function for VR types UT, ST, and LT.
*/
text: (tag: string, index?: number) => string;
text: (tag: string, index?: number) => string | undefined;

/**
* Finds the element for tag and parses a string to a float if it exists and has data. Use this function for VR type DS.
*/
floatString: (tag: string, index?: number) => number;
floatString: (tag: string, index?: number) => number | undefined;

/**
* Finds the element for tag and parses a string to an integer if it exists and has data. Use this function for VR type IS.
*/
intString: (tag: string, index?: number) => number;
intString: (tag: string, index?: number) => number | undefined;

/**
* Finds the element for tag and parses an element tag according to the 'AT' VR definition if it exists and has data. Use this function for VR type AT.
*/
attributeTag: (tag: string) => string;
attributeTag: (tag: string) => string | undefined;
}

export interface ByteStream {
Expand Down

0 comments on commit df314f5

Please sign in to comment.