Skip to content

TypeScript support #2706

@devpaul

Description

@devpaul

I've written ambient declarations for a-frame in order to provide type support for TypeScript. I created a ticket a few months ago (DefinitelyTyped/DefinitelyTyped#11696) to track interest and recently I've been asked to merge these typings in to a standard place for consumption.

It would be great to include TypeScript support w/ A-Frame. This doesn't require any code to be rewritten, just include a .d.ts file like this as part of the release and add some tests to exercise the typings against A-Frame.

Benefits include:

  1. IDE support via intellisense and better code completion for A-Frame and it's dependencies (e.g. Three.js) (this is great for new users)
  2. Eliminates common errors stemming from typos and misuse
  3. Including in A-Frame would keep typings current w/ releases
  4. Zero runtime const (ambient declarations are not part of executed code)
  5. Better support for Angular and TypeScript users

By including typings w/ A-Frame, TypeScript users will immediately have types available and it would have no effect on non-TypeScript users.

I'm happy to answer any questions. If there's enough interest I'll submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions