a post-component library for building user-interfaces on the web.

Use proper typeof import types instead of any

tombl.dev 5eb4d594 c5e52406

verified
+14 -12
+8 -8
scripts/test/runtime.ts
··· 44 44 } else { 45 45 // Multiple builds - comparison mode 46 46 const libraries: Array<{ 47 - index: { html: any } 48 - client: { invalidate: any; createRoot: any } 49 - server: any 47 + index: typeof import('dhtml') 48 + client: typeof import('dhtml/client') 49 + server: typeof import('dhtml/server') 50 50 ref: string 51 51 }> = [] 52 52 53 53 // Dynamically import all library versions 54 54 for (const build of builds) { 55 55 try { 56 - const index = await import(`../../${build.path}/index.min.js`) 57 - const client = await import(`../../${build.path}/client.min.js`) 58 - const server = await import(`../../${build.path}/server.min.js`) 56 + const index = (await import(`../../${build.path}/index.min.js`)) as typeof import('dhtml') 57 + const client = (await import(`../../${build.path}/client.min.js`)) as typeof import('dhtml/client') 58 + const server = (await import(`../../${build.path}/server.min.js`)) as typeof import('dhtml/server') 59 59 libraries.push({ 60 - index: { html: index.html }, 61 - client: { invalidate: client.invalidate, createRoot: client.createRoot }, 60 + index, 61 + client, 62 62 server, 63 63 ref: build.ref, 64 64 })
+6 -4
src/client/tests/bench-comparison.ts
··· 1 1 export function get_benchmarks({ 2 - index: { html }, 3 - client: { invalidate, createRoot }, 2 + index, 3 + client, 4 4 }: { 5 - index: { html: any } 6 - client: { invalidate: any; createRoot: any } 5 + index: typeof import('dhtml') 6 + client: typeof import('dhtml/client') 7 7 }): Record<string, () => void> { 8 + const { html } = index 9 + const { invalidate, createRoot } = client 8 10 // Setup function using the passed library version 9 11 function setup(initial_html = '') { 10 12 const el = document.createElement('div')