streamich / memfs

JavaScript file system utilities
http://streamich.github.io/memfs/
Apache License 2.0
1.77k stars 130 forks source link

Shared type that is compatible with node:fs/promises AND memfs? #1072

Open jasonkuhrt opened 1 month ago

jasonkuhrt commented 1 month ago

Hey, I'm looking for a single TypeScript type that is compatible between node:fs/promises and memfs. For example this does not work:

import * as Fs from 'node:fs/promises'
import * as Memfs from 'memfs'

export type Fs = typeof Fs
const x = (fs:Fs) => void

x(Memfs.fs.promises) //<-- type error