Skip to content

Commit

Permalink
Added type parameterized fs to File
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed Nov 12, 2024
1 parent 3b2fe9e commit 7ce5be1
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export function isExclusive(flag: string): boolean {
return flag.indexOf('x') !== -1;
}

export abstract class File {
export abstract class File<FS extends FileSystem = FileSystem> {
public constructor(
/**
* @internal
Expand Down Expand Up @@ -269,7 +269,7 @@ export abstract class File {
* An implementation of `File` that operates completely in-memory.
* `PreloadFile`s are backed by a `Uint8Array`.
*/
export class PreloadFile<FS extends FileSystem> extends File {
export class PreloadFile<FS extends FileSystem> extends File<FS> {
/**
* Current position
*/
Expand All @@ -290,11 +290,7 @@ export class PreloadFile<FS extends FileSystem> extends File {
* Note that, if contents is specified, it will be mutated by the file.
*/
public constructor(
/**
* The file system that created the file.
* @internal
*/
public fs: FS,
fs: FS,
path: string,
public readonly flag: string,
public readonly stats: Stats,
Expand Down

0 comments on commit 7ce5be1

Please sign in to comment.