Back to Trilium

Class BOption

docs/Script API/classes/Backend_Script_API.BOption.html

0.102.25.6 KB
Original Source

Class BOption

Option represents a name-value pair, either directly configurable by the user or some system property.

Hierarchy (View Summary)

Index

Constructors

constructor

Properties

blobId?dateCreated?dateModified?isProtected?isSynced?nameutcDateCreatedutcDateModified?value

Accessors

beccaisDeletedentityNamehashedPropertiesprimaryKeyName

Methods

_getContent_setContentbeforeSavinggenerateHashgetPojogetPojoToSavegetUtcDateChangedhasStringContentinitmarkAsDeletedmarkAsDeletedSimpleputEntityChangesaveupdateFromRow

Constructors

constructor

new BOption(row?: OptionRow): BOption

Parameters

Returns BOption

Properties

OptionalblobId

blobId?: string

OptionaldateCreated

dateCreated?: string

OptionaldateModified

dateModified?: string

OptionalisProtected

isProtected?: boolean

OptionalisSynced

isSynced?: boolean

name

name: string

utcDateCreated

utcDateCreated: string

OptionalutcDateModified

utcDateModified?: string

value

value: string

Accessors

Protectedbecca

get becca(): default

Returns default

isDeleted

get isDeleted(): boolean

Returns boolean

StaticentityName

get entityName(): string

Returns string

StatichashedProperties

get hashedProperties(): string[]

Returns string[]

StaticprimaryKeyName

get primaryKeyName(): string

Returns string

Methods

Protected_getContent

_getContent(): string | Buffer<ArrayBufferLike>

Returns string | Buffer<ArrayBufferLike>

Protected_setContent

_setContent(content: string | Buffer<ArrayBufferLike>, opts?: ContentOpts): void

Parameters

Returns void

beforeSaving

beforeSaving(): void

Returns void

generateHash

generateHash(isDeleted?: boolean): string

Parameters

  • OptionalisDeleted: boolean

Returns string

getPojo

getPojo(): {
isSynced: undefined
| boolean;
name: string;
utcDateModified: undefined | string;
value: string;
}

Returns { isSynced: undefined | boolean; name: string; utcDateModified: undefined | string; value: string; }

ProtectedgetPojoToSave

getPojoToSave(): {}

Returns {}

getUtcDateChanged

getUtcDateChanged(): string

Returns string

hasStringContent

hasStringContent(): boolean

Returns boolean

init

init(): void

Returns void

markAsDeleted

markAsDeleted(deleteId?: null | string): void

Mark the entity as (soft) deleted. It will be completely erased later.

This is a low-level method, for notes and branches use note.deleteNote() and 'branch.deleteBranch()` instead.

Parameters

  • deleteId: null | string = null

Returns void

markAsDeletedSimple

markAsDeletedSimple(): void

Returns void

ProtectedputEntityChange

putEntityChange(isDeleted: boolean): void

Parameters

  • isDeleted: boolean

Returns void

save

save(opts?: {}): this

Saves entity - executes SQL, but doesn't commit the transaction on its own

Parameters

  • Optionalopts: {}

Returns this

updateFromRow

updateFromRow(row: OptionRow): void

Parameters

Returns void

Settings

Member Visibility

  • Protected
  • Inherited
  • External

ThemeOSLightDark

On This Page

Constructors constructor Properties blobIddateCreateddateModifiedisProtectedisSyncednameutcDateCreatedutcDateModifiedvalue Accessors beccaisDeletedentityNamehashedPropertiesprimaryKeyName Methods _getContent_setContentbeforeSavinggenerateHashgetPojogetPojoToSavegetUtcDateChangedhasStringContentinitmarkAsDeletedmarkAsDeletedSimpleputEntityChangesaveupdateFromRow