Skip to content

Commit

Permalink
Add signature overrides to `HasAttrs#dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
axelboc committed Sep 4, 2024
1 parent be0920e commit a97e5f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/hdf5_hl.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ declare abstract class HasAttrs {
create_attribute(name: string, data: GuessableDataTypes, shape?: number[] | null, dtype?: string | null): void;
delete_attribute(name: string): number;
create_reference(): Reference;
dereference(ref: RegionReference): DatasetRegion;
dereference(ref: Reference | RegionReference): DatasetRegion | Entity | null;
}
export declare class Datatype extends HasAttrs {
Expand Down
2 changes: 2 additions & 0 deletions src/hdf5_hl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,8 @@ abstract class HasAttrs {
return new Reference(ref_data);
}

dereference(ref: RegionReference): DatasetRegion;
dereference(ref: Reference | RegionReference): DatasetRegion | Entity | null;
dereference(ref: Reference | RegionReference): DatasetRegion | Entity | null {
const is_region = (ref instanceof RegionReference);
const name = Module.get_referenced_name(this.file_id, ref.ref_data, !is_region);
Expand Down

0 comments on commit a97e5f3

Please sign in to comment.