1
- import type { PGlite } from '../pglite.js'
2
- import type { PostgresMod } from '../postgresMod.js'
3
- import { BaseFilesystem , FsStats , ERRNO_CODES } from './base .js'
4
- import type { TarIndex , TarIndexFile } from './tarUtils .js'
5
- import { makeSyncFetch , type SyncFetch } from '../sync-fetch/index .js'
1
+ import type { PGlite } from '../../ pglite.js'
2
+ import type { PostgresMod } from '../../ postgresMod.js'
3
+ import { SyncFetch } from '../../sync-fetch/index .js'
4
+ import { BaseFilesystem , FsStats , ERRNO_CODES } from '../base .js'
5
+ import type { TarIndex , TarIndexFile } from '../tarUtils .js'
6
6
7
7
type Node = TarIndexFile & {
8
8
isDir : boolean
@@ -34,14 +34,14 @@ export interface HttpFsOptions {
34
34
* Requires an index.json file at the root of the filesystem with a list of
35
35
* files available to fetch
36
36
*/
37
- export class HttpFs extends BaseFilesystem {
37
+ export abstract class HttpFsBase extends BaseFilesystem {
38
38
index ?: TarIndex
39
39
tree ?: Node
40
40
httpPaths = new Set < string > ( )
41
41
#handleMap: Map < number , Node > = new Map ( )
42
42
#handleCounter = 0
43
43
fetchGranularity : FetchGranularity
44
- fetch ? : SyncFetch
44
+ abstract fetch : SyncFetch
45
45
46
46
constructor (
47
47
baseUrl : string ,
@@ -53,7 +53,6 @@ export class HttpFs extends BaseFilesystem {
53
53
54
54
async init ( pg : PGlite , opts : Partial < PostgresMod > ) {
55
55
await this . #init( )
56
- this . fetch = await makeSyncFetch ( )
57
56
return super . init ( pg , opts )
58
57
}
59
58
0 commit comments