Skip to content

Provides a shim to namespace the various global Foundry VTT types accessed in TRL.

License

Notifications You must be signed in to change notification settings

typhonjs-fvtt-lib/types-fvtt-shim

Repository files navigation

types-fvtt-shim

DO NOT USE / INSTALL

This is a utility package that is included in TRL via @typhonjs-fvtt/runtime/types/fvtt-shim.

Internally to support end-to-end Typescript declarations and remain neutral to the various options for Foundry VTT types available TRL uses a shim layer rather than choosing a single particular set of Foundry VTT types to associate with. There are many advantages to this approach as various Foundry VTT platform type declaration efforts wax and wane. This shim layer provides a minimal set of re-exported global types that are common between all known Foundry VTT type efforts. This makes it easy to search the TRL codebase for where Foundry VTT platform declarations are used. The TRL API docs treat these symbols as external links to the official Foundry VTT API docs providing end-to-end API docs as well.

The following sets of Foundry types are known to work:

Please see the starter template repo, template-svelte-ts, for a complete example.

If you are using TypeScript with TRL for Foundry 3rd party development all you have to do is add in tsconfig.json:

{
  "compilerOptions": {
    "types": [
      "foundry-pf2e/foundry",                   // Your chosen Foundry platform types.
      "@typhonjs-fvtt/runtime/types/fvtt-shim"  // The TRL FVTT API shim.
    ]
  }
}

About

Provides a shim to namespace the various global Foundry VTT types accessed in TRL.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published