Options
All
  • Public
  • Public/Protected
  • All
Menu

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

mixes

ClientDocumentMixin

see

Folders The world-level collection of Folder documents

see

FolderConfig The Folder configuration application

Hierarchy

  • any
    • Folder

Index

Constructors

  • Returns 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.

#contents: any

Accessors

  • get contents(): any[]
  • set contents(value: any[]): void
  • 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[]

  • 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.

    Parameters

    • value: any[]

    Returns void

  • 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

  • Return the list of ancestors of this folder, starting with the parent.

    Returns Folder[]

Methods

  • _preCreate(data: any, options: any, user: any): Promise<void>
  • override

    Parameters

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

    Returns Promise<void>

  • 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

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

    Returns Promise<CompendiumCollection>

    The updated Compendium Collection instance

  • exportDialog(pack: string, options?: any): Promise<void>
  • 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

  • getSubfolders(recursive?: boolean): Folder[]
  • Get the Folder documents which are sub-folders of the current folder, either direct children or recursively.

    Parameters

    • recursive: boolean = false

    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

  • createDialog(data?: any, options?: {}): Promise<Folder>
  • Present a Dialog form to create a new Folder.

    see

    ClientDocumentMixin.createDialog

    Parameters

    • data: any = {}

      Initial data with which to populate the creation form

    • options: {} = {}

      Returns Promise<Folder>

      A Promise which resolves to the created Folder, or null if the dialog was closed.