From 7a34f6b46072b8898cda01165bdb2e88209d25e8 Mon Sep 17 00:00:00 2001 From: Trevor Manz Date: Mon, 15 Jul 2024 15:19:38 -0400 Subject: [PATCH] fix: Typescript types --- src/utils.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 97ba8de..5236c6a 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -77,12 +77,16 @@ export async function getAttrsOnly(location: zarr.Location, multiscales: Ome.Multiscale[]) { +export async function loadMultiscales( + grp: zarr.Group, + multiscales: Ome.Multiscale[] +): Promise>> { const { datasets } = multiscales[0] || [{ path: '0' }]; return Promise.all( - // @ts-expect-error - attrs: false is not in the types but it is ok and avoids making unecessary requests for v2 - // @see {@link https://github.com/manzt/zarrita.js/blob/7edffbeefb0eb877df48f54c7e8def4219c69c59/packages/zarrita/CHANGELOG.md?plain=1#L214} - datasets.map(({ path }) => zarr.open(grp.resolve(path), { kind: 'array', attrs: false })) + // TODO(Trevor): TS is not happy about { attrs: false }. + // This is just missing from zarrita types, but it is ok and + // avoids making unecessary requests for v2 (see: https://github.com/manzt/zarrita.js/blob/7edffbeefb0eb877df48f54c7e8def4219c69c59/packages/zarrita/CHANGELOG.md?plain=1#L214) + datasets.map(({ path }) => zarr.open(grp.resolve(path), { kind: 'array', attrs: false } as { kind: 'array' })) ); }