
TypeScript Types Declarations for WebMCP
This package defines Typescript types (.d.ts) for the WebMCP specification.
以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。
This package defines Typescript types (.d.ts) for the WebMCP specification.
Use this package to augment the ambient "dom" type definitions with the new definitions for WebMCP.
Install
npm: npm install --save-dev webmcp-types
yarn: yarn add --dev webmcp-types
pnpm: pnpm add -D webmcp-types
This package requires TypeScript 5.0 or newer.
Since this package is outside DefinitelyTyped, the dependency won't be picked up automatically. There are several ways to add a additional TypeScript type definition dependencies to your TypeScript project:
{ // ... "compilerOptions": { // ... "types": ["webmcp-types"] } }
Or you can use typeRoots:
{ // ... "compilerOptions": { // ... "typeRoots": ["./node_modules/webmcp-types", "./node_modules/@types"] } }
Inline in TypeScript
This may work better if your toolchain doesn't read tsconfig.json.
/// <reference types="webmcp-types" />
Webpack
If you use Webpack and the options above aren't sufficient (this has not been verified), you may need the following in webpack.config.js:
"types": ["webmcp-types"]
Run the type tests
npm install
npm test
The tests in index.test-d.ts are statically checked with Vitest typecheck mode against tsconfig.json; they are never executed.
Release Please keeps a release pull request open with the next version and changelog, based on Conventional Commits on main. Merging it creates the GitHub release and publishes to npm through trusted publishing; no npm token or local publish step is needed.
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。