npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@purescript/dom

v4.3.1

Published

PureScript type definitions and effect for interacting with the DOM

Downloads

2

Readme

purescript-dom

Latest release Build status Maintainer: garyb

Type definitions, low level interface implementations, and standard effect type for use while interacting with the DOM.

Installation

bower install purescript-dom

Introduction

purescript-dom is intended to provide a common base for projects that need to talk to or about the DOM.

The API isn't primarily intended for "human consumption", but instead aims to provide functions and types that match up with the interfaces described in the DOM4, HTML5, and CSSOM specifications, with a minimal amount of additional opinion as to how they should be implemented in PureScript.

This consists of:

  • foreign data types for the various interfaces described.
  • Functions that read Foreign typed values (and IsForeign instances) for foreign types.
  • No classes or other niceties to aid with subtyping relationships. However, coercions are provided from subtypes to their supertypes. For example, from DOM.Node.Types, elementToNode.
  • Functions that can mutate the DOM, or that don't always return the same value, or return a value that may be mutated at a distance use Eff with the DOM effect
  • Enumeration values are provided as ADTs, but with an option to read the raw value too. For example, from DOM.Node.Node, nodeType and nodeTypeIndex.

Module structure

Interfaces from DOM4 are grouped under DOM.Node and interfaces from HTML5 are grouped under DOM.HTML, aside from event-related things which are grouped under DOM.Events. Additionally there are a few other useful DOM interfaces such as the File and XMLHttpRequest2 that have their own submodules.

In each submodule there is a .Types which should enumerate foreign data types for the interfaces within and the coercions and Foreign-reading functions that go with them. After that each interface should have its own submodule - so for example, Element is provided in DOM.Node.Types and the functions from the Element API are defined in DOM.Node.Element. Enumeration types such as NodeType also get their own modules, such as DOM.Node.NodeType.

Module documentation is published on Pursuit: http://pursuit.purescript.org/packages/purescript-dom

Non-standards compliant interfaces

Currently we're choosing not to implement deprecated or non-standard interfaces even if they are commonly available. The innerHTML property of Element and keyCode/charCode of KeyboardEvent being examples of this. Ideally this module will only provide types and functions that "everyone" can agree on. This also means new parts of the specifications that are currently not widely available may also be omitted for the time being, however this only applies to the API implementation, types for new interfaces will be included as needed.