The client-side Folder document which extends the common BaseFolder model.

Mixes

ClientDocumentMixin

See

  • Folders The world-level collection of Folder documents
  • FolderConfig The Folder configuration application

Hierarchy

  • any
    • Folder

Properties

depth: number

The depth of this folder in its sidebar tree

children: Folder[]

An array of other Folders which are the displayed children of this one. This differs from the results of Folder.getSubfolders because reports the subset of child folders which are displayed to the current User in the UI.

displayed: boolean = false

Return whether the folder is displayed in the sidebar to the current User.

Accessors

  • get contents(): any[]
  • The array of the Document instances which are contained within this Folder, unless it's a Folder inside a Compendium pack, in which case it's the array of objects inside the index of the pack that are contained in this Folder.

    Returns any[]

  • get documentClass(): Function
  • The reference to the Document type which is contained within this Folder.

    Returns Function

  • get documentCollection(): any
  • The reference to the WorldCollection instance which provides Documents to this Folder, unless it's a Folder inside a Compendium pack, in which case it's the index of the pack.

    Returns any

  • get expanded(): boolean
  • Return whether the folder is currently expanded within the sidebar interface.

    Returns boolean

  • get ancestors(): Folder[]
  • Return the list of ancestors of this folder, starting with the parent.

    Returns Folder[]

Methods

  • Parameters

    • data: any
    • options: any
    • user: any

    Returns Promise<any>

    Inherit Doc

  • Export all Documents contained in this Folder to a given Compendium pack. Optionally update existing Documents within the Pack by name, otherwise append all new entries.

    Parameters

    • pack: CompendiumCollection

      A Compendium pack to which the documents will be exported

    • Optional options: {
          updateByName: boolean;
          keepId: boolean;
          keepFolders: boolean;
          folder: string;
      } = {}

      Additional options which customize how content is exported. See ClientDocumentMixin#toCompendium

      • updateByName: boolean

        Update existing entries in the Compendium pack, matching by name

      • keepId: boolean

        Retain the original _id attribute when updating an entity

      • keepFolders: boolean

        Retain the existing Folder structure

      • folder: string

        A target folder id to which the documents will be exported

    Returns Promise<CompendiumCollection>

    The updated Compendium Collection instance

  • Provide a dialog form that allows for exporting the contents of a Folder into an eligible Compendium pack.

    Parameters

    • pack: string

      A pack ID to set as the default choice in the select input

    • options: any = {}

      Additional options passed to the Dialog.prompt method

    Returns Promise<void>

    A Promise which resolves or rejects once the dialog has been submitted or closed

  • Get the Folder documents which are sub-folders of the current folder, either direct children or recursively.

    Parameters

    • Optional recursive: boolean = false

      Identify child folders recursively, if false only direct children are returned

    Returns Folder[]

    An array of Folder documents which are subfolders of this one

  • Get the Folder documents which are parent folders of the current folder or any if its parents.

    Returns Folder[]

    An array of Folder documents which are parent folders of this one

  • Parameters

    • data: {} = {}
      • options: {} = {}

        Returns Promise<any>