diff --git a/src/rewrite/index.js b/src/rewrite/index.js index 2b272c4..200045f 100644 --- a/src/rewrite/index.js +++ b/src/rewrite/index.js @@ -3,7 +3,7 @@ import CSS from './css.js'; import JS from './js.js'; import setCookie from 'set-cookie-parser'; import { xor, base64, plain } from './codecs.js'; -import mimeTypes from './mime.js'; +import mimeTypes from 'mime-types'; import { validateCookie, db, diff --git a/src/uv.d.ts b/src/uv.d.ts new file mode 100644 index 0000000..c08744d --- /dev/null +++ b/src/uv.d.ts @@ -0,0 +1,5 @@ +const Ultraviolet: typeof import('./rewrite/index').default; +const UVClient: typeof import('./client/index').default; + +export type UltravioletCtor = typeof Ultraviolet; +export type UVClientCtor = typeof UVClient; diff --git a/src/uv.handler.js b/src/uv.handler.js index 4ba612c..ffe277e 100644 --- a/src/uv.handler.js +++ b/src/uv.handler.js @@ -1,18 +1,10 @@ /** - * @typedef {import("./rewrite/index.js").default} Ultraviolet - */ - -/** - * @typedef {import("./client/index.js").default} UVClient - */ - -/** - * @type {typeof Ultraviolet} + * @type {import('./uv').UltravioletCtor} */ const Ultraviolet = globalThis.Ultraviolet; /** - * @type {typeof UVClient} + * @type {import('./uv').UVClientCtor} */ const UVClient = globalThis.UVClient; diff --git a/src/uv.sw.js b/src/uv.sw.js index 47049d5..cb8a6ef 100644 --- a/src/uv.sw.js +++ b/src/uv.sw.js @@ -3,11 +3,7 @@ // This is to allow us to produce a generic bundle with no hard-coded paths. /** - * @typedef {import("./rewrite/index.js").default} Ultraviolet - */ - -/** - * @type {typeof Ultraviolet} + * @type {import('./uv').UltravioletCtor} */ const Ultraviolet = globalThis.Ultraviolet;