dwv 0.32.2-beta.0 → 0.32.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dwv.d.ts CHANGED
@@ -18,9 +18,10 @@ export declare function addTagsToDictionary(group: string, tags: object): void;
18
18
  * // create the dwv app
19
19
  * const app = new dwv.App();
20
20
  * // initialise
21
- * app.init({
22
- * dataViewConfigs: {'*': [{divId: 'layerGroup0'}]}
23
- * });
21
+ * const viewConfig0 = new ViewConfig('layerGroup0');
22
+ * const viewConfigs = {'*': [viewConfig0]};
23
+ * const options = new AppOptions(viewConfigs);
24
+ * app.init(options);
24
25
  * // load dicom data
25
26
  * app.loadURLs([
26
27
  * 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm'
@@ -169,10 +170,11 @@ export declare class App {
169
170
  * // create the dwv app
170
171
  * const app = new dwv.App();
171
172
  * // initialise
172
- * app.init({
173
- * dataViewConfigs: {'*': [{divId: 'layerGroup0'}]},
174
- * viewOnFirstLoadItem: false
175
- * });
173
+ * const viewConfig0 = new ViewConfig('layerGroup0');
174
+ * const viewConfigs = {'*': [viewConfig0]};
175
+ * const options = new AppOptions(viewConfigs);
176
+ * options.viewOnFirstLoadItem = false;
177
+ * app.init(options);
176
178
  * // render button
177
179
  * const button = document.createElement('button');
178
180
  * button.id = 'render';
@@ -205,18 +207,18 @@ export declare class App {
205
207
  * Add an event listener to this class.
206
208
  *
207
209
  * @param {string} type The event type.
208
- * @param {object} callback The method associated with the provided
210
+ * @param {Function} callback The function associated with the provided
209
211
  * event type, will be called with the fired event.
210
212
  */
211
- addEventListener(type: string, callback: object): void;
213
+ addEventListener(type: string, callback: Function): void;
212
214
  /**
213
215
  * Remove an event listener from this class.
214
216
  *
215
217
  * @param {string} type The event type.
216
- * @param {object} callback The method associated with the provided
218
+ * @param {Function} callback The function associated with the provided
217
219
  * event type.
218
220
  */
219
- removeEventListener(type: string, callback: object): void;
221
+ removeEventListener(type: string, callback: Function): void;
220
222
  /**
221
223
  * Load a list of files. Can be image files or a state file.
222
224
  *
@@ -446,6 +448,13 @@ export declare class App {
446
448
  * Application options.
447
449
  */
448
450
  export declare class AppOptions {
451
+ /**
452
+ * @param {Object<string, ViewConfig[]>} dataViewConfigs DataId
453
+ * indexed object containing the data view configurations.
454
+ */
455
+ constructor(dataViewConfigs: {
456
+ [x: string]: ViewConfig[];
457
+ });
449
458
  /**
450
459
  * DataId indexed object containing the data view configurations.
451
460
  *
@@ -457,12 +466,10 @@ export declare class AppOptions {
457
466
  /**
458
467
  * Tool name indexed object containing individual tool configurations.
459
468
  *
460
- * @type {Object<string, {options: string[]}>}
469
+ * @type {Object<string, ToolConfig>}
461
470
  */
462
471
  tools: {
463
- [x: string]: {
464
- options: string[];
465
- };
472
+ [x: string]: ToolConfig;
466
473
  };
467
474
  /**
468
475
  * Optional array of layerGroup binder names.
@@ -950,18 +957,18 @@ export declare class DrawLayer {
950
957
  * Add an event listener to this class.
951
958
  *
952
959
  * @param {string} type The event type.
953
- * @param {object} callback The method associated with the provided
960
+ * @param {Function} callback The function associated with the provided
954
961
  * event type, will be called with the fired event.
955
962
  */
956
- addEventListener(type: string, callback: object): void;
963
+ addEventListener(type: string, callback: Function): void;
957
964
  /**
958
965
  * Remove an event listener from this class.
959
966
  *
960
967
  * @param {string} type The event type.
961
- * @param {object} callback The method associated with the provided
968
+ * @param {Function} callback The function associated with the provided
962
969
  * event type.
963
970
  */
964
- removeEventListener(type: string, callback: object): void;
971
+ removeEventListener(type: string, callback: Function): void;
965
972
  #private;
966
973
  }
967
974
 
@@ -1485,18 +1492,18 @@ declare class Image_2 {
1485
1492
  * Add an event listener to this class.
1486
1493
  *
1487
1494
  * @param {string} type The event type.
1488
- * @param {object} callback The method associated with the provided
1495
+ * @param {Function} callback The function associated with the provided
1489
1496
  * event type, will be called with the fired event.
1490
1497
  */
1491
- addEventListener(type: string, callback: object): void;
1498
+ addEventListener(type: string, callback: Function): void;
1492
1499
  /**
1493
1500
  * Remove an event listener from this class.
1494
1501
  *
1495
1502
  * @param {string} type The event type.
1496
- * @param {object} callback The method associated with the provided
1503
+ * @param {Function} callback The function associated with the provided
1497
1504
  * event type.
1498
1505
  */
1499
- removeEventListener(type: string, callback: object): void;
1506
+ removeEventListener(type: string, callback: Function): void;
1500
1507
  /**
1501
1508
  * Set the inner buffer values at given offsets.
1502
1509
  *
@@ -1638,9 +1645,9 @@ export { Image_2 as Image }
1638
1645
  */
1639
1646
  export declare class Index {
1640
1647
  /**
1641
- * @param {Array} values The index values.
1648
+ * @param {number[]} values The index values.
1642
1649
  */
1643
- constructor(values: any[]);
1650
+ constructor(values: number[]);
1644
1651
  /**
1645
1652
  * Get the index value at the given array index.
1646
1653
  *
@@ -1663,9 +1670,9 @@ export declare class Index {
1663
1670
  /**
1664
1671
  * Get the values of this index.
1665
1672
  *
1666
- * @returns {Array} The array of values.
1673
+ * @returns {number[]} The array of values.
1667
1674
  */
1668
- getValues(): any[];
1675
+ getValues(): number[];
1669
1676
  /**
1670
1677
  * Check if the input index can be compared to this one.
1671
1678
  *
@@ -1684,9 +1691,9 @@ export declare class Index {
1684
1691
  * Compare indices and return different dimensions.
1685
1692
  *
1686
1693
  * @param {Index} rhs The index to compare to.
1687
- * @returns {Array} The list of different dimensions.
1694
+ * @returns {number[]} The list of different dimensions.
1688
1695
  */
1689
- compare(rhs: Index): any[];
1696
+ compare(rhs: Index): number[];
1690
1697
  /**
1691
1698
  * Add another index to this one.
1692
1699
  *
@@ -1705,10 +1712,10 @@ export declare class Index {
1705
1712
  /**
1706
1713
  * Get a string id from the index values in the form of: '#0-1_#1-2'.
1707
1714
  *
1708
- * @param {Array} [dims] Optional list of dimensions to use.
1715
+ * @param {number[]} [dims] Optional list of dimensions to use.
1709
1716
  * @returns {string} The string id.
1710
1717
  */
1711
- toStringId(dims?: any[]): string;
1718
+ toStringId(dims?: number[]): string;
1712
1719
  #private;
1713
1720
  }
1714
1721
 
@@ -1947,18 +1954,18 @@ export declare class LayerGroup {
1947
1954
  * Add an event listener to this class.
1948
1955
  *
1949
1956
  * @param {string} type The event type.
1950
- * @param {object} callback The method associated with the provided
1957
+ * @param {Function} callback The function associated with the provided
1951
1958
  * event type, will be called with the fired event.
1952
1959
  */
1953
- addEventListener(type: string, callback: object): void;
1960
+ addEventListener(type: string, callback: Function): void;
1954
1961
  /**
1955
1962
  * Remove an event listener from this class.
1956
1963
  *
1957
1964
  * @param {string} type The event type.
1958
- * @param {object} callback The method associated with the provided
1965
+ * @param {Function} callback The function associated with the provided
1959
1966
  * event type.
1960
1967
  */
1961
- removeEventListener(type: string, callback: object): void;
1968
+ removeEventListener(type: string, callback: Function): void;
1962
1969
  #private;
1963
1970
  }
1964
1971
 
@@ -2102,9 +2109,9 @@ export declare class Matrix33 {
2102
2109
  */
2103
2110
  export declare class Point {
2104
2111
  /**
2105
- * @param {Array} values The point values.
2112
+ * @param {number[]} values The point values.
2106
2113
  */
2107
- constructor(values: any[]);
2114
+ constructor(values: number[]);
2108
2115
  /**
2109
2116
  * Get the index value at the given array index.
2110
2117
  *
@@ -2127,9 +2134,9 @@ export declare class Point {
2127
2134
  /**
2128
2135
  * Get the values of this index.
2129
2136
  *
2130
- * @returns {Array} The array of values.
2137
+ * @returns {number[]} The array of values.
2131
2138
  */
2132
- getValues(): any[];
2139
+ getValues(): number[];
2133
2140
  /**
2134
2141
  * Check if the input point can be compared to this one.
2135
2142
  *
@@ -2148,9 +2155,9 @@ export declare class Point {
2148
2155
  * Compare points and return different dimensions.
2149
2156
  *
2150
2157
  * @param {Point} rhs The point to compare to.
2151
- * @returns {Array} The list of different dimensions.
2158
+ * @returns {number[]} The list of different dimensions.
2152
2159
  */
2153
- compare(rhs: Point): any[];
2160
+ compare(rhs: Point): number[];
2154
2161
  /**
2155
2162
  * Get the 3D part of this point.
2156
2163
  *
@@ -2659,6 +2666,24 @@ export declare class TagValueExtractor {
2659
2666
  }): number | undefined;
2660
2667
  }
2661
2668
 
2669
+ /**
2670
+ * Tool configuration.
2671
+ */
2672
+ export declare class ToolConfig {
2673
+ /**
2674
+ * @param {string[]} [options] Optional tool options.
2675
+ */
2676
+ constructor(options?: string[]);
2677
+ /**
2678
+ * Optional tool options.
2679
+ * For Draw: list of shape names.
2680
+ * For Filter: list of filter names.
2681
+ *
2682
+ * @type {string[]|undefined}
2683
+ */
2684
+ options: string[] | undefined;
2685
+ }
2686
+
2662
2687
  /**
2663
2688
  * Immutable 3D vector.
2664
2689
  */
@@ -2959,18 +2984,18 @@ export declare class View {
2959
2984
  * Add an event listener to this class.
2960
2985
  *
2961
2986
  * @param {string} type The event type.
2962
- * @param {object} callback The method associated with the provided
2987
+ * @param {Function} callback The function associated with the provided
2963
2988
  * event type, will be called with the fired event.
2964
2989
  */
2965
- addEventListener(type: string, callback: object): void;
2990
+ addEventListener(type: string, callback: Function): void;
2966
2991
  /**
2967
2992
  * Remove an event listener from this class.
2968
2993
  *
2969
2994
  * @param {string} type The event type.
2970
- * @param {object} callback The method associated with the provided
2995
+ * @param {Function} callback The function associated with the provided
2971
2996
  * event type.
2972
2997
  */
2973
- removeEventListener(type: string, callback: object): void;
2998
+ removeEventListener(type: string, callback: Function): void;
2974
2999
  /**
2975
3000
  * Get the image window/level that covers the full data range.
2976
3001
  * Warning: uses the latest set rescale LUT or the default linear one.
@@ -3035,6 +3060,10 @@ export declare class View {
3035
3060
  * of the associated HTML div.
3036
3061
  */
3037
3062
  export declare class ViewConfig {
3063
+ /**
3064
+ * @param {string} divId The associated HTML div id.
3065
+ */
3066
+ constructor(divId: string);
3038
3067
  /**
3039
3068
  * Associated HTML div id.
3040
3069
  *
@@ -3412,18 +3441,18 @@ export declare class ViewController {
3412
3441
  * Add an event listener to this class.
3413
3442
  *
3414
3443
  * @param {string} type The event type.
3415
- * @param {object} callback The method associated with the provided
3444
+ * @param {Function} callback The function associated with the provided
3416
3445
  * event type, will be called with the fired event.
3417
3446
  */
3418
- addEventListener(type: string, callback: object): void;
3447
+ addEventListener(type: string, callback: Function): void;
3419
3448
  /**
3420
3449
  * Remove an event listener from this class.
3421
3450
  *
3422
3451
  * @param {string} type The event type.
3423
- * @param {object} callback The method associated with the provided
3452
+ * @param {Function} callback The function associated with the provided
3424
3453
  * event type.
3425
3454
  */
3426
- removeEventListener(type: string, callback: object): void;
3455
+ removeEventListener(type: string, callback: Function): void;
3427
3456
  #private;
3428
3457
  }
3429
3458
 
@@ -3628,18 +3657,18 @@ export declare class ViewLayer {
3628
3657
  * Add an event listener to this class.
3629
3658
  *
3630
3659
  * @param {string} type The event type.
3631
- * @param {object} callback The method associated with the provided
3660
+ * @param {Function} callback The function associated with the provided
3632
3661
  * event type, will be called with the fired event.
3633
3662
  */
3634
- addEventListener(type: string, callback: object): void;
3663
+ addEventListener(type: string, callback: Function): void;
3635
3664
  /**
3636
3665
  * Remove an event listener from this class.
3637
3666
  *
3638
3667
  * @param {string} type The event type.
3639
- * @param {object} callback The method associated with the provided
3668
+ * @param {Function} callback The function associated with the provided
3640
3669
  * event type.
3641
3670
  */
3642
- removeEventListener(type: string, callback: object): void;
3671
+ removeEventListener(type: string, callback: Function): void;
3643
3672
  /**
3644
3673
  * Set the current position.
3645
3674
  *