Coder Social home page Coder Social logo

lgirault / foundry-vtt-types Goto Github PK

View Code? Open in Web Editor NEW

This project forked from league-of-foundry-developers/foundry-vtt-types

0.0 0.0 0.0 6.79 MB

Unofficial type declarations for the Foundry Virtual Tabletop API

License: MIT License

Shell 0.03% JavaScript 0.31% TypeScript 99.66%

foundry-vtt-types's Introduction

foundry-vtt-types

League Logo TS

TypeScript type definitions for Foundry Virtual Tabletop (unofficial)

League Discord Server GitHub V9 issues by-label GitHub closed V9 issues by-label GitHub V10 issues by-label GitHub closed V10 issues by-label npm (tag)

Supported Foundry VTT versions

We aim to support the latest release of each Foundry VTT version (0.7, 0.8, 9, etc.), starting with 0.7.

At the moment, versions 0.7, 0.8, and 9 are fully supported. Work on support for version 10 is just starting out. See the open foundry V10 issues to keep track of the progress.

Installation

You can install foundry-vtt-types from the npm registry.

In order to install the latest version, run

npm install --save-dev @league-of-foundry-developers/foundry-vtt-types

In order to install a specific version run

npm install --save-dev @league-of-foundry-developers/foundry-vtt-types@<version>

For example, to install version 9.268.0, run

npm install --save-dev @league-of-foundry-developers/[email protected]

You can then update foundry-vtt-types using the regular update mechanism for npm (see npm update).

Versioning scheme

The versions of the foundry-vtt-types correspond to the releases of Foundry VTT. The versioning scheme of Foundry VTT changed with version 9, so the versioning scheme for the foundry-vtt-types also changes with that version:

  • For Foundry VTT version 0.7 and 0.8, the versioning scheme is
    0.<foundy-minor-version>.<foundry-patch-version>-<increment>
    
  • For Foundry VTT version 9 and onwards, the versioning scheme is
    <foundry-version>.<foundry-build>.<increment>
    

In both cases, increment is a number that increases with every individual release of the foundry-vtt-types for that Foundry VTT release.

Usage

Add foundry-vtt-types to your types section in your tsconfig.json:

{
  "compilerOptions": {
    "types": ["@league-of-foundry-developers/foundry-vtt-types"],
    "moduleResolution": "node",
    "strictNullChecks": true,
  }
}

This will make the type definitions available globally in your project.

Make sure you are using "moduleResolution": "node", too. It is required for some dependencies to be resolved correctly.

Also make sure to set "strictNullChecks": true because otherwise, some conditional types used in the type definitions resolve incorrectly, and you will see a lot of errors. Alternatively, you can just set "strict": true, which implicitly sets strictNullChecks. This is actually what we recommend, but it's not required.

You can find some information about how to actually work with the type definitions in the Wiki. A good starting point is the FAQ.

Acknowledgments

Originally forked from Foundry Project Creator Types by @NickEastNL

Contributing

Contributions are very welcome in order to decrease the individual workload. Filing issues for wrong / missing types is also a great way to help us improve the type definitions.

Development on the current version of Foundry VTT is done on the main branch. Additionally, we keep branches for the older version of Foundry VTT that we still support. These branches are named according to the Foundry VTT version they correspond to. For example, the branch for Foundry VTT 0.8 is called foundry-0.8.x. All work to improve the type definitions needs to be done through Pull Requests to the relevant branch.

Please read CONTRIBUTING.md for more details on how to contribute.

If you have any specific questions, feel free to contact us in the League of Extraordinary Foundry Developers Discord.

Type-Checking, Linting, Testing

When contributing, make sure that the type checks pass, the linter is green and the tests are green. We do have checks in the CI but running this locally also helps you while developing and saves you time as you don't have to wait for the CI.

You can run type checking and linting with the following command:

npm run lint

You can run the tests with

npm run test

Creating a release

To create a release, you have to create a new release commit, tag it and create a GitHub release from that. The CI will handle the rest.

npm version <release-type>
git push --follow-tags

License

This project is licensed under the MIT license. You can find a copy at LICENSE.

foundry-vtt-types's People

Contributors

akrigline avatar amdg avatar bekriebel avatar boltsj avatar carlosfdez avatar codergal89 avatar davidarchibald avatar dependabot[bot] avatar florad avatar ghost91- avatar kmoschcau avatar kristjanlaane avatar lexicality avatar lukeabby avatar mitchellslavik avatar moo-man avatar n3dst4 avatar neuroboy23 avatar nickeastnl avatar philip-iv avatar richardrobertson avatar smashman avatar spice-king avatar sunspots avatar takitaf avatar trev-dev avatar typhonrt avatar ufomelkor avatar vigoren avatar wildj79 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.