Skip to content

DocumentSignals

Defined in: packages/core/src/parser/document-text.ts:51

What the caller knows about where the text came from. Each is optional; the first that names a format wins, in this order: scriptType, the extension of url (or fileName), the extension of responseUrl, then contentType. Text with no signal is sniffed.

PropertyTypeDescriptionDefined in
contentType?string | nullA response Content-Type. Only YAML, JSON (including +json, such as application/geo+json) and TOML media types count. text/plain and application/octet-stream are no signal.packages/core/src/parser/document-text.ts:65
fileName?stringA file name or path, as the CLI and Astro read it.packages/core/src/parser/document-text.ts:57
responseUrl?stringThe response’s final URL after redirects.packages/core/src/parser/document-text.ts:59
scriptType?string | nullAn inline <script type>.packages/core/src/parser/document-text.ts:53
url?stringThe requested URL. Only its pathname counts, so map.toml?v=3 is TOML.packages/core/src/parser/document-text.ts:55