Options
All
  • Public
  • Public/Protected
  • All
Menu

The Collection of Setting documents which exist within the active World. This collection is accessible as game.settings.storage.get("world")

see

Setting The Setting document

Hierarchy

Index

Constructors

Accessors

  • get directory(): any
  • override

    Returns any

  • get documentClass(): Function
  • A reference to the Document class definition which is contained within this DocumentCollection.

    Returns Function

  • get documentName(): any
  • inheritdoc

    Returns any

  • get name(): string
  • The Collection class name

    Returns string

  • Return a reference to the singleton instance of this WorldCollection, or null if it has not yet been created.

    Returns WorldCollection

  • Return an array of currently registered sheet classes for this Document type.

    static

    Returns DocumentSheet[]

Methods

  • Return the Setting document with the given key.

    Parameters

    • key: string

      The setting key

    Returns Setting

    The Setting

  • getItem(key: string): string
  • Return the serialized value of the world setting as a string

    Parameters

    • key: string

      The setting key

    Returns string

    The serialized setting string

  • importFromCompendium(pack: CompendiumCollection, id: string, updateData?: any, options?: any): Promise<Document>
  • Import a Document from a Compendium collection, adding it to the current World.

    Parameters

    • pack: CompendiumCollection

      The CompendiumCollection instance from which to import

    • id: string

      The ID of the compendium entry to import

    • updateData: any = {}
    • options: any = {}

    Returns Promise<Document>

    The imported Document instance

  • fromCompendium(document: any, [options]?: { addFlags: boolean; clearSort: boolean; clearOwnership: boolean; keepId: boolean }): any
  • Apply data transformations when importing a Document from a Compendium pack

    Parameters

    • document: any

      The source Document, or a plain data object

    • [options]: { addFlags: boolean; clearSort: boolean; clearOwnership: boolean; keepId: boolean } = {}

      Additional options which modify how the document is imported

      • addFlags: boolean
      • clearSort: boolean
      • clearOwnership: boolean
      • keepId: boolean

    Returns any

    The processed data ready for world Document creation

  • getInvalid(id: string): Document
  • Obtain a temporary Document instance for a document id which currently has invalid source data.

    Parameters

    • id: string

      A document ID with invalid source data.

    Returns Document

    An in-memory instance for the invalid Document

  • set(id: any, document: any): void
  • delete(id: any): void
  • render(force: any, options: any): void
  • Render any Applications associated with this DocumentCollection.

    Parameters

    • force: any
    • options: any

    Returns void

  • updateAll(transformation: any, condition?: Function, options?: any): Promise<Document[]>
  • Update all objects in this DocumentCollection with a provided transformation. Conditionally filter to only apply to Entities which match a certain condition.

    Parameters

    • transformation: any

      An object of data or function to apply to all matched objects

    • condition: Function = null

      A function which tests whether to target each object

    • options: any = {}

    Returns Promise<Document[]>

    An array of updated data once the operation is complete

  • _preCreateDocuments(result: any[], options: any, userId: string): void
  • Preliminary actions taken before a set of Documents in this Collection are created.

    Parameters

    • result: any[]

      An Array of created data objects

    • options: any

      Options which modified the creation operation

    • userId: string

      The ID of the User who triggered the operation

    Returns void

  • _onCreateDocuments(documents: Document[], result: any[], options: any, userId: string): void
  • Follow-up actions taken after a set of Documents in this Collection are created.

    Parameters

    • documents: Document[]

      An Array of created Documents

    • result: any[]

      An Array of created data objects

    • options: any

      Options which modified the creation operation

    • userId: string

      The ID of the User who triggered the operation

    Returns void

  • _preUpdateDocuments(result: any[], options: any, userId: string): void
  • Preliminary actions taken before a set of Documents in this Collection are updated.

    Parameters

    • result: any[]

      An Array of incremental data objects

    • options: any

      Options which modified the update operation

    • userId: string

      The ID of the User who triggered the operation

    Returns void

  • _onUpdateDocuments(documents: Document[], result: any[], options: any, userId: string): void
  • Follow-up actions taken after a set of Documents in this Collection are updated.

    Parameters

    • documents: Document[]

      An Array of updated Documents

    • result: any[]

      An Array of incremental data objects

    • options: any

      Options which modified the update operation

    • userId: string

      The ID of the User who triggered the operation

    Returns void

  • _preDeleteDocuments(result: string[], options: any, userId: string): void
  • Preliminary actions taken before a set of Documents in this Collection are deleted.

    Parameters

    • result: string[]

      An Array of document IDs being deleted

    • options: any

      Options which modified the deletion operation

    • userId: string

      The ID of the User who triggered the operation

    Returns void

  • _onDeleteDocuments(documents: Document[], result: string[], options: any, userId: string): void
  • Follow-up actions taken after a set of Documents in this Collection are deleted.

    Parameters

    • documents: Document[]

      An Array of deleted Documents

    • result: string[]

      An Array of document IDs being deleted

    • options: any

      Options which modified the deletion operation

    • userId: string

      The ID of the User who triggered the operation

    Returns void

  • registerSheet(...args: any[]): void
  • Register a Document sheet class as a candidate which can be used to display Documents of a given type. See DocumentSheetConfig.registerSheet for details.

    static
    example

    Register a new ActorSheet subclass for use with certain Actor types.

    Actors.registerSheet("dnd5e", ActorSheet5eCharacter, { types: ["character], makeDefault: true });
    

    Parameters

    • Rest ...args: any[]

      Arguments forwarded to the DocumentSheetConfig.registerSheet method

    Returns void

  • unregisterSheet(...args: any[]): void
  • Unregister a Document sheet class, removing it from the list of available sheet Applications to use. See DocumentSheetConfig.unregisterSheet for detauls.

    static
    example

    Deregister the default ActorSheet subclass to replace it with others.

    Actors.unregisterSheet("core", ActorSheet);
    

    Parameters

    • Rest ...args: any[]

      Arguments forwarded to the DocumentSheetConfig.unregisterSheet method

    Returns void

Properties

apps: Application[]

An Array of application references which will be automatically updated when the collection content changes

invalidDocumentIds: Set<string> = ...

Record the set of document ids where the Document was not initialized because of invalid source data

documentName: string = "Setting"
override