This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
12 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
// These are the type declarations for the virtual modules | ||
// used by the `/courses/{id}` and `/instructors/{id}` routes. | ||
// The reason we have to use inline imports here is because with `import` statements, TypeScript | ||
// treats this as a normal module rather than an ambient module, and so the module declarations | ||
// don't actually work when consumed by other TypeScript source files. | ||
/** | ||
* Ambient declaration file for defining "virtual" modules/files. | ||
* The file contents are generated dynamically during build time by esbuild. | ||
* DO NOT add any imports/exports; that converts the file to a regular module | ||
* and removes the global declarations. | ||
*/ | ||
|
||
/** | ||
* Virtual module for caching course information during build time. | ||
*/ | ||
declare module "virtual:courses" { | ||
declare const courses: Record<string, import("@peterportal-api/types").Course>; | ||
} | ||
|
||
/** | ||
* Virtual module for caching instructor information during build time. | ||
*/ | ||
declare module "virtual:instructors" { | ||
declare const instructors: Record<string, import("@peterportal-api/types").Instructor>; | ||
} |