Tintero Developers

Data types

Every type the plugin SDK hands you or takes back: 136 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.

Known divergences

Found automatically, not hand-picked: places where the published type says one thing and you actually receive another. Your compiler believes the left column. What arrives is the right one. This section empties itself once the source is fixed.

CharacterCraft.arc
The .d.ts declares
{ beats, description, fileId, lie, need, title, want, wound }
You actually receive
{ beats, lie, need, want, wound }

The host passes through CharacterModel.arc unchanged.

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 9
characterId string
type string
description ? string
isBidirectional ? boolean
inverseType ? string
kind ? string

Stable key of the tie ('parent', 'union', 'friend', 'custom'…). Takes precedence over type.

pairId ? string

Shared by the two mirror rows of a two-way tie.

label ? string

A label the writer typed to replace the one that comes from kind.

facts ? Record<string, string>

Facts of the tie, the same on both mirror rows: lineage, sibling, union, knowledge, since, until.

RelationshipInput #

2 required of 9

A tie to create or change with project.setCharacterRelationship. What you leave out stays; an empty string clears label or description, and an empty fact clears that fact.

otherCharacterId string

The character on the other end.

kind string

What the OTHER character is to this one: 'parent' means the other is this one's parent.

pairId ? string

The tie to change, from relationships[].pairId. Without it, the tie with the same other and kind is changed, or a new one is made.

customType ? string

For kind 'custom': what the other is to this one, in the writer's words.

customInverseType ? string

For kind 'custom': what this one is to the other.

label ? string
description ? string
isBidirectional ? boolean

Default true: the other character gets the mirror row with the inverse kind.

facts ? Record<string, string>

lineage, sibling and union only where the kind takes them; knowledge, since and until anywhere.

RelationshipResult #

4 required of 4
characterId string
relationship Relationship
created boolean
mirrored boolean

Whether the other character now holds the mirror row.

CharacterVariantInput #

0 required of 3

Fields of a variant. overrides holds the character fields the variant changes; on update they are merged and null removes one.

name ? string
description ? string
overrides ? Record<string, unknown>

CharacterConflict #

2 required of 8

One conflict of a character. kind: 'inner', 'character', 'society', 'nature', 'supernatural', 'technology' or 'fate'.

id string
kind ? string
summary string
opponentCharacterId ? string
opponentElementId ? string
origin ? string
stakes ? string
resolvedInBeatId ? string

A beat of this character's arc where it gets resolved.

One field of this type does not match what you receive.

CharacterCraft #

8 required of 13

The craft fields of a character sheet. role and archetype are KEYS ('protagonist'…, 'hero'…). personalityAxes[].value goes from -100 to 100; a custom axis carries its own pole labels. Arc beats point at chapters by fileId; imageIds are images of the project attached to the sheet.

characterId string
role ? string
archetype ? string
motivation ? string
voice ? string
sexualOrientation ? string
catchphrases string[]
personalityTraits string[]
conflicts CharacterConflict []
stats { name: string; value: number; max?: number }[]
personalityAxes { systemId: string; axisId: string; value: number; negativeLabel?: string; positiveLabel?: string; negativeEmoji?: string; positiveEmoji?: string }[]
arc { want?: string; need?: string; lie?: string; wound?: string; beats: { id: string; title: string; description?: string; fileId?: string }[] }
imageIds string[]

CharacterCraftChanges #

Changes to the craft fields: what is absent stays, null clears; lists (and arc.beats) are sent whole.

Partial<{ [K in Exclude<keyof CharacterCraft, 'characterId' | 'arc'>]: CharacterCraft[K] | null }> & { arc?: Partial<CharacterCraft['arc']> | null }

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 15
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 }[]
customFields ? Record<string, any>

Values of the template and genre fields, by field id (builtin:<id> for the genre ones).

imageIds ? string[]

Images of the project attached to the sheet.

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 15
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
kind ? DocKind

What it is by its CONTENT: practiceTest if it holds a top-level practice test block, otherwise document.

DocKind #

What a document is by its content.

'practiceTest' | 'document'

DocListOptions #

0 required of 1

Filter for project.getDocs: without kind, every document.

kind ? DocKind

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 7

A grouping of chapters (file) and documents (doc) that cuts across the folder tree. An entry can be in several collections and never moves in the tree.

id string
name string
items { id: string; type: string }[]

Its members, in the order the writer arranged them. In a smart collection the members come from smartFilters instead.

color ? string

Theme color as #rrggbb; absent for the default accent.

icon ? string

An emoji shown instead of the bookmark; absent for the default.

description ? string

What the writer wants to remember about the collection.

smartFilters ? CollectionSmartFilter []

The saved advanced search that makes this a SMART collection; absent if the members are picked by hand.

CollectionSmartFilter #

5 required of 6

One condition of a smart collection's saved search.

id string
type string

keyword, character, status, date, color, scene, worldbuilding, collection, customMetadata or content.

operator string
value string | string[] | number | { start: number; end: number } | null
field ? string
logic 'AND' | 'OR'

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.

WritingGoalInput #

2 required of 4

A new writing goal. cadence defaults to the first one that makes sense for type.

type 'words' | 'chapters' | 'chaptersCreated' | 'characters' | 'worldbuilding' | 'streak' | 'minutes'
cadence ? 'daily' | 'weekly' | 'monthly' | 'total'
target number

Greater than 0.

title ? string

WritingGoalChanges #

0 required of 2

Changes to a writing goal. What you leave out stays; an empty or null title removes it.

target ? number
title ? string | null

MediaKind #

'audio' | 'pdf'

MediaAsset #

6 required of 15

Metadata of an audio file or a PDF of the project. Never its bytes.

id string
title string
fileName string
size number
mimeType string
createdAt ? number

Epoch ms.

treePath ? string

Its place in the file tree; absent when it sits in the fixed Audio or PDFs folder.

durationMs ? number

Audio only: length, language, voice, origin ('native' | 'api' | 'import'), source doc and clips of a pack.

lang ? string
voice ? string
origin ? string
sourceDocId ? string
clipCount ? number
pageCount ? number

PDF only: page count, once the PDF has been opened.

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 14
id string
name string
label string
type string

"text" | "textarea" | "number" | "date" | "checkbox" | "select" | "multiselect" | "relationship"

placeholder ? string
description ? string
defaultValue ? any
order ? number
options ? string[]

The choices of a "select" or "multiselect", in the order shown.

optionLabels ? Record<string, string>

The text the writer sees for each choice, by choice id, in the app language. Only the genre fields (builtin:*) have it: their options are ids (what is stored), not text.

validation ? { required?: boolean; minLength?: number; maxLength?: number; pattern?: string }

Rules the value is checked against: required, minLength, maxLength, pattern.

relationshipConfig ? { allowedTypes: string[]; multiple?: boolean }

For a "relationship": the kinds it may point at ("character", a built-in type or a template id) and whether it takes many.

visibleWhen ? { fieldId: string; values: string[] }

Shown only while the field fieldId holds one of values (empty: any value). Absent: always shown.

section ? string

The tab of the element's card the field goes in, by name. Absent: the first tab.

SettingGenre #

2 required of 3

A setting genre (cyberpunk, space opera…) the writer can pick for the project; label is in the app language.

id string
label string
parentId ? string

The family it belongs to (science-fiction for cyberpunk). Absent: it is a family.

SettingGenres #

2 required of 2

The setting genres of the open project and every genre that can be picked.

selected string[]

Ids of the picked genres. Empty: none picked, and the project shows everything.

available SettingGenre []

SetSettingGenresResult #

2 required of 2

What setSettingGenres did: applied is the list now saved, unknown the ids it refused.

applied string[]
unknown string[]

CustomWorldbuildingTemplate #

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

The built-in kind (location, deity…) this template adds fields to, instead of being a kind of its own.

CustomFieldInput #

2 required of 12

A field as createWorldbuildingTemplate/updateWorldbuildingTemplate take it. Pass the id of a saved field to keep it (and its data): only what you send changes. A new field may bring its own id so another one can name it in visibleWhen; without one it gets a fresh id.

id ? string
label string
type 'text' | 'textarea' | 'number' | 'date' | 'checkbox' | 'select' | 'multiselect' | 'relationship'
name ? string
placeholder ? string
description ? string
defaultValue ? any
options ? string[]

Required for "select" and "multiselect".

validation ? { required?: boolean; minLength?: number; maxLength?: number; pattern?: string }
relationshipConfig ? { allowedTypes: string[]; multiple?: boolean }

Required for "relationship": built-in types, "character" or template ids.

visibleWhen ? { fieldId: string; values: string[] }

An empty fieldId removes the condition.

section ? string

WorldbuildingTemplateInput #

0 required of 5

A new kind of worldbuilding element, or (extendsType) extra fields for a built-in kind.

name ? string

Required unless extendsType is given; two letters at least, not taken by another template.

description ? string
color ? string

A CSS colour.

extendsType ? string
fields ? CustomFieldInput []

WorldbuildingTemplateChanges #

0 required of 6

What to change in a template. fields is the WHOLE new list, in order.

name ? string
description ? string
color ? string
fields ? CustomFieldInput []
allowDataLoss ? boolean

Without it, removing or retyping a field that holds data is refused.

archived ? boolean

Archive (hidden from "new element", its elements keep their labels) or bring back.

TemplateDeletion #

3 required of 3
templateId string
deleted true
elementsLeft number

Elements of that kind that remain, now without their template.

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

TimelineBlockUpdate #

0 required of 6

Fields of a timeline block that structure.updateTimelineBlock can change.

laneId ? string
startCol ? number
spanCols ? number
color ? string
characterId ? string
worldbuildingId ? string

FlowMapNodeUpdate #

0 required of 10

Fields of a flow map node that structure.updateFlowMapNode can change.

label ? string
x ? number
y ? number
type ? 'circle' | 'square' | 'rounded' | 'document' | 'todo-list' | 'simple-list' | 'diamond'
color ? string
title ? string
extendedText ? string
linkedDocument ? string
linkedCharacterId ? string
linkedWorldbuildingId ? string

FlowMapConnectionUpdate #

0 required of 5

Fields of a flow map arrow that structure.updateFlowMapConnection can change.

label ? string
arrowType ? 'simple' | 'bidirectional' | 'unidirectional-forward' | 'unidirectional-backward' | 'dotted'
color ? string
fromNodeId ? string
toNodeId ? 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 7
name string
type string
description ? string
tags ? string[]
color ? string
notes ? string
customFields ? Record<string, any>

Values of the template and genre fields, by field id (builtin:<id> for the genre ones). On an update they are added to the stored ones, and null removes a field's value.

NoteInput #

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

FileInput #

1 required of 10
name string

File name (required).

parentId ? string

Id of the folder to put it in (from getFolders()). Preferred over treePath; absent, the root.

treePath ? string

FULL tree path of the new file, its own name included (e.g. "Unit 1/Chapter 1"). The parent must exist or the call throws. A "/" inside the name is stored as "∕" in the path; the name keeps it.

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 11
name ? string
title ? string
color ? string
customIcon ? string
keywords ? string[]
customMetadata ? Record<string, string>
writingMode ? WritingMode
status ? string
order ? number
treePath ? string

FULL new tree path, its own name included; moves the file and everything under it.

parentId ? string | null

Moves the file into this folder (null: the root). Wins over treePath.

DocInput #

1 required of 9
name string

Document name (required).

parentId ? string

Id of the folder, chapter or document to put it in. Preferred over treePath; absent, the root.

treePath ? string

FULL tree path of the new document, its own name included. Same rules as FileInput.treePath.

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 9
name ? string
title ? string
color ? string
customIcon ? string
keywords ? string[]
customMetadata ? Record<string, string>
writingMode ? WritingMode
treePath ? string

FULL new tree path, its own name included; moves the document and everything under it.

parentId ? string | null

Moves the document under this folder, chapter or document (null: the root). Wins over treePath.

FolderInfo #

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

FolderInput #

1 required of 4
name string

Folder name (required). A "/" in it is kept in the name and stored as "∕" in its path.

parentId ? string | null

Id of the folder to create it in; absent or null, the root. Only folders can hold folders.

color ? string
customIcon ? string

TreeItemKind #

What the tree can move by id: a chapter (file), a document (doc), a folder, an image, an audio or a PDF.

'file' | 'doc' | 'folder' | 'image' | 'audio' | 'pdf'

MoveItemInput #

3 required of 3
id string
parentId string | null

Folder, chapter or document to move it under; null for the root.

MoveItemResult #

3 required of 3
id string
treePath string

The tree path the item was saved with.

DeleteItemsInput #

1 required of 1
ids string[]

Ids to delete. Each one takes everything under it with it.

FolderUpdate #

1 required of 4

Changes to a folder. What is left out stays as it was.

id string
name ? string

New name; a "/" in it is kept in the name and stored as "∕" in its path.

color ? string
customIcon ? string

SceneMove #

0 required of 2

Where a scene goes: another chapter, a slot among its chapter's scenes, or both (chapter first).

toFileId ? string
position ? number

0 is the first scene of the chapter.

SceneMoveResult #

2 required of 3
sceneId string
fileId ? string

The chapter that owns the scene now.

moved boolean

BackupUpdate #

0 required of 2
label ? string
observations ? string

ChapterBookSettings #

0 required of 2

How a chapter sits in the book. What is left out stays as it was.

bookRole ? string | null

A book role (prologue, epilogue, part, appendix…); null makes it an ordinary chapter.

inReadingOrder ? boolean

True puts it at the end of the reading order; false takes it out (it is not deleted).

ChapterBookResult #

4 required of 4
fileId string
bookRole string | null
inReadingOrder boolean
order number | null

Its place in the reading order, or null when it is out of it.

DuplicatedFile #

3 required of 3

The copy made by duplicateFile: a sibling of the original, with its text.

id string
title string
treePath string

ProjectInfoUpdate #

0 required of 3

Changes to the project card. What is left out stays as it was.

name ? string
description ? string | null

Empty or null removes it.

coverImageId ? string | null

Id of an image of the project; null removes the cover.

ProjectInfo #

3 required of 3
name string
description string | null
coverImageId string | null

BookmarkAnchor #

1 required of 3

In a chapter, right before the occurrence-th beforeText (1 by default), or at its start without it.

fileId string
beforeText ? string
occurrence ? number

BookmarkInput #

0 required of 2
label ? string
number ? number | null

Quick access slot, 0 to 9. A bookmark that held it loses it.

BookmarkUpdate #

0 required of 3
label ? string

Empty removes it.

number ? number | null

Quick access slot, 0 to 9, or null to free it.

Moves the anchor out of the text it was in and into this place.

Bookmark #

3 required of 6
id string
fileId string
fileTitle ? string
label ? string
number ? number
unresolved boolean

True when its anchor was not found in the chapter text the last time it was saved.

BackupFileRestoreResult #

3 required of 3
backupId string
id string
kind 'file' | 'doc'

CardboardNoteChanges #

0 required of 4
title ? string
content ? string
color ? string
checked ? boolean

DeleteItemsResult #

3 required of 3
deleted string[]

Every id that is gone, descendants included. A child its parent already took is here, not in notFound.

notFound string[]
refused { id: string; reason: string }[]

Ids left untouched, and why (e.g. the document of a character sheet, or an id of the other kind).

PracticeTestQuestionInput #

3 required of 5

One multiple-choice question, as written by the caller (same shape as the ```practice-test Markdown block).

question string
options string[]

Exactly 4 distinct options, up to 160 characters each, without "A)" prefixes.

answer string

Letter of the correct option ("A".."D") or its exact text. Numbers are refused (ambiguous).

explanation ? string
quote ? string

Literal passage of the source chapter. If it is not there, it is emptied and the question stays.

PracticeTestInput #

2 required of 6
name string
sourceFileId ? string | null

Chapter or document the test comes from: quotes are checked against its whole text.

parentId ? string | null

Folder, chapter or document to create it in; absent or null, the root.

title ? string

Title shown on the test; defaults to name.

At least 3 valid questions, or nothing is saved.

shuffle ? boolean

Shuffle the options when saving. Default true.

PracticeTestUpdate #

2 required of 5
docId string

A document that already is a practice test.

title ? string
sourceFileId ? string | null

Defaults to the current source.

shuffle ? boolean

PracticeTestResult #

6 required of 6
id string
name string
treePath string
kept number
dropped { index: number; reason: string }[]

Questions not accepted: their position in questions (from 0) and why.

quotesCleared number[]

Positions (from 0) of the questions whose quote was emptied because it is not in the source.

FlowMapTarget #

0 required of 2

The chapter (fileId) or document (docId) to put a flow map in. Give one of them.

fileId ? string
docId ? 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

Annotations

Annotation #

3 required of 6

A remark on the author's prose, anchored to a LITERAL quote of the text (not to positions): the same contract as the AI pass of teacher mode, shown in the same annotations panel.

quote string

The passage, copied verbatim (punctuation and accents included). A few words to one sentence.

occurrence ? number

Which appearance of quote, counting from 1. Default 1.

type 'error' | 'note' | 'praise'

error: does not work; note: observation or suggestion; praise: keep doing it.

vice ? string

Two or three word label for the pattern.

comment string

One or two sentences to the author saying why.

replacement ? string

Optional text to put in place of quote, for a mechanical fix (spelling, grammar); empty deletes it. The author applies it with one click and undoes it with Ctrl+Z: nothing applies it on its own. Ignored if equal to quote or longer than 1000 chars.

AnnotationGeneral #

0 required of 5

The overall reading of the text: what does not hang from any quote.

score ? number | null

Rating from 0 to 10. An impression, not a measure: never compare chapters with it.

generalEvaluation ? string
whatWorks ? string[]
whatFails ? string[]
priority ? string

AnnotationPassInput #

0 required of 4
annotations ? Annotation []
general ? AnnotationGeneral | null
author ? string

Name the pass is signed with in the panel. Defaults to your plugin id. Max 40 chars.

layer ? string

Name of the LAYER you write to, max 40 chars. You only ever write to your own layers: the same name replaces that layer, a new name creates another one. Defaults to your plugin id.

AnnotationLayerOrigin #

2 required of 2

Who launched a layer. Set by Tintero, never by the writer.

kind 'teacher' | 'plugin' | 'mcp' | 'producer'
id string

AnnotationLayerInfo #

7 required of 7

One annotation layer of a document, as listLayers returns it.

id string

Layer id, derived from origin + name. Pass it to get to read a layer that is not yours.

name string
createdAt number
annotations number

How many annotations it has.

hasGeneral boolean
own boolean

Whether it is yours (so you can write it).

ReadAnnotation #

3 required of 3
replacement string | null

The suggested replacement, or null when there is none.

number number | null

Its number in the panel; null when not anchored or unknown.

anchored boolean | null

Whether the quote was found in the text. null: the document is not open, so unknown.

AnnotationPass #

6 required of 6
documentId string
open boolean

Whether the document is open in an editor. Closed, the pass is read from local storage.

layer { id: string; name: string; origin: AnnotationLayerOrigin }

The layer that was read.

lens { kind: 'preset' | 'lesson' | 'agent'; id: string } | null

preset/lesson: the author asked Tintero's AI. agent: a plugin or MCP agent wrote it (id = signature).

annotations ReadAnnotation []
general Required< AnnotationGeneral > | null

AnnotationWriteResult #

8 required of 8
documentId string
layer string

Id of the layer written.

open boolean
total number

Annotations the layer has now.

anchored number | null

How many found their quote. null when the document is closed (they anchor when it opens).

unanchored Annotation [] | null

The ones whose quote was not found: fix the quote and add them again. null when closed.

rejected number

Dropped for lacking a quote or a comment.

trimmed number

Dropped for going over the cap of 24 annotations per pass.

Source #

6 required of 21

A bibliographic source of the project: what the author cites. kind decides how it is formatted.

id string
kind 'book' | 'chapter' | 'article' | 'web' | 'thesis' | 'interview' | 'archive' | 'audiovisual' | 'other'
title string
authors { family: string; given?: string; role?: 'editor' | 'translator' }[]

An institution goes whole in family, with no given. No role means author.

year ? string

Free text: "2019", "n.d.", "2019a".

containerTitle ? string

The journal, the book that holds the chapter, or the website.

publisher ? string
place ? string
volume ? string
issue ? string
pages ? string
edition ? string
url ? string
doi ? string
isbn ? string
accessedAt ? string

When a web page was consulted, ISO YYYY-MM-DD.

notes ? string
provider ? string

The plugin id that brought it, set by Tintero. Present only together with externalId.

externalId ? string

Its id in the provider (a Zotero item key). Importing the same one again updates it.

createdAt number
lastModified number

SourceInput #

What addSource takes. externalId makes it yours as a provider: adding it again updates it.

Omit<Source, 'id' | 'createdAt' | 'lastModified' | 'provider' | 'authors'> & { authors?: Source['authors']; }

Citation #

2 required of 3

A citation in the manuscript, in document order.

fileId string

The chapter it is in.

sourceId string
locator ? string

"p. 23", "ch. 4". Absent when the citation has none.

CitationSearchResult #

2 required of 4

One hit of your provider's search: just enough for the author to choose.

id string

Its id in your provider; getItems receives these.

title string
authors ? string

Authors already written for a list ("Martín and García").

year ? string

CitationProvider #

1 required of 1

A source provider (Zotero and the like). Tintero shows a "Search in <name>" button in the Sources panel; the author searches, picks, and Tintero stores what getItems returns. Your functions run in your iframe, so register again in onActivate: the button goes away while your plugin is off.

name string

Shown on the button. Max 40 chars.

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 4

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.

in ? 'chapters' | 'docs' | 'all'

Where to search: the chapters (default), the documents, or both.

ProseSearchHit #

4 required of 7

A chapter (or document) where the searched term occurs, with excerpts and positions.

chapterId ? string

The chapter. Absent on document hits.

docId ? string

The document, only when the search included documents.

title string
order number

Position of the chapter in the manuscript.

count number

Whole-word occurrences across the whole chapter.

excerpts string[]
occurrences ? TinteroSDK.TextOccurrence[]

Where each occurrence is (the first 20).

Where these come from

136 types, of which 108 appear directly in a method signature; the rest are reached through another type. Extracted from the published definitions alongside the 253 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.