Interface PlanRules

The caller's rules. Extensions are written in lower case with their dot, as .md.

interface PlanRules {
    documentTypes: Readonly<Record<string, string>>;
    transcriptExtensions: readonly string[];
    recordingExtensions: readonly string[];
    archiveExtensions?: readonly string[];
    maxBytes: ((kind) => number);
    openArchive?: ((path) => Promise<PlanEntryInput[]>);
    maxEntries?: number;
}

Properties

documentTypes: Readonly<Record<string, string>>

A document's extension to its media type.

transcriptExtensions: readonly string[]

The extensions read as transcripts.

recordingExtensions: readonly string[]

The extensions read as recordings.

archiveExtensions?: readonly string[]

The extensions of an archive the plan opens.

Default

['.zip']
maxBytes: ((kind) => number)

The most bytes an entry of each kind may hold, and, for archive, the most a nested archive may hold for the plan to open it: 0, any positive number or Infinity. An entry whose size is no byte count (a finite number of 0 or more) is skipped with the reason size; a bound below 0, NaN or no number at all (null, a numeric text such as '5', true, an object) rejects the plan with a RangeError.

Type declaration

    • (kind): number
    • Parameters

      Returns number

openArchive?: ((path) => Promise<PlanEntryInput[]>)

Lists a nested archive's entries, once its size is within maxBytes('archive'); without it, a nested archive is skipped. What it throws rejects the plan.

Type declaration

maxEntries?: number

The most entries planned, skipped ones included: those past it are skipped with the reason count. A count below 0, NaN or no number at all (null, a numeric text such as '5', true, an object) rejects the plan with a RangeError.

Default

Infinity