feat: fix imported typedef for JSdocs

This commit is contained in:
Ayo Ayco 2024-08-03 09:11:38 +02:00
parent f801e424a0
commit a1d8ba483b

View file

@ -1,26 +1,27 @@
import { AstroIntegration } from 'astro';
import { readFile, writeFile } from 'node:fs/promises'; import { readFile, writeFile } from 'node:fs/promises';
import { fileURLToPath } from 'node:url'; import { fileURLToPath } from 'node:url';
import path from 'node:path'; import path from 'node:path';
import { randomUUID } from "node:crypto"; import { randomUUID } from "node:crypto";
/**
* @type {Array<string>}
*/
let assets = [];
/** /**
* @typedef {{ * @typedef {{
* assetCachePrefix?: string, * assetCachePrefix?: string,
* assetCacheVersionID?: string, * assetCacheVersionID?: string,
* path: string, * path: string,
* }} ServiceWorkerConfig * }} ServiceWorkerConfig
* @typedef {import('astro').AstroIntegration} AstroIntegration
*/ */
/**
* @type {Array<string>}
*/
let assets = [];
const plugin_dir = path.resolve(path.dirname('.')); 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 * @param {ServiceWorkerConfig} config
* @returns {AstroIntegration} * @returns {AstroIntegration}
*/ */