@idetik/core 0.2.3 → 0.4.0

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/index.d.ts CHANGED
@@ -1235,6 +1235,19 @@ declare const Image$1: z.ZodObject<{
1235
1235
  }>;
1236
1236
  type Image$1 = z.infer<typeof Image$1>;
1237
1237
 
1238
+ type AwsCredentials = {
1239
+ accessKeyId: string;
1240
+ secretAccessKey: string;
1241
+ sessionToken?: string;
1242
+ };
1243
+ type S3FetchStoreProps = {
1244
+ url: string;
1245
+ region?: string;
1246
+ credentials?: AwsCredentials;
1247
+ overrides?: RequestInit;
1248
+ useSuffixRequest?: boolean;
1249
+ };
1250
+
1238
1251
  type Version$1 = "v2" | "v3";
1239
1252
  type ZarrArrayParams = {
1240
1253
  arrayPath: string;
@@ -1242,11 +1255,9 @@ type ZarrArrayParams = {
1242
1255
  } & ({
1243
1256
  type: "fetch";
1244
1257
  url: string;
1245
- fetchOptions?: {
1246
- overrides?: RequestInit;
1247
- useSuffixRequest?: boolean;
1248
- };
1249
- } | {
1258
+ } | ({
1259
+ type: "s3";
1260
+ } & S3FetchStoreProps) | {
1250
1261
  type: "filesystem";
1251
1262
  directoryHandle: FileSystemDirectoryHandle;
1252
1263
  path: string;
@@ -1581,22 +1592,52 @@ type OmeroChannel = OmeroMetadata["channels"][number];
1581
1592
  declare function loadOmeroChannels(source: OmeZarrImageSource): Promise<OmeroChannel[]>;
1582
1593
  declare function loadOmeroDefaults(source: OmeZarrImageSource): Promise<OmeroMetadata["rdefs"]>;
1583
1594
 
1595
+ type HttpOmeZarrImageSourceProps = {
1596
+ url: string;
1597
+ version?: Version;
1598
+ };
1599
+ type S3OmeZarrImageSourceProps = S3FetchStoreProps & {
1600
+ version?: Version;
1601
+ };
1602
+ type FileSystemOmeZarrImageSourceProps = {
1603
+ directory: FileSystemDirectoryHandle;
1604
+ version?: Version;
1605
+ path?: `/${string}`;
1606
+ };
1584
1607
  /** Opens an OME-Zarr multiscale image Zarr group from either a URL or local directory. */
1585
1608
  declare class OmeZarrImageSource {
1586
1609
  readonly location: Location<Readable>;
1587
1610
  readonly version?: Version;
1611
+ private constructor();
1612
+ open(): Promise<OmeZarrImageLoader>;
1613
+ /**
1614
+ * Creates an OmeZarrImageSource from an HTTP(S) URL.
1615
+ *
1616
+ * @param url URL of Zarr root
1617
+ * @param version OME-Zarr version
1618
+ */
1619
+ static fromHttp(props: HttpOmeZarrImageSourceProps): OmeZarrImageSource;
1588
1620
  /**
1621
+ * Creates an OmeZarrImageSource from an S3 HTTP(S) URL.
1622
+ *
1589
1623
  * @param url URL of Zarr root
1624
+ * @param version OME-Zarr version
1625
+ * @param credentials AWS credentials for S3 authentication (will generate signatures per-request)
1626
+ * @param region AWS region for S3 bucket (e.g., 'us-east-1')
1627
+ * @param overrides RequestInit overrides to customize fetch behavior (e.g., custom headers for S3 authentication)
1628
+ * @param useSuffixRequest Whether to use suffix requests for range queries
1590
1629
  */
1591
- constructor(url: string, version?: Version);
1630
+ static fromS3(props: S3OmeZarrImageSourceProps): OmeZarrImageSource;
1592
1631
  /**
1632
+ * Creates an OmeZarrImageSource from a local filesystem directory.
1633
+ *
1593
1634
  * @param directory return value of `window.showDirectoryPicker()` which gives the browser
1594
1635
  * permission to access a directory (only works in Chrome/Edge)
1636
+ * @param version OME-Zarr version
1595
1637
  * @param path path to image, beginning with "/". This argument allows the application to only
1596
1638
  * ask the user once for permission to the root directory
1597
1639
  */
1598
- constructor(directory: FileSystemDirectoryHandle, version?: Version, path?: `/${string}`);
1599
- open(): Promise<OmeZarrImageLoader>;
1640
+ static fromFileSystem(props: FileSystemOmeZarrImageSourceProps): OmeZarrImageSource;
1600
1641
  }
1601
1642
 
1602
1643
  declare class Plane {