import { type graph } from "https://deno.land/x/cav@0.0.24/deps.ts";
const { CreateGraphOptions } = graph;
Properties
The type of graph to build. "all"
includes all dependencies of the
roots. "typesOnly"
skips any code only dependencies that do not impact
the types of the graph, and "codeOnly"
only includes dependencies that
are runnable code.
When identifying a @jsxImportSource
pragma, what module name will be
appended to the import source. This defaults to jsx-runtime
.
An optional string to be used when generating an error when the integrity check of the module graph fails.
Methods
A callback that is called with the URL string of the resource to be loaded
and a flag indicating if the module was required dynamically. The callback
should resolve with a LoadResponse
or undefined
if the module is not
found. If there are other errors encountered, a rejected promise should be
returned.
An optional callback that will be called with a URL string of the resource to provide additional meta data about the resource to enrich the module graph.
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.
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).
An optional callback that returns true
if the sub-resource integrity of
the provided specifier and content is valid, otherwise false
. This allows
for items like lock files to be applied to the module graph.