Tintero Developers

Data types

Every type the plugin SDK hands you or takes back: 74 interfaces and unions, straight from the published type definitions.

On this page

These are the shapes behind the API reference. When a method says it returns Promise<Character>, this page is what a Character contains. All of it is read out of tintero-plugin-sdk.d.ts, the same file you compile against, so your editor and this page cannot disagree.

Data Types

ProjectMetadata #

6 required of 6
id string
name string
description string | null
createdAt number
lastModified number
path string

CharacterWorldbuilding #

0 required of 38
species ? string[]
factions ? string[]
occupations ? string[]
locations ? string[]
religions ? string[]
magicSystems ? string[]
languages ? string[]
technologies ? string[]
groupMember ? string[]
groupLeader ? string[]
groupFounder ? string[]
groupExMember ? string[]
groupExLeader ? string[]
deityFollower ? string[]
deityChampion ? string[]
deityClergy ? string[]
deityEnemy ? string[]
deityBlessed ? string[]
deityCursed ? string[]
deityExFollower ? string[]
creatureTamed ? string[]
creatureHunted ? string[]
creatureProtected ? string[]
creatureEncountered ? string[]
creatureCompanion ? string[]
creatureFamiliar ? string[]
itemOwner ? string[]
itemCreator ? string[]
itemDiscovered ? string[]
itemGuardian ? string[]
itemExOwner ? string[]
itemSeeker ? string[]
eventParticipant ? string[]
eventKeyFigure ? string[]
eventCausedBy ? string[]
eventWitness ? string[]
eventVictim ? string[]
eventHero ? string[]

CharacterVariant #

4 required of 7
id string
name string
description ? string
position ? number
overrides Record<string, any>

Partial overrides of character fields for this variant.

createdAt number
updatedAt ? number

Character #

3 required of 26
id string
name string
firstName ? string
lastName ? string
pronouns ? string[]
aka ? string[]
physicalDescription ? string
psychologicalDescription ? string
portrait ? string
landscape ? string
color ? string
gender ? string
age ? string
birthdate ? string
birthplace ? string
traits ? string[]
goals ? string[]
fears ? string[]
backstory ? string
notes ? string
tags ? string[]
createdAt number
updatedAt ? number
relationships ? Relationship []
variants ? CharacterVariant []
worldbuilding ? CharacterWorldbuilding

Relationship #

2 required of 5
characterId string
type string
description ? string
isBidirectional ? boolean
inverseType ? string

WorldbuildingType #

Known worldbuilding element types. Plugins may encounter other custom types.

| 'species' | 'faction' | 'occupation' | 'location' | 'religion' | 'magic-system' | 'technology' | 'language' | 'event' | 'creature' | 'item' | 'group' | 'deity' | 'custom'

WorldbuildingElement #

4 required of 13
id string
name string
type WorldbuildingType | string

One of the known WorldbuildingType values, or a custom string.

description ? string
portrait ? string

Reference to the element's portrait image (fileName or relativePath). Resolve with tintero.project.getImageData().

landscape ? string

Reference to the element's landscape/banner image (fileName or relativePath). Resolve with tintero.project.getImageData().

isFavorite ? boolean
tags ? string[]
color ? string
createdAt number
updatedAt ? number
notes ? string
extraFields ? { id: string; label: string; type: 'text' | 'textarea'; value: string }[]

WritingMode #

Writing mode for files and documents.

'prose' | 'screenplay' | 'theatre'

FileMetadata #

5 required of 17
id string
name string
title ? string
location string
treePath ? string
order ? number | null
status ? string | null
createdAt number
lastModified number
hash ? string
links ? string[]
color ? string
customIcon ? string
wordNumber ? number
keywords ? string[]
customMetadata ? Record<string, string>
writingMode ? WritingMode

DocMetadata #

7 required of 14
id string
name string
title string
location string
treePath string
createdAt number
lastModified number
links ? string[]
color ? string
customIcon ? string
wordNumber ? number
keywords ? string[]
customMetadata ? Record<string, string>
writingMode ? WritingMode

Note #

5 required of 6
id string
fileId string | null
type string
location string
textAssociated string | null
content ? string

PlotGridColumn #

3 required of 3
id string
name string
position number

PlotGridCell #

4 required of 7
id string
type string
columnId string
rowIndex number
referenceId ? string
content ? string
color ? string

PlotGrid #

7 required of 7
id string
name string
columns PlotGridColumn []
rowCount number
createdAt number
lastModified number

CardboardCell #

3 required of 9
id string
type string
position { row: number; col: number }
referenceId ? string
content ? string
imageUrl ? string

For image cells: reference to the image (fileName or relativePath). Resolve with tintero.project.getImageData().

color ? string
checked ? boolean
title ? string

CardboardGrid #

7 required of 7
id string
name string
rows number
cols number
createdAt number
lastModified number

Collection #

3 required of 3
id string
name string
items { id: string; type: string }[]

ImageInfo #

6 required of 9
id string
title string
fileName string
relativePath string
size number
mimeType string
width ? number
height ? number
createdAt ? number

Creation timestamp in epoch milliseconds.

WritingGoal #

5 required of 7
id string
type string

"words" | "chapters" | "chaptersCreated" | "characters" | "worldbuilding" | "streak" | "minutes"

cadence string

"daily" | "weekly" | "monthly" | "total"

target number
title ? string
createdAt number
archivedAt ? number | null

Soft-delete marker; archived goals are kept for sync merges.

WordCountLog #

3 required of 3
dayTimestamp number

Start-of-day epoch ms for the logged day.

count number
objective number

WritingMinutesLog #

2 required of 2
dayTimestamp number

Start-of-day epoch ms for the logged day.

minutes number

TimelineNote #

4 required of 4
id string
text string
color string
position number

TimelineBlock #

4 required of 9
id string
fileId string
sceneId ? string
childTimelineId ? string
startCol number
spanCols number
color ? string
characterId ? string

Linked project character id.

worldbuildingId ? string

Linked project worldbuilding element id.

TimelineLane #

6 required of 7
id string
name string
collapsed boolean
customHeight ? number
blocks TimelineBlock []
milestones TimelineNote []

Timeline #

6 required of 8
id string
name string
parentId ? string
unassignedNotes TimelineNote []
customWidth ? number
createdAt number
lastModified number

FlowMapTodo #

3 required of 3
id string
text string
done boolean

FlowMapNode #

6 required of 17
id string
label string
x number
y number
type string

"circle" | "square" | "rounded" | "diamond" | "document" | "todo-list" | "simple-list" | "note" | "character" | "worldbuilding" | custom string

color string
title ? string

Small heading the writer typed above the node's text ("DECISION", "ACT II").

padding ? number

Padding inside the node, in pixels, when the writer set it by hand.

extendedText ? string
noteColor ? string
linkedDocument ? string

Linked project document fileId.

linkedCharacterId ? string

Linked project character id.

linkedWorldbuildingId ? string

Linked project worldbuilding element id.

todoList ? FlowMapTodo []
width ? number
height ? number
customData ? any

FlowMapConnection #

4 required of 8
id string
fromNodeId string
toNodeId string
arrowType string

"simple" | "bidirectional" | "unidirectional-forward" | "unidirectional-backward" | "dotted"

label ? string
startEdgePosition ? number
endEdgePosition ? number
color ? string

FlowMap #

6 required of 6
id string
name string
nodes FlowMapNode []
connections FlowMapConnection []
createdAt number
lastModified number

FlowMapUpdate #

2 required of 2

What project.updateFlowMap() replaces. Nodes and connections go together: a flow map travels to sync as one whole entity, so there is no cheaper node-by-node write.

nodes FlowMapNode []
connections FlowMapConnection []

CustomFieldDef #

4 required of 8
id string
name string
label string
type string

"text" | "textarea" | "checkbox" | "relationship"

placeholder ? string
description ? string
defaultValue ? any
order ? number

CustomWorldbuildingTemplate #

7 required of 11
id string
name string
description ? string
icon string
color string
createdAt number
updatedAt number
archived ? boolean
tags ? string[]
version ? number

FileSnapshot #

4 required of 5
id string
location string
name string
createdAt number
writingMode ? WritingMode

Scene #

6 required of 12
id string
name ? string
povCharacterId string | null
charactersInScene ? string[] | null
objectsInScene ? string[] | null
type string

"main_continuity" | "flashback" | "dream" | "vision" | "memory" | "prologue" | "epilogue" | "interlude" | "montage"

locationId string | null
createdAt number
updatedAt number
startOffset ? number
endOffset ? number
notes ? string

BackupEntry #

4 required of 6
id string
name string

Internal folder identifier. Since 0.10.x it equals id for new backups; it is NOT the text passed to backup.create() (that goes to label). Look backups up by id, not by name.

label ? string

User-visible label (the name given to backup.create()). Absent on older or unlabeled backups.

timestamp number
observations ? string
type 'automatic' | 'manual'

Write input types

TimelineMilestone #

4 required of 4

A marked moment on a timeline: a turning point, a climax. Drawn across every lane.

id string
text string
color string
position number

The column it sits at.

TimelineSegment #

4 required of 5

A named stretch of a timeline's axis: an act, a part, a season.

id string
name string
startCol number
spanCols number
color ? string

TimelineBlockInput #

0 required of 9

A block to put on a timeline lane. The id is assigned by Tintero, not by you. kind: 'document' (the default) needs fileId; kind: 'event' needs eventId, the id of a worldbuilding element of type event.

kind ? 'document' | 'event'
fileId ? string
sceneId ? string
eventId ? string
startCol ? number

Column the block starts at. Defaults to 0.

spanCols ? number

How many columns it covers. Defaults to 1.

color ? string
characterId ? string
worldbuildingId ? string

FlowMapNodeInput #

1 required of 10

A node to add to a flow map. The id is assigned by Tintero.

label string
x ? number

Canvas position in pixels. Both default to 0, which stacks nodes on top of each other.

y ? number
type ? string

Shape. Defaults to "rounded".

color ? string
title ? string
extendedText ? string
linkedDocument ? string
linkedCharacterId ? string
linkedWorldbuildingId ? string

FlowMapConnectionInput #

2 required of 5

An arrow to add to a flow map. Both node ids must already exist.

fromNodeId string
toNodeId string
arrowType ? string

Defaults to "unidirectional-forward".

label ? string
color ? string

SceneInput #

0 required of 7

A scene to create inside a chapter. The id and the timestamps are assigned by Tintero.

name ? string
povCharacterId ? string | null
type ? string

Defaults to "scene". See Scene.type for the values.

locationId ? string | null
charactersInScene ? string[] | null
objectsInScene ? string[] | null
notes ? string

CharacterInput #

1 required of 20
name string
firstName ? string
lastName ? string
pronouns ? string[]
aka ? string[]
physicalDescription ? string
psychologicalDescription ? string
portrait ? string

Reference to the character's portrait image (fileName or relativePath).

landscape ? string

Reference to the character's landscape/banner image (fileName or relativePath).

color ? string
gender ? string
age ? string
birthdate ? string
birthplace ? string
traits ? string[]
goals ? string[]
fears ? string[]
backstory ? string
notes ? string
tags ? string[]

WorldbuildingInput #

2 required of 6
name string
type string
description ? string
tags ? string[]
color ? string
notes ? string

NoteInput #

1 required of 5
location string
type ? string
fileId ? string
textAssociated ? string
content ? string

FileInput #

1 required of 9
name string

File name (required).

treePath ? string

Folder tree path (e.g. "Chapter 1"). Defaults to root.

writingMode ? WritingMode

Writing mode: 'prose' | 'screenplay' | 'theatre'. Defaults to 'prose'.

content ? string

Optional initial HTML content.

color ? string

Color tag.

customIcon ? string

Custom emoji icon.

keywords ? string[]

Keywords/tags.

customMetadata ? Record<string, string>

Free-form metadata.

status ? string

Workflow status (e.g. "draft", "review").

FileMetaUpdate #

0 required of 10
name ? string
title ? string
color ? string
customIcon ? string
keywords ? string[]
customMetadata ? Record<string, string>
writingMode ? WritingMode
status ? string
order ? number
treePath ? string

DocInput #

1 required of 8
name string

Document name (required).

treePath ? string

Folder tree path. Defaults to root.

writingMode ? WritingMode

Writing mode. Defaults to 'prose'.

content ? string

Optional initial HTML content.

color ? string

Color tag.

customIcon ? string

Custom emoji icon.

keywords ? string[]

Keywords/tags.

customMetadata ? Record<string, string>

Free-form metadata.

DocMetaUpdate #

0 required of 8
name ? string
title ? string
color ? string
customIcon ? string
keywords ? string[]
customMetadata ? Record<string, string>
writingMode ? WritingMode
treePath ? string

FolderInfo #

3 required of 5
id string
title string
treePath string
color ? string
customIcon ? string

Application Settings types

GeneralSettings #

17 required of 17
languageIsoCode string
selectedTheme string
sidebarLength number
editorZoom number
spellCheckLanguage string
dateFormat string
timeFormat string
autoDetectLanguage boolean
fontSize number | null
distractionFreeMode boolean
highlightCurrentLine boolean
showWordCount boolean
useDialogWhenCreatingFiles boolean
appMode 'creative' | 'study' | 'minimal'
clickFileOpensSameTab boolean
displayChapterOrder boolean
showNativeDecorators boolean

TrophySettings #

9 required of 9
dailyObjective number
weeklyObjective number
objectiveType string
objectiveReminders boolean
showRealTimeProgress boolean
streakTracking boolean
reminderTime string
showAchievements boolean
achievementNotifications boolean

HideSettings #

10 required of 11
showSidebar boolean
editorShowSidebar boolean
showStatusBar boolean
showEditorUnderBar boolean
visibleSidebarFiles boolean
visibleSidebarCharacters boolean
visibleSidebarWorldbuilding boolean
visibleSidebarNotes boolean
visibleSidebarBoards ? boolean
visibleSidebarAchievements boolean
visibleSidebarBetaShares boolean

EditorSettings #

3 required of 6
defaultFontFamily string | null
maxCharacters number | null
defaultFontSize number | null
intelligentQuotes ? boolean
intelligentDialog ? boolean
autoSave ? boolean

EditorToolbarSettings #

0 required of 22
disableDistractionFreeMode ? boolean
disableZoom ? boolean
disableBold ? boolean
disableItalic ? boolean
disableStrikethrough ? boolean
disableHighlight ? boolean
disableRemoveFormat ? boolean
disableHeadings ? boolean
disableAlignLeft ? boolean
disableAlignCenter ? boolean
disableAlignRight ? boolean
disableJustify ? boolean
disableUnorderedList ? boolean
disableOrderedList ? boolean
disableBlockquote ? boolean
disableCodeBlock ? boolean
disableInlineCode ? boolean
disableFootnote ? boolean
disableTable ? boolean
disableImage ? boolean
disableDocumentLink ? boolean
disableHorizontalRule ? boolean

SanitizedAiSettings #

4 required of 5

Sanitized AI settings exposed to plugins. Sensitive fields (host, port, lastUsedModels) are excluded.

serverType 'ollama' | 'lm-studio'
hide ? boolean
selectedModel string
temperature number
maxTokens number

AppSettings #

6 required of 6

The full application settings object returned by tintero.app.getSettings().

generalSettings GeneralSettings
trophySettings TrophySettings
hideSettings HideSettings
editorSettings EditorSettings
editorToolbarSettings EditorToolbarSettings

AI settings are sanitized. Host, port, and lastUsedModels are stripped.

Dialog options

DialogOptions #

0 required of 4
title ? string
width ? number
height ? number
data ? any

Notification types

NotificationType #

'info' | 'success' | 'warning' | 'error'

Export/Import config

ExportResult #

1 required of 3
data string
encoding ? 'text' | 'base64'
mimeType ? string

FileExporterConfig #

3 required of 4
formatName string
extension string
mimeType ? string
convert (jsonContent: string) => string | ExportResult | Promise<string | ExportResult >

Receives the file content as a ProseMirror/TipTap JSON string. Use JSON.parse() or tintero.convert to work with it.

BookExporterConfig #

3 required of 4
formatName string
extension string
mimeType ? string
convert (documents: string[], metadata: ProjectMetadata ) => string | ExportResult | Promise<string | ExportResult >

Each element of documents is a ProseMirror/TipTap JSON string for one file.

ProjectExporterConfig #

3 required of 4
formatName string
extension string
mimeType ? string
convert (project: any) => string | ExportResult | Promise<string | ExportResult >

FileImporterConfig #

3 required of 4
formatName string
extensions string[]
formatDescription ? string
convert (data: string, fileName: string) => string | Promise<string>

ProjectImporterConfig #

3 required of 4
formatName string
extensions string[]
formatDescription ? string
convert (data: string, fileName: string) => any | Promise<any>

Editor types

EditorSelection #

4 required of 4
from number

Start position of the selection in the ProseMirror document.

to number

End position of the selection. Same as from when no text is selected.

text string

The selected text, or empty string if nothing is selected.

empty boolean

Whether the selection is empty (cursor only, no text selected).

OpenDocument #

3 required of 6
id string

File or document ID.

name string

Display name (file name).

writingMode ? WritingMode

Writing mode if set.

color ? string

Color tag.

customIcon ? string

Custom emoji icon.

isActive boolean

Whether this document is the currently active/focused one.

Debug / Console types

ConsoleEntry #

4 required of 4
level 'log' | 'warn' | 'error' | 'info'
args string[]
source string

Source identifier: 'app' for host logs, or a plugin ID for plugin logs.

timestamp number

ProseMirror JSON type

ProseMirrorNode #

1 required of 5

A ProseMirror/TipTap document JSON structure. The top-level node has type: "doc" with an array of child nodes. Each node has a type (e.g. "paragraph", "heading"), optional content, optional attrs, and text nodes have a text string with optional marks.

type string
content ? ProseMirrorNode []
text ? string
marks ? { type: string; attrs?: Record<string, any> }[]
attrs ? Record<string, any>

ProseMirrorDocument #

2 required of 2
type 'doc'

Format Conversion API

NetFetchOptions #

0 required of 4
method ? 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD'

HTTP method. Defaults to 'GET'. Allowed: GET, POST, PUT, PATCH, DELETE, HEAD.

headers ? Record<string, string>

Request headers.

body ? string

Request body (already serialized as a string) for non-GET/HEAD methods.

responseType ? 'text' | 'json' | 'base64'

How to decode the response body. Defaults to 'text'. Use 'base64' to fetch binary (e.g. an image): the host proxies the request and returns the bytes base64-encoded, so you can render it as a data: URI without relaxing the plugin CSP.

NetFetchResponse #

5 required of 5
ok boolean
status number
statusText string
headers Record<string, string>
body any

Decoded body: a string for 'text', a parsed value for 'json', a base64 string for 'base64'.

MediaNowPlaying #

0 required of 2
title ? string
videoId ? string

Global declarations

ProseSearchOptions #

0 required of 3

Options for project.searchProse(). They exist so a search cannot read the whole manuscript.

maxChapters ? number

Maximum chapters to read. Defaults to 250.

maxExcerptsPerChapter ? number

Maximum excerpts returned per chapter. Defaults to 3.

chapterIds ? string[]

Restrict the search to these chapters. Omitted, it searches all of them.

ProseSearchHit #

5 required of 5

A chapter where the searched term occurs, with excerpts of the prose around the matches.

chapterId string
title string
order number

Position of the chapter in the manuscript.

count number

Whole-word occurrences across the whole chapter.

excerpts string[]

Where these come from

74 types, of which 58 appear directly in a method signature; the rest are reached through another type. Extracted from the published definitions alongside the 169 methods that use them, so a type renamed in Tintero is renamed here on the next sync rather than lingering as a shape nobody returns any more.