From b8e59a5683fb23f45d74884840041118cffa53c2 Mon Sep 17 00:00:00 2001 From: Eddy Chen <89349085+ecxyzzy@users.noreply.github.com> Date: Thu, 21 Dec 2023 04:52:31 -0800 Subject: [PATCH] =?UTF-8?q?docs:=20=F0=9F=93=9A=EF=B8=8F=20use=20jsdoc=20f?= =?UTF-8?q?or=20global.d.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/api/src/global.d.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/api/src/global.d.ts b/apps/api/src/global.d.ts index b254f1a4..b262aa62 100644 --- a/apps/api/src/global.d.ts +++ b/apps/api/src/global.d.ts @@ -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; } - +/** + * Virtual module for caching instructor information during build time. + */ declare module "virtual:instructors" { declare const instructors: Record; }