Type Parameters

  • T = NamedDocumentConstructor

    Provides a wrapper implementing the Svelte store / subscriber protocol around any Document / ClientMixinDocument. This makes documents reactive in a Svelte component, but otherwise provides subscriber functionality external to Svelte.

Constructors

Accessors

  • get uuidv4(): string
  • Returns the UUID assigned to this store.

    Returns string

    UUID

Methods

  • Completely removes all internal subscribers, any optional delete callback, and unregisters from the ClientDocumentMixin apps tracking object.

    Returns void

  • Returns T

    Current document

  • Parameters

    Returns void

  • Potentially sets new document from data transfer object.

    Parameters

    • data: object

      Document transfer data.

    • Optionaloptions: {
          compendium?: boolean;
          types?: string[];
          world?: boolean;
      }

      Optional parameters for TJSDocument.getUUIDFromDataTransfer.

      • Optionalcompendium?: boolean
      • Optionaltypes?: string[]
      • Optionalworld?: boolean

    Returns Promise<boolean>

    Returns true if new document set from data transfer blob.

  • Sets the document by Foundry UUID performing a lookup and setting the document if found.

    Parameters

    Returns Promise<boolean>

    True if successfully set document from UUID.

  • Sets options for this document wrapper / store.

    Parameters

    Returns void

  • Attempts to create a Foundry UUID from standard drop data. This may not work for all systems.

    Parameters

    • data: object

      Drop transfer data.

    • Optionalopts: {
          compendium?: boolean;
          types?: string[];
          world?: boolean;
      }

      Optional parameters.

      • Optionalcompendium?: boolean

        Accept compendium documents.

      • Optionaltypes?: string[]

        Require the data.type to match entry in types.

      • Optionalworld?: boolean

        Accept world documents.

    Returns string

    Foundry UUID for drop data.