Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Workspace

Represents a Workspace. Can be used to inquire and load workspaces and apply them using methods on the App object.

Example: Find and Load Workspace

// find workspace and load it in drafts list
let workspace = Workspace.find("Projects");
app.applyWorkspace(workspace);

Hierarchy

  • Workspace

Index

Properties

archiveIncludesFlagged

archiveIncludesFlagged: boolean

Should flagged drafts be included in archive.

inboxIncludesFlagged

inboxIncludesFlagged: boolean

Should flagged drafts be included in inbox.

name

name: string

The name of the workspace.

queryString

queryString: string

Search string to filter results.

showLastAction

showLastAction: boolean

Show last logged action for draft in list.

showPreview

showPreview: boolean

Show preview of draft body in list.

showTags

showTags: boolean

Show draft tags in list.

tagFilter

tagFilter: string

Comma-delimited list tag string like "blue, !green" using "!" to omit a tag.

tagFilterRequireAll

tagFilterRequireAll: boolean

If true, all (AND) tags in the tag filter must match, if false match any of the tags (OR)

Methods

query

  • query(filter: "inbox" | "archive" | "flagged" | "trash" | "all"): Draft[]
  • Query for a list of drafts contained in the workspace.

    Parameters

    • filter: "inbox" | "archive" | "flagged" | "trash" | "all"

    Returns Draft[]

setFlaggedSort

  • setFlaggedSort(sortBy: sortDirections, sortDescending: boolean, sortFlaggedToTop: boolean): void
  • setFlaggedSort(sortBy: sortDirections, sortDescending: boolean, sortFlaggedToTop: boolean): void
  • setFlaggedSort(sortBy: sortDirections, sortDescending: boolean, sortFlaggedToTop: boolean): void
  • Set sort order for flagged.

    Parameters

    • sortBy: sortDirections
    • sortDescending: boolean
    • sortFlaggedToTop: boolean

    Returns void

  • Set sort order for archive.

    Parameters

    • sortBy: sortDirections
    • sortDescending: boolean
    • sortFlaggedToTop: boolean

    Returns void

  • Set sort order for "all" drafts folder.

    Parameters

    • sortBy: sortDirections
    • sortDescending: boolean
    • sortFlaggedToTop: boolean

    Returns void

setInboxSort

  • Set sort order for inbox.

    Parameters

    Returns void

update

  • update(): void
  • Save changes made to the workspace to the database. This must be called to save changes.

    Returns void

Static create

  • create a new workspace object. This is an in-memory object only, unless update() is called to save the it. The initial state of the workspace properties is based on the configuration of the user's default workspace.

    Returns Workspace

Static find

  • Search for workspace matching the name passed and return it if found. Returns undefined if not found.

    Parameters

    • name: string

    Returns Workspace | undefined

Static getAll

  • Get list of all available workspaces.

    Returns Workspace[]

Generated using TypeDoc