ItemSerializer

A class for serializing and deserializing Item s.

Format Constants

.ItemReferencesType

Outline and item ID JSON for the pasteboard.

.BMLType

BML type constant.

  • HTML subset for representing outlines in HTML.
.OPMLType

OPML type constant.

.TaskPaperType

TaskPaper text type constant.

  • Encode item structure with tabs.
  • Encode item data-* attributes with tag(value) pattern.
.TEXTType

Plain text type constant.

  • Encode item structure with tabs.

Serialize & Deserialize Items

.serializeItems(items, options?)

Serialize items into a supported format.

Argument Description
items Item Array to serialize.
options? Serialization options.
  • type String (default: ItemSerializer.BMLType)
  • startOffset Number (default: 0) Offset into first into to start at.
  • endOffset Number (default: lastItem.bodyString.length) Offset from end of last item to end at.
  • expandedItems Item Array of expanded items
.deserializeItems(itemsData, outline, options)

Deserialize items from a supported format.

Argument Description
itemsData String to deserialize.
outline Outline to use when creating deserialized items.
options Deserialization options.
  • type String (default: ItemSerializer.TEXTType)
Return Values
Returns Array of Item s.

results matching ""

    No results matching ""