master
Importable Types Web
This is a slimmed down and repackaged version of @types/web, allowing you to selectively import web types for type checking, for example when building a cross-runtime library, implementing web APIs in node, etc.
This serves as a replacement for @types/web for any typescript code that needs to run in a non-web environment using web types, you should not use @types/web and this package together.
Usage
Configure your typescript compiler like so:
// tsconfig.json
{
"compilerOptions":{
"lib":["ESNext"], // exclude default web types
"types":[] // exclude @types/web
}
}
Then import the types and define the globals you will be using:
// main.ts
import type { Console } from "@sugoidogo/importable-types-web"
declare var console:Console
console.log("Hello World!")
Description
Languages
TypeScript
100%