Code Monkey home page Code Monkey logo

blockly-d.ts's Introduction

blockly-d.ts

Typescript definition file generator for Google's Blockly.

This project generates the Typescript definition file (d.ts file) for Google's Blockly required to get type safety via the Typescript compiler. Currenlty, this only generates the type defintions for Blockly's core folder. This is intended to generate the files that can eventually be added to Definitely Typed (i.e., @types).

Use Typescript Definition Files

Since you currenlty can't consume the definition file via npm, the last generated d.ts file is checked in for reference. You should generate your own if you're using a different version of Blockly.

  • If you need to generate a new version of the definition file, see instructions.
  • Generated definition file location: dist/blockly-core.d.ts
    • The commit will tell you which version of Blockly it was generated from.
    • View repo history to see d.ts files for older versions of Blockly.
  • Let tsc know about the new typing file.
  • Add matching version of Blockly to your project.
    • This project only provides the definition file; you still need to include the Blockly library.
  • Blockly uses the closure-library and some of the reference types found there (e.g., goog.math). For tsc to be happy, you'll have to define these referenced closure-library types. I currently don't do this for you.

Generate Definition File

  • git clone https://github.com/trodi/blockly-d.ts.git
  • npm install
  • npm start
  • Generated files found in dist/
    • blockly-core.d.ts - The definition file generated against the latest version of Blockly.
    • blockly - This folder contains a copy of Blockly's dist files used to generate this d.ts file for reference.

License

MIT License

blockly-d.ts's People

Contributors

emilhem avatar pastak avatar trodi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.