Skip to content

Add "Typings" file to NPM package for Typescript consumers #5717

@thw0rted

Description

@thw0rted

I've been working on a Cesium-based project for a few months now, and picked Visual Studio Code as my primary editor. I was a little irritated that other libraries I rely on (like Moment and jQuery) have good feedback from Intellisense, while Cesium doesn't give me anything (out of the box, at least). I learned that this is because the more popular libraries have a "Typings" file (.d.ts) either available from an external source, or bundled into the Node module directly.

I found this repo and placed the index.d.ts in my node_modules/cesium/ and like magic, VSCode knew the types of all the Cesium classes and functions -- except that listing was last updated 4 months ago with version 1.26, so it was missing stuff that's changed in the last half-dozen or so releases. I've added some things to it myself, though I wouldn't say it's definitely complete. I can post my modified version if anybody would like that.

I recognize that this would be an ongoing requirement, either to maintain manually or to generate as part of your build workflow, but I think it would really help out both those that try to use Cesium from actual Typescript, and those that work with vanilla-JS Cesium from VSCode.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions