FormatParser
interface exported by @mwillbanks/tuil-streaming.
interface
Public interface exported by @mwillbanks/tuil-streaming.
export interface FormatParser {
readonly id: string;
readonly mediaTypes: readonly string[];
readonly extensions?: readonly string[];
detect(source: string): number;
parse(source: string, complete: boolean): PartialDocument;
createSession?(): FormatParserSession;
}Members
| Member | Type | Required | Description | Related types |
|---|---|---|---|---|
id | string | Yes | The id member uses the string contract. | — |
mediaTypes | readonly string[] | Yes | The mediaTypes member uses the readonly string[] contract. | — |
extensions | readonly string[] | undefined | No | The extensions member uses the readonly string[] | undefined contract. | — |
detect | (source: string) => number | Yes | The detect member uses the (source: string) => number contract. | — |
parse | (source: string, complete: boolean) => PartialDocument | Yes | The parse member uses the (source: string, complete: boolean) => PartialDocument contract. | PartialDocument |
createSession | (() => FormatParserSession) | undefined | No | The createSession member uses the (() => FormatParserSession) | undefined contract. | FormatParserSession |
Parameters
This declaration has no public members.
Returns
This declaration does not return a value.
Throws
No thrown errors are documented for this declaration.
Related types
Source
View the secondary source reference