omezarr-tilesource 0.0.3 → 0.1.2

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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Release](https://img.shields.io/github/v/release/TissUUmaps/OMEZarrTileSource?label=release)](https://github.com/TissUUmaps/OMEZarrTileSource/releases)
4
4
  [![Issues](https://img.shields.io/github/issues/TissUUmaps/OMEZarrTileSource?label=issues)](https://github.com/TissUUmaps/OMEZarrTileSource/issues)
5
5
  [![Pull requests](https://img.shields.io/github/issues-pr/TissUUmaps/OMEZarrTileSource?label=pr)](https://github.com/TissUUmaps/OMEZarrTileSource/pulls)
6
- [![Pages](https://img.shields.io/github/actions/workflow/status/TissUUmaps/OMEZarrTileSource/pages.yml?label=pages)](https://github.com/TissUUmaps/OMEZarrTileSource/actions/workflows/pages.yml)
6
+ [![Deploy](https://img.shields.io/github/actions/workflow/status/TissUUmaps/OMEZarrTileSource/deploy.yml?label=deploy)](https://github.com/TissUUmaps/OMEZarrTileSource/actions/workflows/deploy.yml)
7
7
  [![Publish](https://img.shields.io/github/actions/workflow/status/TissUUmaps/OMEZarrTileSource/publish.yml?label=publish)](https://github.com/TissUUmaps/OMEZarrTileSource/actions/workflows/publish.yml)
8
8
  [![NPM version](https://img.shields.io/npm/v/omezarr-tilesource?label=npm)](https://www.npmjs.com/package/omezarr-tilesource)
9
9
  [![License](https://img.shields.io/github/license/TissUUmaps/OMEZarrTileSource?label=license)](LICENSE)
@@ -16,10 +16,10 @@ OpenSeadragon 5 or newer
16
16
 
17
17
  ## Installation
18
18
 
19
- Using npm:
19
+ Using pnpm:
20
20
 
21
21
  ```sh
22
- npm install omezarr-tilesource
22
+ pnpm add omezarr-tilesource
23
23
  ```
24
24
 
25
25
  ## Usage
@@ -30,33 +30,39 @@ import { OMEZarrTileSource } from "omezarr-tilesource";
30
30
 
31
31
  const url = ...;
32
32
 
33
- // only necessary when using inline tile source configuration (see below)
33
+ // configuration with URL (only works with zipped OME-Zarr URLs ending with .ozx)
34
+ const tileSource1 = url;
35
+
36
+ // inline configuration with options object (requires prior enabling, see below)
34
37
  OMEZarrTileSource.enable(OpenSeadragon);
38
+ const tileSource2 = {
39
+ type: "ome-zarr",
40
+ url: url,
41
+ // zip: undefined, // undefined = OME-Zarr ZIP auto-detection based on .ozx suffix
42
+ // t: undefined,
43
+ // c: undefined,
44
+ // z: undefined
45
+ };
46
+
47
+ // direct instantiation with URL (works with any OME-Zarr storage backend)
48
+ const tileSource3 = new OMEZarrTileSource(url);
49
+
50
+ // direct instantiation with options object (no prior enabling required)
51
+ const tileSource4 = new OMEZarrTileSource({
52
+ url: url,
53
+ // zip: undefined, // undefined = OME-Zarr ZIP auto-detection based on .ozx suffix
54
+ // t: undefined,
55
+ // c: undefined,
56
+ // z: undefined
57
+ });
35
58
 
36
59
  const viewer = OpenSeadragon(
37
60
  ...
38
61
  tileSources: [
39
- // configuration with a URL string (only works with OME-Zarr ZIP URLs ending with .ozx)
40
- url,
41
- // inline configuration with an options object (requires prior enabling, see above)
42
- {
43
- type: "ome-zarr",
44
- url: url,
45
- // zip: undefined, // undefined = OME-Zarr ZIP auto-detection based on .ozx suffix
46
- // t: undefined,
47
- // c: undefined,
48
- // z: undefined
49
- },
50
- // direct instantiation with a URL string (works with any OME-Zarr storage backend)
51
- new OMEZarrTileSource(url),
52
- // direct instantiation with an options object (no prior enabling required)
53
- new OMEZarrTileSource({
54
- url: url,
55
- // zip: undefined, // undefined = OME-Zarr ZIP auto-detection based on .ozx suffix
56
- // t: undefined,
57
- // c: undefined,
58
- // z: undefined
59
- })
62
+ tileSource1,
63
+ tileSource2,
64
+ tileSource3,
65
+ tileSource4
60
66
  ]
61
67
  );
62
68
  ```
@@ -0,0 +1,52 @@
1
+ import { default as default_2 } from 'openseadragon';
2
+
3
+ export declare class OMEZarrTileSource extends default_2.TileSource {
4
+ static readonly DUMMY_XHR: XMLHttpRequest;
5
+ readonly url: string;
6
+ aspectRatio: number;
7
+ dimensions: default_2.Point;
8
+ maxLevel: number;
9
+ ready: boolean;
10
+ readonly zip?: boolean;
11
+ readonly t?: number;
12
+ readonly c?: number;
13
+ readonly z?: number;
14
+ private _omero?;
15
+ private _multiscale?;
16
+ private _axisIndices?;
17
+ private _arrays?;
18
+ constructor(url: string);
19
+ constructor(options: OMEZarrTileSourceOptions);
20
+ supports(data: string | object | object[] | Document): boolean;
21
+ configure(data: string | object | object[] | Document, _url: string, postData?: string | null): OMEZarrTileSourceOptions;
22
+ equals(other: default_2.TileSource): boolean;
23
+ getImageInfo(url: string): void;
24
+ getTileWidth(level: number): number;
25
+ getTileHeight(level: number): number;
26
+ getLevelScale(level: number): number;
27
+ getTileUrl(level: number, x: number, y: number): string;
28
+ getTileHashKey(level: number, x: number, y: number): string;
29
+ downloadTileStart(context: default_2.ImageJob): void;
30
+ downloadTileAbort(context: default_2.ImageJob): void;
31
+ static enable(os?: typeof default_2): void;
32
+ private static _getMultiscale;
33
+ private static _getAxisIndices;
34
+ }
35
+
36
+ export declare type OMEZarrTileSourceClass = typeof OMEZarrTileSource;
37
+
38
+ export declare interface OMEZarrTileSourceOptions {
39
+ type?: "ome-zarr";
40
+ url: string;
41
+ zip?: boolean;
42
+ t?: number;
43
+ c?: number;
44
+ z?: number;
45
+ }
46
+
47
+ export { }
48
+
49
+
50
+ declare module "openseadragon" {
51
+ let OMEZarrTileSource: OMEZarrTileSourceClass;
52
+ }