Options
All
  • Public
  • Public/Protected
  • All
Menu

ThoughtAsylum Drafts Library

Index

Type aliases

BearNote

BearNote: { creationDate: Date; identifier: string; isTrashed: Boolean; modificationDate: Date; note: string; tags: string[]; title: string }

Data object for a Bear note.

Type declaration

  • creationDate: Date

    The date and time that the note was created.

  • identifier: string

    The unique identifier for the note in Bear.

  • isTrashed: Boolean

    Status of the note - true indicates it has been trashecd.

  • modificationDate: Date

    The date and time that the note was last modified. ISO8601 format.

  • note: string

    The content of the note in Bear as Markdown, including the title. ISO8601 format.

  • tags: string[]

    An array of tag names assigned to the note.

  • title: string

    The title of the note in Bear.

BearNoteContent

BearNoteContent: { note: string; title: string }

A content object for a Bear note as provided by the Bear API.

Type declaration

  • note: string

    The content of the note in Bear as Markdown, including the title.

  • title: string

    The title of the note in Bear.

BearNoteIdentifiers

BearNoteIdentifiers: { identifier: string; title: string }

A subset of meta data object for a Bear note dealing with data usable as a note identifier by the Bear API.

Type declaration

  • identifier: string

    The unique identifier for the note in Bear.

  • title: string

    The title of the note in Bear.

BearNoteMetaData

BearNoteMetaData: { creationDate: Date; identifier: string; modificationDate: Date; tags: string[]; title: string }

Meta data object for a Bear note.

Type declaration

  • creationDate: Date

    The date and time that the note was created. ISO8601 format.

  • identifier: string

    The unique identifier for the note in Bear.

  • modificationDate: Date

    The date and time that the note was last modified. ISO8601 format.

  • tags: string[]

    An array of tag names assigned to the note.

  • title: string

    The title of the note in Bear.

GitHubFileContent

GitHubFileContent: { content: string; success: Boolean }

A content object for a GitHub file content fetch.

Type declaration

  • content: string

    The content of the the file if it was successfully retrieved, and the error message if it could not.

  • success: Boolean

    Set to true if the file content could be retrieved and false if it could not.

TYPE_intCountBase

TYPE_intCountBase: 0 | 1

Count empty strings as 0 or 1 line.

TYPE_logMode

TYPE_logMode: "prepend" | "cursor" | "append"

Valid modes usable by TA_logToDraft* functions. Determines whether to log text to the start of the draft, the current cursor position (valid for current draft only), or the end of the draft.

TYPE_strBearFonts

TYPE_strBearFonts: "Avenir Next" | "System" | "Helvetica Neue" | "Menlo" | "Georgia" | "Courier" | "Open Dyslexic"

Fonts used by the Bear app.

TYPE_strBearModes

TYPE_strBearModes: "append" | "prepend" | "replace" | "replace_all"

Addition of text modes used by the Bear app.

  • append adds text to the end of the note.
  • prepend adds text to the start of the note, after the title.
  • replace replaces the content of the note, but leaves the title untouched.
  • append areplaces the content of the note, including the title.

TYPE_strBearThemes

TYPE_strBearThemes: "Red Graphite" | "Charcoal" | "Solarized Light" | "Solarized Dark" | "Panic Mode" | "Dracula" | "Gotham" | "Toothpaste" | "Cobalt" | "Duotone Light" | "Duotone Snow" | "Dieci" | "Ayu" | "Ayu Mirage" | "Dark Graphite" | "Gandalf" | "Olive Dunk" | "D.Boing"

Themes used by the Bear app.

TYPE_strFilter

TYPE_strFilter: "inbox" | "archive" | "flagged" | "trash" | "all"

Query filter for the different folder sets available in Drafts For a review of what these correspond to, see this post on folders in Drafts.

TYPE_strGitHubRepoSortOrder

TYPE_strGitHubRepoSortOrder: "created" | "updated" | "pushed" | "full_name"

Sort order for GitHub repository queries.

TYPE_strGitHubRepoType

TYPE_strGitHubRepoType: "all" | "public" | "private" | "forks" | "sources" | "member" | "internal"

Types of GitHub repositories.

TadConsole_action

TadConsole_action: { createdAt: string; uuid: string }

A set of properties about an action.

Type declaration

  • createdAt: string

    The name of the action. e.g. TAD-Sort All - Alphabetic

  • uuid: string

    The unique identifier of the action. e.g. DF74859E-85B4-4391-B06F-ADE7739B7180.

TadConsole_draft

TadConsole_draft: { uuid: string; version: TadConsole_draftVersion }

A set of properties about a draft.

Type declaration

  • uuid: string

    The unique identifier of the draft. e.g. DF74859E-85B4-4391-B06F-ADE7739B7180.

  • version: TadConsole_draftVersion

    A set of properties about the draft version at the point at which this set of properties was populated.

TadConsole_draftVersion

TadConsole_draftVersion: { createdAt: string; number: number; uuid: string }

A set of properties about a draft version.

Type declaration

  • createdAt: string

    Date & time of when the version was created. e.g. Sun Jul 19 2020 07:08:09 GMT+0100 (BST)

  • number: number

    Which version in reverse chronological order the version is. e.g. 1.

  • uuid: string

    The unique identifier of the draft version. e.g. DF74859E-85B4-4391-B06F-ADE7739B7180.

TadConsole_logEntry

TadConsole_logEntry: { code: string; entry: number; stamp: number; type: string }

An object describing a log entry in an advanced logging object defined by the class TadConsole.

Type declaration

  • code: string

    An optional alternate/sub-classification of a log entry. e.g. W01.

  • entry: number

    The text entry to be logged.

  • stamp: number

    A timestamp at which the logging occurred. e.g. 2020-07-20-19.18.17.160.

  • type: string

    An optional classification of a log entry. e.g. WARNING.

TadKey

TadKey: { auto: Boolean; key: string }

A set of properties for a crypto-key.

Type declaration

  • auto: Boolean

    If the key was automatically generated (true), or manually entered (false).

  • key: string

    The value of the key. e.g. FFEEDDCCBBAA00998877665544332211.

navigationMarker

navigationMarker: { label: string; length: number; level: number; location: number; prefix: string }

Drafts navigation marker - a standard structure within Drafts.

Type declaration

  • label: string

    Label text for the marker.

  • length: number

    The number of characters in the range.

  • level: number

    Indentation level of the marker.

  • location: number

    The start location of the range of text representing the marker.

  • prefix: string

    Prefix text for the marker. Example: H1, H2 in Markdown

selectionRange

selectionRange: Array<number>

An array of numbers containing the location (index in string), and length (number of characters) of a text selection.

Variables

Const TA_DRAFTS_SYNTAX

TA_DRAFTS_SYNTAX: string[]

This is an array of standard Drafts syntaxes in the order the appear in the Drafts user interface.

  • Plain Text
  • Markdown
  • MultiMarkdown
  • GitHub Markdown
  • Simple List
  • Taskpaper
  • JavaScript

tadCmd

tadCmd: TadCommand

This is an instance of the TadCommand class that is utilised by the library, and can be utilised in any scripts using the library.

tadCon

tadCon: TadConsole

This is an instance of the TadConsole class that is utilised by the library, and can be utilised in any scripts using the library.

tadData

tadData: TadData

This is an instance of the TadData class that is initialised during the library load. It can be utilised in any scripts using the library, and data is stored in the file location specified by the dataPath property of the tadLib instance of the TadLibrary class.

tadInfo

tadInfo: TadInfo

This is an instance of the TadInfo class that is urilised by the library, and can be utilised in any scripts using the library.

tadLib

tadLib: TadLibrary

This is an instance of the TadLibrary class that is utilised by the library, and can be utilised in any scripts using the library.

tadMisc

This is an instance of the TadMiscellaneous class that is utilised by the library, and can be utilised in any scripts using the library.