Skip to content

brunnerh/exatypes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EXATYPES

JavaScript type information for the EXAPUNKS custom level code which aids in writing code by supplying documentation, auto-completion and type safety.

Example of code lens in Visual Studio Code

Installation

The types can be installed from the npm repository:

npm install exatypes

Alternatively you can just manually copy the type declaration file exapunks.d.ts to a location where your development tools can find it.

Usage Suggestions

The type declaration file works well with Visual Studio Code and strict TypeScript settings are recommended to catch the accidental use of undefined symbols and various other issues.

To turn on the type checking of your JavaScript level code, add the comment // @ts-check at the top of the file.

Example tsconfig.json to turn on strict mode:

{
    "compilerOptions": {
        "strict": true,
        "lib": ["es5"],
    },
}

Note that you will probably still get completion for many other types that will not be defined in the context of EXAPUNKS. This includes e.g. any DOM classes and constants. Also, Math.random has been explicitly removed to prevent the tests from being non-deterministic.

About

JavaScript type information for the EXAPUNKS custom level code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published