Skip to content

Commit 3daf7e0

Browse files
committed
Correct types: src/shared/file-record-types.js
The TypeScript compiler requires that these methods conform to the API signature even though they are considered "virtual" in a classical object-oriented programming sense. Because the TypeScript compiler considers returning nothing a violation ("A function whose declared type is neither 'undefined', 'void', nor 'any' must return a value.") but is satisfied by throwing an error, throw an error to indicate the virtual status of these methods.
1 parent da685c9 commit 3daf7e0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/shared/file-record-types.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @ts-nocheck
21
/**
32
* @namespace FileRecord
43
*/
@@ -17,15 +16,19 @@ FileRecord.Host = {
1716
* @param {string} [options.glob] a glob pattern to filter what is read
1817
* @returns {Promise<FileRecord.Record>} a graph of directories and files read
1918
*/
20-
async read(root, options) {},
19+
async read(root, options) {
20+
throw new Error('Not implemented.');
21+
},
2122

2223
/**
2324
* Collapse a record graph into a flat list of only bufferData records.
2425
* @memberof FileRecord.Host#
2526
* @param {FileRecord.Record} record
2627
* @returns {FileRecord.NamedRecord[]}
2728
*/
28-
collapse(record) {},
29+
collapse(record) {
30+
throw new Error('Not implemented.');
31+
},
2932
};
3033

3134
/**

0 commit comments

Comments
 (0)