| 339 | } |
| 340 | |
| 341 | export 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. */ |
| 366 | class StaticLoader implements Loader { |
no outgoing calls
no test coverage detected