Documentation
¶
Overview ¶
Package as defines the As type and its predefined values.
Resource type hint for preload links. Required with rel="preload" to specify content type for proper prioritization, parsing, and CSP application by the browser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Audio Audio resource for media playback. Browser prioritizes and applies audio-specific // optimizations and content security policies for music, sound effects, or podcasts. Audio = As("audio") // Document HTML document resource for navigation or embedding. Browser applies document parsing // and security policies for iframe content or navigation targets. Document = As("document") // Embed Resource for embedding via object or embed elements. Browser applies appropriate // security policies and loading strategies for plugin or embedded content. Embed = As("embed") // Fetch Resource for JavaScript fetch() or XHR requests. Generic type for API responses, // JSON data, or other programmatically loaded content. Fetch = As("fetch") // Font Font resource for text rendering. Browser applies font loading optimizations // and CORS policies for web fonts and typography resources. Font = As("font") // Image Image resource for visual content. Browser applies image-specific optimizations, // decoding strategies, and security policies for graphics and photos. Image = As("image") // JSON JSON data resource for structured content. Browser applies JSON-specific parsing // and content security policies for data loaded via fetch or module imports. JSON = As("json") // Object Resource for object elements including plugins, embedded media, or interactive content. // Browser applies object-specific loading and security policies. Object = As("object") // Script JavaScript resource for code execution. Browser applies script loading optimizations, // CSP policies, and execution strategies for performance and security. Script = As("script") // Style CSS stylesheet resource for visual presentation. Browser prioritizes style loading // to prevent layout shifts and applies CSS-specific parsing optimizations. Style = As("style") // Track Text track resource for media captions, subtitles, or descriptions. Browser applies // track-specific loading for accessibility and media synchronization. Track = As("track") // Video Video resource for media playback. Browser applies video-specific optimizations, // buffering strategies, and security policies for motion picture content. Video = As("video") // Worker Web Worker script for background processing. Browser applies worker-specific loading // and execution policies for multithreaded JavaScript applications. Worker = As("worker") )
Variables for As values
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.