MCPcopy Index your code
hub / github.com/observablehq/framework / Loader

Interface Loader

src/loader.ts:341–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339}
340
341export interface Loader {
342 /**
343 * The source root relative to the current working directory, such as src.
344 */
345 readonly root: string;
346
347 /**
348 * The path to the loader script or executable relative to the source root.
349 * This is exposed so that clients can check which file to watch to see if the
350 * loader is edited (and in which case it needs to be re-run).
351 */
352 readonly path: string;
353
354 /** TODO */
355 readonly params: Params | undefined;
356
357 /**
358 * Runs this loader, returning the path to the generated output file relative
359 * to the source root; this is typically within the .observablehq/cache folder
360 * within the source root.
361 */
362 load(options?: LoadOptions, effects?: LoadEffects): Promise<string>;
363}
364
365/** Used by LoaderResolver.find to represent a static file resolution. */
366class StaticLoader implements Loader {

Callers 7

loader-test.tsFile · 0.65
loadPageMethod · 0.65
findArchiveMethod · 0.65
PreviewServerClass · 0.65
buildFunction · 0.65
xlsxMethod · 0.65
loadMethod · 0.65

Implementers 2

StaticLoadersrc/loader.ts
Workbooksrc/client/stdlib/xlsx.js

Calls

no outgoing calls

Tested by

no test coverage detected