[]previous and next page

@shadow-js/dusk

The 81 exports of @shadow-js/dusk: 21 functions, 2 classes, 35 interfaces, 21 types, 1 const and 1 component.

Everything @shadow-js/dusk exports, from the TSDoc of its entry point.

Functions#

  • fallbackFontFace: A @font-face for a locally installed font that stands in for the web font while it loads, scaled so its average character width matches the web font (size-adjust), and with its ascent, descent and line gap overridden in the same scale, so the line boxes do not change height when the web font arrives.
  • fontFace: A @font-face rule for a web font.
  • fontPreloadTag: The head link that preloads a font file: the browser starts the download before the stylesheet is read.
  • h: Creates an element.
  • imageProps: The attributes of an <img> for an image.
  • isHttpError: True for an HttpError, also across two copies of this package.
  • islandAttributes: The attributes of an island's element: its id, strategy, media query and props.
  • isNotFound: True for a not-found signal.
  • isRedirect: True for a redirect signal.
  • jsonLdText: Writes a JSON-LD value as safe script text: <, >, & and the line separators become escapes.
  • jsx: The JSX runtime entry for one child (jsx(type, props)).
  • jsxs: The JSX runtime entry for several children (jsxs(type, props)).
  • metadataFeature: The metadata feature of a router.
  • notFound: Control flow: throw the result to report not-found.
  • preloadImageTag: A head <link rel="preload"> for a priority image, with the same candidates, so the browser starts the download before the markup is parsed.
  • redirect: Creates the signal to throw for a redirect.
  • redirectStatus: The HTTP status of a redirect signal: the one given to redirect, or 302 for a signal made by the router's own redirect().
  • scriptsHtml: The markup of a list of scripts for the document head: the beforeInteractive ones first, then the afterInteractive ones, each source once, in the order given.
  • scriptTag: The markup of one script: <script src nonce> (with async for afterInteractive), or nothing for lazyOnload, which the browser loads itself.
  • useResponse: The response calls of the current request.
  • viewportContent: Renders the viewport meta content from its fields, in the order browsers document.

Classes#

  • HttpError: An error that carries an HTTP status.
  • RedirectSignal: Thrown (not returned) from beforeLoad or a loader to send the navigation elsewhere.

Interfaces#

Types#

  • ColorScheme: The color-scheme values.
  • FontDisplay: font-display values.
  • FontFormat: The formats a @font-face source may name.
  • Icons: Icons: one URL, a list of descriptors, or the grouped form (icon, shortcut, apple, other).
  • ImageFormat: The output formats the optimizer knows.
  • ImageLoader: Builds the URL of one candidate.
  • IslandStrategy: When an island is hydrated: load (as soon as the page is interactive), visible (it scrolls into view), idle (the browser is idle), interaction (the first pointer, key or focus on it), or media (a media query matches).
  • JsonLdValue: Anything JSON.stringify writes as an object (structured data).
  • MaxImagePreview: max-image-preview values.
  • MetadataTitle: The title.
  • MetadataUrl: A URL as a string or a URL.
  • MetaDescriptor: One entry of the meta export (React Router style): a title, a <meta> by name, property or httpEquiv or charSet, or a tagName: "link" with link attributes.
  • OgComponent: A function component: it receives the props and returns a node.
  • OgNode: What a child may be.
  • OgStyle: The inline style of an element, in camelCase.
  • OpenGraph: The Open Graph block.
  • OpenGraphImageInput: An image in a social card: a URL, a descriptor, or a bare string.
  • RedirectStatus: Statuses a redirect can use.
  • ReferrerPolicy: Where a referrer policy applies.
  • ScriptStrategy: When a script runs: beforeInteractive blocks parsing (for code the page needs first), afterInteractive loads asynchronously as soon as possible, lazyOnload loads after the window's load event, from the browser.
  • TwitterMetadata: The Twitter card.

Constants#

  • IMAGE_WIDTHS: Every width the optimizer offers by default, ascending.

components#

  • Fragment: Fragment: its children, without a wrapping element.