Interface DeviceDriver<TData>
interface DeviceDriver<TData = any> { isBuffered?: boolean; name: string; singleton?: boolean; close(file: DeviceFile<TData>): void; init(ino: number, options: object): DeviceInit<TData>; read( file: DeviceFile<TData>, buffer: ArrayBufferView<ArrayBufferLike>, offset?: number, length?: number, position?: number, ): number; readD( device: Device<TData>, buffer: Uint8Array<ArrayBufferLike>, offset: number, end: number, ): void; sync(file: DeviceFile<TData>): void; write( file: DeviceFile<TData>, buffer: Uint8Array<ArrayBufferLike>, offset: number, length: number, position?: number, ): number; writeD( device: Device<TData>, buffer: Uint8Array<ArrayBufferLike>, offset: number, ): void;} Properties
Optional
isBuffered
isBuffered?: boolean
Optional
singleton
singleton?: boolean
Methods
Optional
init
- init(ino: number, options: object): DeviceInit<TData>
Parameters
- ino: number
- options: object
Device.data
File operations
Optional
read
- read(
file: DeviceFile<TData>,
buffer: ArrayBufferView<ArrayBufferLike>,
offset?: number,
length?: number,
position?: number,
): number Parameters
- file: DeviceFile<TData>
- buffer: ArrayBufferView<ArrayBufferLike>
Optional
offset: numberOptional
length: numberOptional
position: number
Returns number
readD
- readD(
device: Device<TData>,
buffer: Uint8Array<ArrayBufferLike>,
offset: number,
end: number,
): void Parameters
- device: Device<TData>
- buffer: Uint8Array<ArrayBufferLike>
- offset: number
- end: number
Returns void
Optional
write
- write(
file: DeviceFile<TData>,
buffer: Uint8Array<ArrayBufferLike>,
offset: number,
length: number,
position?: number,
): number Parameters
- file: DeviceFile<TData>
- buffer: Uint8Array<ArrayBufferLike>
- offset: number
- length: number
Optional
position: number
Returns number
writeD
- writeD(
device: Device<TData>,
buffer: Uint8Array<ArrayBufferLike>,
offset: number,
): void Parameters
- device: Device<TData>
- buffer: Uint8Array<ArrayBufferLike>
- offset: number
Returns void
A device driver