Skip to content

Commit eb4c7ad

Browse files
committed
Add touch to Readonly mixin
1 parent f27690b commit eb4c7ad

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/mixins/readonly.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ export interface ReadonlyMixin {
1919
mkdirSync(path: string, mode: number): never;
2020
link(srcpath: string, dstpath: string): Promise<never>;
2121
linkSync(srcpath: string, dstpath: string): never;
22-
sync(path: string, data: Uint8Array, stats: Readonly<InodeLike>): Promise<never>;
23-
syncSync(path: string, data: Uint8Array, stats: Readonly<InodeLike>): never;
22+
touch(path: string, metadata: Readonly<InodeLike>): Promise<never>;
23+
touchSync(path: string, metadata: Readonly<InodeLike>): never;
24+
sync(path: string): Promise<never>;
25+
syncSync(path: string): never;
2426
write(path: string, buffer: Uint8Array, offset: number): Promise<never>;
25-
writeSync(path: string, buffer: Uint8Array, offset: number): Promise<never>;
27+
writeSync(path: string, buffer: Uint8Array, offset: number): never;
2628
}
2729

2830
/**
@@ -85,6 +87,14 @@ export function Readonly<T extends abstract new (...args: any[]) => FileSystem>(
8587
throw new ErrnoError(Errno.EROFS);
8688
}
8789

90+
public async touch(): Promise<never> {
91+
throw new ErrnoError(Errno.EROFS);
92+
}
93+
94+
public touchSync(): never {
95+
throw new ErrnoError(Errno.EROFS);
96+
}
97+
8898
public async sync(): Promise<never> {
8999
throw new ErrnoError(Errno.EROFS);
90100
}

0 commit comments

Comments
 (0)