Skip to content

@vttforge/core / FoundryNamespace

Interface: FoundryNamespace ​

The foundry global.

Same rule as the rest of this file: every member is one a real consumer reached for, not one that exists in Foundry. Reaching past it is a cast, and a cast is a sentence you write on purpose.

Declare it in your own project and the members below are typed:

ts
import type { FoundryNamespace } from '@vttforge/types';

declare global {
  // `var`, not `const`: two blocks naming one global only merge as `var`.
  var foundry: FoundryNamespace;
}

Properties ​

abstract ​

readonly abstract: FoundryClassNamespace<"DataModel" | "Document" | "TypeDataModel">


applications ​

readonly applications: FoundryApplications


canvas ​

readonly canvas: FoundryClassNamespace


data ​

readonly data: object

fields ​

readonly fields: FoundryClassNamespace<FoundryFieldNames>

Field classes for a schema: StringField, NumberField and the rest.

operators ​

readonly operators: FoundryClassNamespace<"ForcedDeletion" | "ForcedReplacement">

For an update that deletes or replaces rather than merging.


dice ​

readonly dice: Readonly<Record<"DiceTerm" | "Die" | "RollTerm", AnyClass>> & Readonly<Record<string, AnyClass | undefined>> & object

Type Declaration ​

Roll ​

readonly Roll: RollConstructor


documents ​

readonly documents: object

collections ​

readonly collections: FoundryClassNamespace<FoundryCollectionNames>


utils ​

readonly utils: FoundryUtils

foundry.utils, whole.

MIT licensed.