less annoying JSDoc types

This commit is contained in:
David Reed 2022-11-23 14:28:11 -05:00
parent b366f3af8f
commit 38a715b3a2
No known key found for this signature in database
GPG key ID: 2211691D8A1EE72F
4 changed files with 9 additions and 16 deletions

View file

@ -3,7 +3,7 @@ import CSS from './css.js';
import JS from './js.js'; import JS from './js.js';
import setCookie from 'set-cookie-parser'; import setCookie from 'set-cookie-parser';
import { xor, base64, plain } from './codecs.js'; import { xor, base64, plain } from './codecs.js';
import mimeTypes from './mime.js'; import mimeTypes from 'mime-types';
import { import {
validateCookie, validateCookie,
db, db,

5
src/uv.d.ts vendored Normal file
View file

@ -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;

View file

@ -1,18 +1,10 @@
/** /**
* @typedef {import("./rewrite/index.js").default} Ultraviolet * @type {import('./uv').UltravioletCtor}
*/
/**
* @typedef {import("./client/index.js").default} UVClient
*/
/**
* @type {typeof Ultraviolet}
*/ */
const Ultraviolet = globalThis.Ultraviolet; const Ultraviolet = globalThis.Ultraviolet;
/** /**
* @type {typeof UVClient} * @type {import('./uv').UVClientCtor}
*/ */
const UVClient = globalThis.UVClient; const UVClient = globalThis.UVClient;

View file

@ -3,11 +3,7 @@
// This is to allow us to produce a generic bundle with no hard-coded paths. // This is to allow us to produce a generic bundle with no hard-coded paths.
/** /**
* @typedef {import("./rewrite/index.js").default} Ultraviolet * @type {import('./uv').UltravioletCtor}
*/
/**
* @type {typeof Ultraviolet}
*/ */
const Ultraviolet = globalThis.Ultraviolet; const Ultraviolet = globalThis.Ultraviolet;