• Overview
  • Guides
    • Looping
    • Easing and Interpolating
    • Layers
    • Groups
    • Using TypeScript

Using Typescript

React Ensemble has first-class support for TypeScript, a type-safe extension of JavaScript.

This means that if you import React Ensemble components into TypeScript files, they will already have all the type definitions. If you use an IDE with a TypeScript server like Visual Studio Code, you may get type suggestions even if you're writing JavaScript.

Type Imports

Most of the type definitions used in React Ensemble are publicly exported and are considered part of the public API.

You can import types just like other modules from React Ensemble:

Animation State Type

Throughout React Ensemble's type definitions, you may find references to <State>. For example, the Controller definition:

<State> refers to your animation's custom state, which is the schema of state properties generated on every frame. You can define an interface for your animation's state to make your use of React Ensemble types even more explicit.

Previous:
Groups
Next:
API Reference
Copyright © 2020 Joseph Cowman. All rights reserved.
React Ensemble is licensed under the MIT License.