diff --git a/src/hdf5_hl.d.ts b/src/hdf5_hl.d.ts index d1aa40b..2bc247f 100644 --- a/src/hdf5_hl.d.ts +++ b/src/hdf5_hl.d.ts @@ -162,6 +162,7 @@ export declare const h5wasm: { Group: typeof Group; Dataset: typeof Dataset; Datatype: typeof Datatype; + DatasetRegion: typeof DatasetRegion; ready: Promise; ACCESS_MODES: { readonly r: "H5F_ACC_RDONLY"; diff --git a/src/hdf5_hl.ts b/src/hdf5_hl.ts index e95481e..853245f 100644 --- a/src/hdf5_hl.ts +++ b/src/hdf5_hl.ts @@ -1104,6 +1104,7 @@ export const h5wasm = { Group, Dataset, Datatype, + DatasetRegion, ready, ACCESS_MODES } diff --git a/test/create_read_references.mjs b/test/create_read_references.mjs index bdc370a..3c8d850 100644 --- a/test/create_read_references.mjs +++ b/test/create_read_references.mjs @@ -73,6 +73,11 @@ async function test_refs() { assert.strictEqual(obj_1.path, `/${DATASET_GROUP}/${DATASET_NAME}`); const region_refs = refs_group.get(REGION_REF_DATASET_NAME).value; + const [region_0, region_1] = region_refs.map((ref) => read_file.dereference(ref)); + assert(region_0 instanceof h5wasm.DatasetRegion); + assert.deepEqual(region_0.value, new Float32Array(REGION_REF_DATA_0.flat())); + assert(region_1 instanceof h5wasm.DatasetRegion); + assert.deepEqual(region_1.value, new Float32Array(REGION_REF_DATA_1.flat())); // assert.deepEqual(hard_link_dataset.value, DATA); read_file.close()