Usage

Decode a UTF-8 file returned as bytes.

This type is used by fileSystem.readBytes

tsx
// Decode a UTF-8 file returned as bytes.
import { fileSystem } from 'kuito';

const bytes = await fileSystem.readBytes(fileSystem.documents + 'notes.txt');
const text = new TextDecoder().decode(bytes);
console.log(text);

Type declaration

ts
export type ByteRange = {
  /** The first byte to read. Defaults to 0. */
  position?: number;
  /** How many bytes to read. Defaults to the rest of the file. */
  length?: number;
};

Members 2

NameTypeRequiredDescription
positionnumberNoThe first byte to read. Defaults to 0.
lengthnumberNoHow many bytes to read. Defaults to the rest of the file.
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.