From 52fbd2c99e4f074b227a5672ae561cf1117cc5d0 Mon Sep 17 00:00:00 2001 From: Himanshu Patil Date: Fri, 2 Aug 2024 03:41:20 +0530 Subject: [PATCH] docs: Improve `prepare:types` hook JSDoc (#886) --- packages/wxt/src/types.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/wxt/src/types.ts b/packages/wxt/src/types.ts index 92370e84..747a6898 100644 --- a/packages/wxt/src/types.ts +++ b/packages/wxt/src/types.ts @@ -1046,9 +1046,14 @@ export interface WxtHooks { * // variable called "example" in the TS project. * entries.push({ * path: "types/example.d.ts", - * textContent: "declare const a: string;", + * text: "declare const a: string;", * tsReference: true, * }); + * // use module to add Triple-Slash Directive in .wxt/wxt.d.ts + * // eg: /// + * entries.push({ + * module: '@types/example' + * }); * }) */ 'prepare:types': (wxt: Wxt, entries: WxtDirEntry[]) => HookResult; @@ -1409,6 +1414,10 @@ export type WxtDirEntry = WxtDirTypeReferenceEntry | WxtDirFileEntry; * Represents type reference to a node module to be added to `.wxt/wxt.d.ts` file */ export interface WxtDirTypeReferenceEntry { + /** + * Specifies the module name that will be used in the `/// ` directive. + * This value will be added to the `.wxt/wxt.d.ts` file to include type definitions from the specified module. + */ module: string; }