Socket
Socket
Sign inDemoInstall

@anywidget/types

Package Overview
Dependencies
66
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @anywidget/types

utility types for anywidget


Version published
Maintainers
1
Install size
26.3 MB
Created

Readme

Source

@anywidget/types

Type declarations for anywidget

Installation

npm install @anywidget/types

Usage

/**
 * @typedef Model
 * @prop {number} value - the current count
 */

/** @type {import("@anywidget/types").AnyWidget<Model>} */
export default {
	initialize({ model }) {
		let value = model.get("value");
		//^? number
	},
	render({ model, el }) {
		let value = model.get("value");
		//^? number

		model.get("nope");
		// type error, `nope` is not defined on Model

		model.set("value", "not a number");
		//^? type error, must be a number
	},
};

License

MIT

FAQs

Last updated on 19 Apr 2024

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