Socket
Socket
Sign inDemoInstall

@types/webidl-conversions

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/webidl-conversions

TypeScript definitions for webidl-conversions


Version published
Weekly downloads
2.9M
increased by3.23%
Maintainers
1
Install size
6.61 kB
Created
Weekly downloads
 

Package description

What is @types/webidl-conversions?

The @types/webidl-conversions package provides TypeScript type definitions for the webidl-conversions library, which is a utility for converting JavaScript values to WebIDL types as specified in the WebIDL specification. This is particularly useful when working with Web APIs in a type-safe manner, ensuring that values passed to and from Web APIs conform to the expected types.

What are @types/webidl-conversions's main functionalities?

Converting basic types

This feature demonstrates how to convert basic JavaScript types to WebIDL types, such as DOMString and boolean. The context option provides additional information for error messages.

import * as WebIDL from 'webidl-conversions';
let myString = WebIDL.DOMString('123', { context: 'Argument 1' });
let myBoolean = WebIDL.boolean('true', { context: 'Argument 2' });

Converting complex types

This feature shows the conversion of more complex JavaScript types to WebIDL types, like object and byte. It illustrates the flexibility of the library in handling various types.

import * as WebIDL from 'webidl-conversions';
let myObject = WebIDL.object({ a: 1, b: 2 }, { context: 'Argument 1' });
let myByte = WebIDL.byte('123', { context: 'Argument 2' });

Other packages similar to @types/webidl-conversions

Readme

Source

Installation

npm install --save @types/webidl-conversions

Summary

This package contains type definitions for webidl-conversions (https://github.com/jsdom/webidl-conversions#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webidl-conversions.

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by ExE Boss, and BendingBender.

FAQs

Last updated on 07 Nov 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc