0.1.9 • Published 22 days ago

@anywidget/types v0.1.9

Weekly downloads
-
License
-
Repository
-
Last release
22 days ago

@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

0.1.9

22 days ago

0.1.8

1 month ago

0.1.7

1 month ago

0.1.6

2 months ago

0.1.5

3 months ago

0.1.4

10 months ago

0.1.3

11 months ago

0.1.0

11 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.0.0

1 year ago