Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/cav/deps.ts>graph.ParseModuleOptions

A server framework for Deno
Go to Latest
interface graph.ParseModuleOptions
import { type graph } from "https://deno.land/x/cav@0.2.3/deps.ts";
const { ParseModuleOptions } = graph;

Properties

optional
headers: Record<string, string>

For remote resources, a record of headers should be set, where the key's have been normalized to be lower case values.

optional
jsxImportSourceModule: string

When identifying a @jsxImportSource pragma, what module name will be appended to the import source. This defaults to jsx-runtime.

optional
kind: ModuleKind

The kind of module to set on the resulting parsed module.

Methods

optional
resolve(specifier: string, referrer: string): string | ResolveResult

An optional callback that allows the default resolution logic of the module graph to be "overridden". This is intended to allow items like an import map to be used with the module graph. The callback takes the string of the module specifier from the referrer and the string URL of the referrer. The callback then returns a fully qualified resolved URL string specifier or an object which contains the URL string and the module kind. If just the string is returned, the module kind is inferred to be ESM.

optional
resolveTypes(specifier: string): string | undefined

An optional callback that can allow custom logic of how type dependencies of a module to be provided. This will be called if a module is being added to the graph that is is non-typed source code (e.g. JavaScript/JSX) and allow resolution of a type only dependency for the module (e.g. @types or a .d.ts file).