### Dialog Example Source: https://foundryvtt.com/api/v14/classes/foundry.appv1.api.Dialog.html Example of how to construct and render a custom dialog instance with multiple button options. ```javascript let d = new Dialog({ title: "Test Dialog", content: "

You must choose either Option 1, or Option 2

", buttons: { one: { icon: '', label: "Option One", callback: () => console.log("Chose One") }, two: { icon: '', label: "Option Two", callback: () => console.log("Chose Two") } }, default: "two", render: html => console.log("Register interactivity in the rendered dialog"), close: html => console.log("This always is logged no matter which option is chosen") }); d.render(true); ``` -------------------------------- ### setupGame Source: https://foundryvtt.com/api/v14/classes/foundry.Game.html Fully sets up the game state, including documents, UI, and canvas, and triggers setup and ready hooks. ```APIDOC ## setupGame ### Description Fully set up the game state, initializing Documents, UI applications, and the Canvas. Triggers the hookEvents.setup and hookEvents.ready events. ### Method setupGame(): Promise ### Returns Promise ``` -------------------------------- ### Filter Journal Entries Source: https://foundryvtt.com/api/v14/classes/foundry.documents.collections.Journal.html Filter the Collection to return an Array of entries that match a functional condition. This example filters for entries starting with 'A'. ```javascript let c = new Collection([["a", "AA"], ["b", "AB"], ["c", "CC"]]); let hasA = c.filters(entry => entry.slice(0) === "A"); ``` -------------------------------- ### ready() Source: https://foundryvtt.com/api/v14/functions/hookEvents.ready.html Fires once when the game is fully ready. This hook runs after the 'setup' hook. ```APIDOC ## ready() ### Description A hook event that fires once when the game is fully ready. Runs after `setup`. ### Method `ready()` ### Returns void ``` -------------------------------- ### Retrieve an existing Actor by its id Source: https://foundryvtt.com/api/v14/classes/foundry.documents.collections.Actors.html This example demonstrates how to get a specific Actor document from the game.actors collection using its unique ID. ```APIDOC ## Retrieve an existing Actor by its id ### Description This example demonstrates how to get a specific Actor document from the game.actors collection using its unique ID. ### Method GET ### Endpoint `game.actors.get(actorId)` ### Parameters #### Path Parameters - **actorId** (string) - Required - The unique identifier of the Actor to retrieve. ### Response #### Success Response (200) - **Actor** (foundry.documents.Actor) - The retrieved Actor document. #### Response Example ```json { "example": "actorDocument" } ``` ``` -------------------------------- ### SetupTour Methods Source: https://foundryvtt.com/api/v14/classes/foundry.nue.tours.SetupTour.html Provides methods for controlling and interacting with the SetupTour. ```APIDOC ## Methods ### complete * complete(): Promise Advance the tour to a completed state. ### Returns Promise ### exit * exit(): void Exit the tour at the current step. ### Returns void ### next * next(): Promise Progress the Tour to the next step. ### Returns Promise ### previous * previous(): Promise Rewind the Tour to the previous step. ### Returns Promise ### progress * progress(stepIndex: number): Promise Progresses to a given Step ### Parameters * stepIndex: number The step to progress to ### Returns Promise ### reset * reset(): Promise Reset the Tour to an un-started state. ### Returns Promise ### start * start(): Promise Start the Tour at its current step, or at the beginning if the tour has not yet been started. ### Returns Promise ``` -------------------------------- ### Create and Evaluate a PoolTerm Source: https://foundryvtt.com/api/v14/classes/foundry.dice.terms.PoolTerm.html Instantiate a PoolTerm with multiple dice expressions and modifiers, then evaluate it to get the results. This example demonstrates keeping the highest die from each of the three specified rolls. ```javascript let pool = new PoolTerm({ terms: ["4d6", "3d8 - 1", "2d10 + 3"], modifiers: ["kh"] }); pool.evaluate(); ``` -------------------------------- ### SetupTour Constructor Source: https://foundryvtt.com/api/v14/classes/foundry.nue.tours.SetupTour.html Constructs a new SetupTour instance. It requires a TourConfig object and accepts optional configuration options. ```APIDOC ## constructor * new SetupTour( config: TourConfig, options?: { id?: string; namespace?: string }, ): SetupTour Construct a Tour by providing a configuration. ### Parameters * config: TourConfig The configuration of the Tour * `Optional`options: { id?: string; namespace?: string } = {} Additional options for configuring the tour * ##### `Optional`id?: string A tour ID that supercedes TourConfig#id * ##### `Optional`namespace?: string A tour namespace that supercedes TourConfig#namespace ### Returns SetupTour ``` -------------------------------- ### Define Schema and Localization Prefixes for DataModel Source: https://foundryvtt.com/api/v14/classes/foundry.abstract.TypeDataModel.html Example of defining a schema for a custom DataModel and setting localization prefixes. This setup allows Foundry to automatically localize field labels and hints based on a provided JSON structure. ```javascript class MyDataModel extends foundry.abstract.DataModel { static defineSchema() { return { foo: new foundry.data.fields.StringField(), bar: new foundry.data.fields.NumberField() }; } static LOCALIZATION_PREFIXES = ["MYMODULE.MYDATAMODEL"]; } Hooks.on("i18nInit", () => { // Foundry will attempt to automatically localize models registered for a document subtype, so this step is only // needed for other data model usage, e.g. for a Setting. Localization.localizeDataModel(MyDataModel); }); ``` -------------------------------- ### get Source: https://foundryvtt.com/api/v14/classes/foundry.abstract.SingletonEmbeddedCollection.html Get a document from the EmbeddedCollection by its ID. ```APIDOC ## get ### Description Get a document from the EmbeddedCollection by its ID. ### Parameters #### id - string - The ID of the Embedded Document to retrieve. #### options - { invalid?: boolean; strict?: boolean } - Optional. Additional options to configure retrieval. - invalid?: boolean - Allow retrieving an invalid Embedded Document. - strict?: boolean - Throw an Error if the requested Embedded Document does not exist. ### Returns any - The retrieved document instance, or undefined ### Throws If strict is true and the Embedded Document cannot be found. ``` -------------------------------- ### initialize Source: https://foundryvtt.com/api/v14/classes/foundry.canvas.sources.BaseLightSource.html Initialize the light source with data. ```APIDOC ## initialize ### Description Initialize the light source with data. ### Method `_initialize(data: any): void` ### Parameters #### Path Parameters - **data** (any) - Description not available ``` -------------------------------- ### initialize Source: https://foundryvtt.com/api/v14/classes/foundry.documents.collections.Playlists.html Perform one-time initialization to begin playback of audio. ```APIDOC ## initialize ### Description Perform one-time initialization to begin playback of audio. ### Method `initialize(): Promise` ### Returns - **Promise** ``` -------------------------------- ### get Source: https://foundryvtt.com/api/v14/classes/foundry.abstract.EmbeddedCollection.html Get a document from the EmbeddedCollection by its ID. ```APIDOC ## get ### Description Get a document from the EmbeddedCollection by its ID. ### Method get ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the Embedded Document to retrieve. #### Query Parameters - **options** (object) - Optional - Additional options to configure retrieval. - **invalid** (boolean) - Optional - Allow retrieving an invalid Embedded Document. - **strict** (boolean) - Optional - Throw an Error if the requested Embedded Document does not exist. ### Returns TDocument - The retrieved document instance, or undefined ### Throws If strict is true and the Embedded Document cannot be found. ``` -------------------------------- ### _onConfigure Source: https://foundryvtt.com/api/v14/classes/foundry.applications.apps.av.CameraViews.html Handles spawning the AV configuration dialog. ```APIDOC ## _onConfigure ### Description Handle spawning the AV configuration dialog. ### Method Internal ### Signature _onConfigure(event: PointerEvent, target: HTMLElement): Promise ### Parameters #### Path Parameters - **event** (PointerEvent) - The triggering event. - **target** (HTMLElement) - The action target. ### Returns Promise ``` -------------------------------- ### get Source: https://foundryvtt.com/api/v14/classes/foundry.documents.collections.Playlists.html Get a Playlist document from the collection by its ID. ```APIDOC ## get ### Description Get a Playlist document from the collection by its ID. ### Method get ### Parameters #### Path Parameters * id (string) - Required - The ID of the Document to retrieve. * options (object) - Optional - Additional options to configure retrieval. * invalid (boolean) - Optional - Allow retrieving an invalid Document. * strict (boolean) - Optional - Throw an Error if the requested Document does not exist. ### Returns documents.Playlist ### Throws If strict is true and the Document cannot be found. ``` -------------------------------- ### initialize Source: https://foundryvtt.com/api/v14/classes/foundry.nue.NewUserExperienceManager.html Initializes the new user experience, generating introductory chat messages for new worlds. ```APIDOC ## initialize ### Description Initialize the new user experience. Currently, this generates some chat messages with hints for getting started if we detect this is a new world. ### Method initialize(): void ### Parameters #### Path Parameters * None #### Query Parameters * None #### Request Body * None ### Returns * **void** ``` -------------------------------- ### Starting and Stopping Particle Effects Source: https://foundryvtt.com/api/v14/classes/foundry.canvas.animation.ParticleGenerator.html Demonstrates how to start and stop a particle generator after it has been configured. ```APIDOC ## ParticleGenerator Methods ### start() #### Description Starts the particle generator, beginning the emission of particles according to its configuration. ### stop() #### Description Stops the particle generator, ceasing the emission of new particles. Existing particles will continue their animation until they expire or are otherwise removed. ``` -------------------------------- ### get Source: https://foundryvtt.com/api/v14/classes/foundry.documents.Combatant.html Retrieves a World-level Combatant Document by its ID. Supports optional database get operations. ```APIDOC ## Static get ### Description Get a World-level Document of this type by its id. ### Method `Static` get ### Parameters * **documentId** (string) - Required - The Document ID * **operation** (DatabaseGetOperation) - Optional - Parameters of the get operation ### Returns Document | null - The retrieved Document, or null ``` -------------------------------- ### initialize Source: https://foundryvtt.com/api/v14/classes/foundry.canvas.sources.GlobalLightSource.html Initializes and configures the light source with provided data and optional settings. This method sets up the source for use in the scene. ```APIDOC ## initialize ### Description Initialize and configure the source using provided data. ### Method `initialize(data?: any, options?: { reset?: boolean }): GlobalLightSource` ### Parameters #### Path Parameters * **data** (any) - Optional - Provided data for configuration * **options** (object) - Optional - Additional options which modify source initialization * **reset** (boolean) - Optional - Should source data be reset to default values before applying changes? ### Returns GlobalLightSource ``` -------------------------------- ### initialize Source: https://foundryvtt.com/api/v14/classes/foundry.av.clients.SimplePeerAVClient.html Initializes the SimplePeerAVClient. ```APIDOC ## initialize * initialize(): Promise #### Returns Promise ``` -------------------------------- ### get Source: https://foundryvtt.com/api/v14/classes/foundry.documents.BaseActor.html Retrieves a World-level Document of this type by its ID. Allows for optional database get operations. ```APIDOC ## get ### Description Get a World-level Document of this type by its id. ### Method Static ### Signature `get(documentId: string, operation?: DatabaseGetOperation): Document | null` ### Parameters #### Path Parameters - **documentId** (string) - Required - The Document ID - **operation** (DatabaseGetOperation) - Optional - Parameters of the get operation ### Returns - **Document | null** - The retrieved Document, or null ``` -------------------------------- ### get Source: https://foundryvtt.com/api/v14/classes/foundry.documents.BaseActorDelta.html Retrieves a World-level Document of this type by its ID. Supports optional database get operations. ```APIDOC ## Static get ### Description Get a World-level Document of this type by its id. ### Method `Static` get ### Parameters #### Path Parameters * **documentId** (string) - Required - The Document ID * **operation** (DatabaseGetOperation) - Optional - Parameters of the get operation ### Returns Document | null - The retrieved Document, or null ``` -------------------------------- ### setup() Source: https://foundryvtt.com/api/v14/functions/hookEvents.setup.html A hook event that fires once when Foundry has finished initializing but before the game state has been set up. Fires after all Documents are initialized, including Settings (you cannot read settings prior to this hook), but before the UI applications or Canvas have been initialized. Runs after `i18nInit` but before `ready`. ```APIDOC ## setup() ### Description A hook event that fires once when Foundry has finished initializing but before the game state has been set up. Fires after all Documents are initialized, including Settings (you cannot read settings prior to this hook), but before the UI applications or Canvas have been initialized. Runs after `i18nInit` but before `ready`. ### Returns void ``` -------------------------------- ### initialize Source: https://foundryvtt.com/api/v14/classes/foundry.canvas.containers.DoorMesh.html Configures and initializes the DoorMesh, optionally updating it after construction. ```APIDOC ## initialize ### Description Configure and initialize the DoorMesh. This is called automatically upon construction, but may be called manually later to update the DoorMesh. ### Method `initialize(animation: DoorAnimationConfiguration): void` ### Parameters * **animation** (DoorAnimationConfiguration) - The animation configuration for the door. ### Returns void ``` -------------------------------- ### initialize Source: https://foundryvtt.com/api/v14/classes/foundry.canvas.sources.RenderedEffectSource.html Initializes and configures the source using provided data and options. Returns the initialized source. ```APIDOC ## initialize ### Description Initialize and configure the source using provided data. ### Method Public ### Parameters #### Path Parameters - **data** (Partial) - Optional. Provided data for configuration. - **options** (object) - Optional. Additional options which modify source initialization. - **reset** (boolean) - Optional. Should source data be reset to default values before applying changes? ### Returns - RenderedEffectSource - The initialized source ``` -------------------------------- ### Die Class Example Source: https://foundryvtt.com/api/v14/classes/foundry.dice.terms.Die.html Example of how to create and evaluate a Die instance to roll four six-sided dice. ```APIDOC ## Example Usage ### Description Roll four six-sided dice. ### Code ```javascript let die = new Die({faces: 6, number: 4}).evaluate(); ``` ``` -------------------------------- ### get Source: https://foundryvtt.com/api/v14/classes/foundry.documents.BaseDrawing.html Retrieves a World-level Document of this type by its ID. It can optionally accept database get operation parameters. Returns null if the document is not found. ```APIDOC ## Static get ### Description Get a World-level Document of this type by its id. ### Method `Static`get ### Parameters * `documentId`: string - The Document ID * `operation`: DatabaseGetOperation = {} - Parameters of the get operation ### Returns Document | null The retrieved Document, or null ``` -------------------------------- ### QuickstartManifestData Interface Source: https://foundryvtt.com/api/v14/interfaces/foundry.packages.types.QuickstartManifestData.html This interface defines the structure for quickstart manifest data, including adventures to import and optional world configuration. ```APIDOC ## Interface QuickstartManifestData ### Description An interface for configuring quickstart package imports, specifying which adventures to import and optional world settings. ### Properties * **adventures** (Record) - Required - A mapping of system IDs to an adventure to import for that system. * **postImport** (boolean) - Optional - Whether the adventure(s) requires post-import operations. Non-GMs will be blocked from joining the World while post-import operations are still pending. * **world** (object) - Optional - Configuration for the auto-created world. * **background** (string) - Optional - The world's background image for the join page. If omitted, the first adventure's image is used. * **cover** (string) - Optional - The cover image for the world on the setup page. If omitted, the first adventure's image is used. * **description** (string) - Optional - The world's description. If omitted, the first adventure's description is used. ``` -------------------------------- ### JSON Localization File Example Source: https://foundryvtt.com/api/v14/classes/foundry.config.ReleaseData.html An example of a JSON localization file structure that corresponds to the 'MyDataModel' class, defining labels and hints for its fields. ```json { "MYMODULE": { "MYDATAMODEL": { "FIELDS" : { "foo": { "label": "Foo", "hint": "Instructions for foo" }, "bar": { "label": "Bar", "hint": "Instructions for bar" } } } } } ``` -------------------------------- ### initialize Source: https://foundryvtt.com/api/v14/classes/foundry.helpers.interaction.ClientKeybindings.html Initializes the keybinding values for all registered actions. ```APIDOC ## initialize ### Description Initializes the keybinding values for all registered actions. ### Method initialize(): void ### Returns void ``` -------------------------------- ### _canDragLeftStart Source: https://foundryvtt.com/api/v14/classes/foundry.canvas.layers.PlaceablesLayer.html Determines if a drag operation starting from the left mouse button can begin on this layer. This is typically used to check for valid starting conditions for dragging placeable objects. ```APIDOC ## _canDragLeftStart ### Description Determines if a left-click drag operation can begin. ### Method (user: any, event: any) ### Parameters #### Path Parameters * **user**: any * **event**: any ### Returns boolean ``` -------------------------------- ### Reference Descriptor Example Source: https://foundryvtt.com/api/v14/modules/foundry.canvas.vfx.html A reference descriptor object used to dynamically resolve properties at runtime. This example shows how to reference the 'center' property of a 'target' with a positional delta. ```json { "reference": "target", "property": "center", "delta": { "x": 0, "y": -50 } } ``` -------------------------------- ### _initializeApplicationOptions Source: https://foundryvtt.com/api/v14/classes/foundry.applications.sidebar.tabs.NoteTab.html Initializes the application options for the NoteTab. This method inherits its documentation. ```APIDOC ## _initializeApplicationOptions ### Description Initializes the application options for the NoteTab. This method inherits its documentation. ### Method _initializeApplicationOptions(options: any): ApplicationConfiguration ### Parameters #### Path Parameters * **options** (any) ### Returns ApplicationConfiguration ``` -------------------------------- ### Get Collection Name for Existing Collection Source: https://foundryvtt.com/api/v14/classes/foundry.abstract.Document.html Use this method to get the name of an embedded collection when the name is already known. This is useful for ensuring consistency in accessing embedded data. ```javascript Actor.implementation.getCollectionName("items"); // returns "items" ``` -------------------------------- ### initialize Source: https://foundryvtt.com/api/v14/classes/foundry.canvas.sources.BaseLightSource.html Initializes and configures the light source using provided data and options. This method can optionally reset source data to default values before applying changes. ```APIDOC ## initialize ### Description Initialize and configure the source using provided data. ### Parameters #### Path Parameters * **data** (any) - Optional - Provided data for configuration * **options** (object) - Optional - Additional options which modify source initialization * **reset** (boolean) - Optional - Should source data be reset to default values before applying changes? ### Returns BaseLightSource - The initialized source ``` -------------------------------- ### Get Entry by Name Source: https://foundryvtt.com/api/v14/classes/foundry.abstract.EmbeddedCollectionDelta.html Get an entry from the Collection by its name attribute. If strict mode is enabled, an error is thrown if the name is not found. Assumes stored objects have a 'name' property. ```javascript let c = new Collection([["a", "Alfred"], ["b", "Bob"], ["c", "Cynthia"]]); c.getName("Alfred"); // "Alfred" c.getName("D"); // undefined c.getName("D", {strict: true}); // throws Error ``` -------------------------------- ### initialize Source: https://foundryvtt.com/api/v14/classes/foundry.canvas.sources.PointLightSource.html Initializes and configures the point light source using provided data and optional settings. Allows for resetting data to default values before applying changes. ```APIDOC ## initialize ### Description Initialize and configure the source using provided data. ### Method `initialize(data?: any, options?: { reset?: boolean }): PointLightSource` ### Parameters #### Path Parameters * **data** (any) - Optional - Provided data for configuration * **options** (object) - Optional - Additional options which modify source initialization * **reset** (boolean) - Optional - Should source data be reset to default values before applying changes? ### Returns PointLightSource ``` -------------------------------- ### Get Embedded Document Source: https://foundryvtt.com/api/v14/classes/foundry.documents.BaseJournalEntryCategory.html Get an embedded document by its id from a named collection in the parent document. Options can modify retrieval behavior, such as allowing invalid documents or enforcing strict existence checks. ```typescript getEmbeddedDocument( embeddedName: string, id: string, options?: { invalid?: boolean; strict?: boolean }, ): Document ``` -------------------------------- ### SetupTour Protected Methods Source: https://foundryvtt.com/api/v14/classes/foundry.nue.tours.SetupTour.html Internal methods for SetupTour, including targeting elements. ```APIDOC ## Methods ### `Protected` _getTargetElement * _getTargetElement(selector: string): Element | null `Protected` Query the DOM for the target element using the provided selector ### Parameters * selector: string A CSS selector ### Returns Element | null The target element, or null if not found ### `Protected` `Abstract` _postStep * _postStep(): Promise `Protected` Clean-up operations performed after a step is completed. ### Returns Promise ``` -------------------------------- ### VisionMode Static LOCALIZATION_PREFIXES Example Source: https://foundryvtt.com/api/v14/classes/foundry.canvas.perception.VisionMode.html Demonstrates how to define localization prefixes for a DataModel to automatically map field labels and hints. This example shows a JavaScript class definition and the corresponding JSON localization structure. ```javascript class MyDataModel extends foundry.abstract.DataModel { static defineSchema() { return { foo: new foundry.data.fields.StringField(), bar: new foundry.data.fields.NumberField() }; } static LOCALIZATION_PREFIXES = ["MYMODULE.MYDATAMODEL"]; } Hooks.on("i18nInit", () => { // Foundry will attempt to automatically localize models registered for a document subtype, so this step is only // needed for other data model usage, e.g. for a Setting. Localization.localizeDataModel(MyDataModel); }); ``` ```json { "MYMODULE": { "MYDATAMODEL": { "FIELDS" : { "foo": { "label": "Foo", "hint": "Instructions for foo" }, "bar": { "label": "Bar", "hint": "Instructions for bar" } } } } } ``` -------------------------------- ### _initializeApplicationOptions Source: https://foundryvtt.com/api/v14/classes/foundry.applications.sidebar.apps.ModuleManagement.html Initializes configuration options for the Application instance, merging subclass options with parent options. ```APIDOC ## _initializeApplicationOptions ### Description Initialize configuration options for the Application instance. The default behavior of this method is to intelligently merge options for each class with those of their parents. * Array-based options are concatenated * Inner objects are merged * Otherwise, properties in the subclass replace those defined by a parent ### Parameters #### Path Parameters * `options` (Partial) - Required - Options provided directly to the constructor ### Returns ApplicationConfiguration Configured options for the application instance ``` -------------------------------- ### Application Constructor Source: https://foundryvtt.com/api/v14/classes/foundry.appv1.api.Application.html Initializes a new instance of the Application class with optional configuration options. ```APIDOC ## constructor * new Application(options?: ApplicationV1Options): Application ### Parameters * `Optional`options: ApplicationV1Options = {} Configuration options which control how the application is rendered. ### Returns Application ``` -------------------------------- ### getUserLevel Source: https://foundryvtt.com/api/v14/classes/foundry.documents.BaseFolder.html Get the explicit permission level that a User has over this Document, a value in CONST.DOCUMENT_OWNERSHIP_LEVELS. Compendium content ignores the ownership field in favor of User role-based ownership. Otherwise, Documents use granular per-User ownership definitions and Embedded Documents defer to their parent ownership. This method returns the value recorded in Document ownership, regardless of the User's role, for example a GAMEMASTER user might still return a result of NONE if they are not explicitly denoted as having a level. To test whether a user has a certain capability over the document, testUserPermission should be used. ```APIDOC ## getUserLevel ### Description Get the explicit permission level that a User has over this Document, a value in CONST.DOCUMENT_OWNERSHIP_LEVELS. Compendium content ignores the ownership field in favor of User role-based ownership. Otherwise, Documents use granular per-User ownership definitions and Embedded Documents defer to their parent ownership. This method returns the value recorded in Document ownership, regardless of the User's role, for example a GAMEMASTER user might still return a result of NONE if they are not explicitly denoted as having a level. To test whether a user has a certain capability over the document, testUserPermission should be used. ### Method `getUserLevel(user?: BaseUser): DocumentOwnershipNumber` ### Parameters #### Path Parameters - **user** (BaseUser) - Optional - The User being tested ### Returns - **DocumentOwnershipNumber** - A numeric permission level from CONST.DOCUMENT_OWNERSHIP_LEVELS ``` -------------------------------- ### _initializeApplicationOptions Source: https://foundryvtt.com/api/v14/classes/foundry.applications.apps.DocumentOwnershipConfig.html Initializes the options for the application. ```APIDOC ## _initializeApplicationOptions ### Description Initializes the options for the application. ### Parameters * **options** (any) ### Returns any ``` -------------------------------- ### validators Source: https://foundryvtt.com/api/v14/classes/foundry.data.fields.TypedObjectField.html Gets the validators for the field. ```APIDOC ## validators * get validators(): Record ### Returns Record ``` -------------------------------- ### initialize Source: https://foundryvtt.com/api/v14/classes/foundry.canvas.placeables.tokens.TokenRingConfig.html Register and initialize the token ring configuration system. ```APIDOC ## initialize ### Description Register the token ring config and initialize it. ### Method initialize ### Returns - **void** ``` -------------------------------- ### origin Source: https://foundryvtt.com/api/v14/classes/foundry.data.LineShapeData.html Get the origin of this shape. ```APIDOC ## origin ### Description The origin of this shape. ### Returns - Readonly: The origin of the shape. ``` -------------------------------- ### _onSoundStart Source: https://foundryvtt.com/api/v14/classes/foundry.documents.Playlist.html Handle callback logic when playback for an individual sound within the Playlist is started. ```APIDOC ## _onSoundStart ### Description Handle callback logic when playback for an individual sound within the Playlist is started. Schedule auto-preload of next track ### Method _onSoundStart ### Parameters #### Path Parameters * sound (PlaylistSound) - The sound that started playback. ### Returns Promise ``` -------------------------------- ### area Source: https://foundryvtt.com/api/v14/classes/foundry.data.LineShapeData.html Get the area of this shape. ```APIDOC ## area ### Description Get the area of this shape. ### Returns - number: The area of the shape. ``` -------------------------------- ### getShape Source: https://foundryvtt.com/api/v14/classes/foundry.canvas.placeables.Token.html Get the shape of this Token. ```APIDOC ## getShape ### Description Get the shape of this Token. ### Method `getShape(): Rectangle | Polygon | Circle | Ellipse` ### Returns - **Rectangle | Polygon | Circle | Ellipse** - The shape of the token ``` -------------------------------- ### Methods Source: https://foundryvtt.com/api/v14/classes/foundry.packages.BaseSystem.html Provides functionality for initializing, testing, cloning, and serializing BaseSystem instances. ```APIDOC ## Methods ### _initializeSource * _initializeSource( data: any, __namedParameters?: { installed?: boolean }, ): object #### Parameters * data: any * __namedParameters: { installed?: boolean } = {} #### Returns object ### _testRequiredDependencies * _testRequiredDependencies( modulesCollection: Collection, ): Promise `Internal` Test that the dependencies of a package are satisfied as compatible. This method assumes that all packages in modulesCollection have already had their own availability tested. #### Parameters * modulesCollection: Collection A collection which defines the set of available modules #### Returns Promise Are all required dependencies satisfied? ### _testSupportedSystems * _testSupportedSystems( systemCollection: Collection, ): Promise `Internal` Test compatibility of a package's supported systems. #### Parameters * systemCollection: Collection A collection which defines the set of available systems. #### Returns Promise True if all supported systems which are currently installed are compatible or if the package has no supported systems. Returns false otherwise, or if no supported systems are installed. ### clone * clone( data?: object, context?: DataModelConstructionContext, ): | DataModel | Promise> Clone a model, creating a new data model by combining current data with provided overrides. #### Parameters * `Optional`data: object = {} Additional data which overrides current document data at the time of creation * `Optional`context: DataModelConstructionContext = {} Context options passed to the data model constructor #### Returns | DataModel | Promise> The cloned instance ### getFieldForProperty * getFieldForProperty(key: string | string[]): DataField | undefined Traverse the data model instance, obtaining the DataField definition for a field of a particular property. #### Parameters * key: string | string[] A property key like ["abilities", "strength"] or "abilities.strength" #### Returns DataField | undefined The corresponding DataField definition for that field, or undefined ### reset * reset(): void Reset the state of this data instance back to mirror the contained source data, erasing any changes. #### Returns void ### toJSON * toJSON(): object Extract the source data for the DataModel into a simple object format that can be serialized. #### Returns object The document source data expressed as a plain object ### toObject * toObject(source?: boolean): object Copy and transform the DataModel into a plain object. Draw the values of the extracted object from the data source (by default) otherwise from its transformed values. #### Parameters * `Optional`source: boolean = true Draw values from the underlying data source rather than transformed values #### Returns object The extracted primitive object ``` -------------------------------- ### ClientPackage Constructor Source: https://foundryvtt.com/api/v14/classes/foundry.ClientPackage.html Initializes a new instance of the ClientPackage class. ```APIDOC ## new ClientPackage ### Description Initializes a new instance of the ClientPackage class. ### Parameters #### Parameters - **data** (PackageManifestData) - Source data for the package - **options** (object) - Optional. Options which affect DataModel construction. Defaults to {}. ### Returns ClientPackage ``` -------------------------------- ### width Source: https://foundryvtt.com/api/v14/classes/foundry.canvas.containers.SpriteMesh.html Gets the width of the SpriteMesh. ```APIDOC ## width ### Description Gets the width of the SpriteMesh. ### Returns number ``` -------------------------------- ### height Source: https://foundryvtt.com/api/v14/classes/foundry.canvas.containers.SpriteMesh.html Gets the height of the SpriteMesh. ```APIDOC ## height ### Description Gets the height of the SpriteMesh. ### Returns number ``` -------------------------------- ### initialize Source: https://foundryvtt.com/api/v14/classes/foundry.canvas.sources.PointDarknessSource.html Initializes and configures the point darkness source with provided data and optional settings. ```APIDOC ## initialize ### Description Initialize and configure the source using provided data. ### Method `initialize(data?: any, options?: { reset?: boolean }): PointDarknessSource` ### Parameters #### Parameters - **data** (any) - Optional - Provided data for configuration - **options** (object) - Optional - Additional options which modify source initialization - **reset** (boolean) - Optional - Should source data be reset to default values before applying changes? ### Returns PointDarknessSource ``` -------------------------------- ### configure Source: https://foundryvtt.com/api/v14/classes/foundry.canvas.sources.BaseLightSource.html Configure the light source with changes. ```APIDOC ## configure ### Description Configure the light source with changes. ### Method `_configure(changes: any): void` ### Parameters #### Path Parameters - **changes** (any) - Description not available ``` -------------------------------- ### Ping.animate Source: https://foundryvtt.com/api/v14/classes/foundry.canvas.interaction.Ping.html Starts the animation for the ping. ```APIDOC ## animate animate(): Promise ### Description Starts the ping animation. ### Returns Promise - Returns true if the animation ran to completion, false otherwise. ``` -------------------------------- ### setupPackages Source: https://foundryvtt.com/api/v14/classes/foundry.Game.html Configures package data for currently enabled packages in the world. ```APIDOC ## setupPackages ### Description Configure package data that is currently enabled for this world. ### Method setupPackages(data: object): void ### Parameters * **data** (object) - Game data provided by the server socket. ### Returns void ``` -------------------------------- ### animate Source: https://foundryvtt.com/api/v14/classes/foundry.canvas.interaction.ChevronPing.html Starts the ping animation. ```APIDOC ## animate ### Description Starts the ping animation. ### Returns Promise - Returns true if the animation ran to completion, false otherwise. ``` -------------------------------- ### Get Collection Name for Document Type Source: https://foundryvtt.com/api/v14/classes/foundry.abstract.Document.html Use this method to get the collection name associated with a document type. If the direct collection name is not found, it attempts to find the first available collection for the given document name. ```javascript Actor.implementation.getCollectionName("Item"); // returns "items" ``` -------------------------------- ### initialize Source: https://foundryvtt.com/api/v14/classes/foundry.documents.BaseItem.html Initialize the instance by copying data from the source object to instance attributes. ```APIDOC ## initialize ### Description Initialize the instance by copying data from the source object to instance attributes. This mirrors the workflow of SchemaField#initialize but with some added functionality. ### Method `_initialize(options: any): void` ### Parameters * `options` (any): Options provided to the model constructor. ### Returns void ``` -------------------------------- ### get Source: https://foundryvtt.com/api/v14/classes/foundry.nue.ToursCollection.html Retrieves an element from the Collection by its key. ```APIDOC ### get * get(key: string, options?: { strict?: boolean }): Tour | undefined Get an element from the Collection by its key. #### Parameters * key: string The key of the entry to retrieve * `Optional`options: { strict?: boolean } = {} Additional options that affect how entries are retrieved * ##### `Optional`strict?: boolean Throw an Error if the requested key does not exist. Default false. #### Returns Tour | undefined The retrieved entry value, if the key exists, otherwise undefined #### Example: Get an element from the Collection by key ``` let c = new Collection([["a", "Alfred"], ["b", "Bob"], ["c", "Cynthia"]]); c.get("a"); // "Alfred" c.get("d"); // undefined c.get("d", {strict: true}); // throws Error Copy ``` ``` -------------------------------- ### create Source: https://foundryvtt.com/api/v14/classes/foundry.canvas.rendering.shaders.DepthSamplerShader.html Creates a new shader instance. ```APIDOC ## create ### Description Creates a new shader instance. ### Method `create(uniforms: any, options: any)` ### Parameters #### Path Parameters - **uniforms** (any) - Description not provided - **options** (any) - Description not provided ### Returns AbstractBaseShader ``` -------------------------------- ### configure Source: https://foundryvtt.com/api/v14/classes/foundry.documents.BasePlaylistSound.html Configure the BasePlaylistSound instance with optional parameters. ```APIDOC ## configure ### Description Configure the BasePlaylistSound instance with optional parameters. ### Method `_configure(__namedParameters?: { pack?: null; parentCollection?: null }): void` ### Parameters * `__namedParameters` (object) - Optional. An object containing configuration options. * `pack` (null) - Optional. Pack identifier. * `parentCollection` (null) - Optional. Parent collection identifier. ### Returns void ``` -------------------------------- ### get Source: https://foundryvtt.com/api/v14/classes/foundry.documents.abstract.DocumentCollection.html Retrieves an element from the DocumentCollection by its ID. ```APIDOC ## get ### Description Get an element from the DocumentCollection by its ID. ### Parameters #### Path Parameters - **id** (string): The ID of the Document to retrieve. #### Query Parameters - **options** (object) - Optional: Additional options to configure retrieval. - **invalid** (boolean) - Optional: Allow retrieving an invalid Document. - **strict** (boolean) - Optional: Throw an Error if the requested Document does not exist. ### Returns - TDocument: The retrieved Document. ### Throws - If strict is true and the Document cannot be found. ``` -------------------------------- ### connect Source: https://foundryvtt.com/api/v14/classes/foundry.av.AVMaster.html Establishes a connection to the Audio/Video client. ```APIDOC ## connect ### Description Connect to the Audio/Video client. ### Method connect ### Returns Promise Was the connection attempt successful? ``` -------------------------------- ### initializationOrder Source: https://foundryvtt.com/api/v14/classes/foundry.documents.BaseJournalEntryPage.html Get the initialization order for the document. ```APIDOC ## initializationOrder ### Description Get the initialization order for the document. ### Method `_initializationOrder(): Generator<(string | DataField | undefined)[], void, unknown>` ### Returns Generator<(string | DataField | undefined)[], void, unknown> ``` -------------------------------- ### scene Source: https://foundryvtt.com/api/v14/classes/foundry.data.LineShapeData.html Get the scene that this shape is placed in, if any. ```APIDOC ## scene ### Description The scene that this shape is placed in, if any. ### Returns - documents.Scene | null: The scene the shape is in, or null if not placed in a scene. ``` -------------------------------- ### _onCreate Source: https://foundryvtt.com/api/v14/classes/foundry.documents.FogExploration.html Post-process a creation operation for a single FogExploration instance. Post-operation events occur for all connected clients. ```APIDOC ## _onCreate ### Description Post-process a creation operation for a single FogExploration instance. Post-operation events occur for all connected clients. ### Method void ### Parameters #### Path Parameters * **data** (any) - Required - The initial data object provided to the document creation request * **options** (any) - Required - Additional options which modify the creation request * **userId** (any) - Required - The id of the User requesting the document update ### Returns void ```