Skip to content

Commit

Permalink
feat: 🎸 add typed array view support to volume
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Jun 20, 2023
1 parent 3017ecd commit a8bee73
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/volume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface IError extends Error {
}

export type TFileId = PathLike | number; // Number is used as a file descriptor.
export type TData = TDataOut | Uint8Array; // Data formats users can give us.
export type TData = TDataOut | ArrayBufferView | DataView; // Data formats users can give us.
export type TFlags = string | number;
export type TMode = string | number; // Mode can be a String, although docs say it should be a Number.
export type TTime = number | string | Date;
Expand Down Expand Up @@ -1199,9 +1199,9 @@ export class Volume {
return file.write(buf, offset, length, position);
}

writeSync(fd: number, buffer: Buffer | Uint8Array, offset?: number, length?: number, position?: number): number;
writeSync(fd: number, buffer: Buffer | ArrayBufferView | DataView, offset?: number, length?: number, position?: number): number;
writeSync(fd: number, str: string, position?: number, encoding?: BufferEncoding): number;
writeSync(fd: number, a: string | Buffer | Uint8Array, b?: number, c?: number | BufferEncoding, d?: number): number {
writeSync(fd: number, a: string | Buffer | ArrayBufferView | DataView, b?: number, c?: number | BufferEncoding, d?: number): number {
validateFd(fd);

let encoding: BufferEncoding | undefined;
Expand Down Expand Up @@ -1233,12 +1233,12 @@ export class Volume {
return this.writeBase(fd, buf, offset, length, position);
}

write(fd: number, buffer: Buffer | Uint8Array, callback: (...args) => void);
write(fd: number, buffer: Buffer | Uint8Array, offset: number, callback: (...args) => void);
write(fd: number, buffer: Buffer | Uint8Array, offset: number, length: number, callback: (...args) => void);
write(fd: number, buffer: Buffer | ArrayBufferView | DataView, callback: (...args) => void);
write(fd: number, buffer: Buffer | ArrayBufferView | DataView, offset: number, callback: (...args) => void);
write(fd: number, buffer: Buffer | ArrayBufferView | DataView, offset: number, length: number, callback: (...args) => void);
write(
fd: number,
buffer: Buffer | Uint8Array,
buffer: Buffer | ArrayBufferView | DataView,
offset: number,
length: number,
position: number,
Expand Down

0 comments on commit a8bee73

Please sign in to comment.