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

esri-javascript-api-typings

v1.4.0

Published

TypeScript definitions for the ESRI javascript API for projects that don't use a module system in TypeScript.

Downloads

6

Readme

esri-javascript-api-typings

Non-AMD typescript definitions for the ESRI javascript API.

The ESRI JavaScript api type definitions that are provided by ESRI assume that you will be writing your project using AMD syntax. For some people who do not intend to write their whole project in AMD, that leaves us unable to use Esri's type definitions. This project allows you to use typings for most of the ESRI javascript api without needing to go all-in with AMD.

Installation

npm

npm install --save-dev esri-javascript-api-typings

direct

Download the corresponding version you wish to use from the dist folder of this repository, place it anywhere within your typescript project.

Usage

If you are requiring the esri modules, there is a esriTypes.[ClassName]Constructor object that you must use for these modules (i.e. esriTypes.MapConstructor) . If you are giving a variable a type, use the esriTypes.[ClassName] format (i.e. var map: esriTypes.Map = getMapFromSomewhere();).

Here is a quick example

///<reference path="node_modules/esri-javascript-api-typings/3.14/index.d.ts" />
require(["esri/map"], function(Map: esriTypes.MapConstructor){
  //indicate that the map variable is of the type esri.Map
  var map = new Map();
});

Warning

When you include these type definitions, it will appear that there are esri global objects available. Those global objects don't really exist at runtime, so you shouldn't be using them as objects. Use the normal AMD require syntax to actually interact with the api. Only use these typings to add more static type information to your already-created objects.

///<reference path="node_modules/esri-javascript-api-typings/3.14/index.d.ts" />
//DON'T do this. the global esriTypes.Map object doesn't exist, even though this will not fail compilation.
var map = new esriTypes.Map();