New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

webxdc-types

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webxdc-types

TypeScript type definitions for webxdc

  • 0.1.0
  • npm
  • Socket score

Version published
Weekly downloads
9
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Types for webxdc

When you develop a webxdc app, you use the webxdc API to communicate with other instances of the same webxdc application.

The API is available on window.webxdc.

When you develop your webxdc app in TypeScript, it's handy to have proper types for this API. This library provides those types for you.

Usage

You can install this using:

npm install -D webxdc-types

You should have a type that describes your webxdc payload structure in use by your application:

type Payload = {
  label: string;
  value: number;
};

Once you have a Payload type, you can declare the type of window.webxdc in your application:

import { WebXdc } from "webxdc-types";

declare global {
  interface Window {
    webxdc: WebXdc<Payload>;
  }
}

Now window.webxdc should be fully typed.

Keywords

FAQs

Package last updated on 18 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc