sugoidogo
  • Joined on 2025-12-15

@sugoidogo/importable-types-web (1.0.0)

Published 2026-02-09 14:56:07 +00:00 by sugoidogo in sugoidogo/importable-types-web

Installation

@sugoidogo:registry=https://gitea.sugoidogo.com/api/packages/sugoidogo/npm/
npm install @sugoidogo/importable-types-web@1.0.0
"@sugoidogo/importable-types-web": "1.0.0"

About this package

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!")

Dependencies

Dependencies

ID Version
undici-types ^7.16.0

Development Dependencies

ID Version
@types/node ^25.2.2
@types/web ^0.0.329
Details
npm
2026-02-09 14:56:07 +00:00
61
SugoiDogo
Apache-2.0
latest
316 KiB
Assets (1)
Versions (1) View all
1.0.0 2026-02-09