From a1d8ba483b24c836f40f134b0b351b7e267e1d4c Mon Sep 17 00:00:00 2001 From: ayoayco Date: Sat, 3 Aug 2024 09:11:38 +0200 Subject: [PATCH] feat: fix imported typedef for JSdocs --- index.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 20a9b74..3dd847a 100644 --- a/index.js +++ b/index.js @@ -1,26 +1,27 @@ -import { AstroIntegration } from 'astro'; import { readFile, writeFile } from 'node:fs/promises'; import { fileURLToPath } from 'node:url'; import path from 'node:path'; import { randomUUID } from "node:crypto"; -/** - * @type {Array} - */ -let assets = []; - /** * @typedef {{ * assetCachePrefix?: string, * assetCacheVersionID?: string, * path: string, * }} ServiceWorkerConfig + * @typedef {import('astro').AstroIntegration} AstroIntegration */ +/** + * @type {Array} + */ +let assets = []; + const plugin_dir = path.resolve(path.dirname('.')); /** - * + * Accepts configuration options with service worker path + * and injects needed variables such as `assets` generated by Astro * @param {ServiceWorkerConfig} config * @returns {AstroIntegration} */