Tintero Developers

API reference

All 169 methods the plugin SDK exposes, with the permission each one requires.

On this page

Read out of tintero-plugin-sdk.build.ts, the SDK that Tintero puts inside your plugin's frame. The shapes and descriptions come from the published type definitions. The permission each one needs comes from methodScopeMap, which is the table Tintero itself checks on every call.

tintero.project

tintero.project.addCharacter() #

Create a new character. Requires at least name.

addCharacter(data: CharacterInput) → Promise<Character>

tintero.project.addDoc() #

Create a new document in the project. Returns the created doc metadata.

addDoc(data: DocInput) → Promise<DocMetadata>

tintero.project.addFile() #

Create a new file in the project. Returns the created file metadata.

addFile(data: FileInput) → Promise<FileMetadata>

tintero.project.addImage() #

Save an image (a base64 string or a data: URI) into the project and return a reference to the saved image. Assign it to a character/worldbuilding portrait or landscape. Requires the project.write.images scope. Pairs with net.fetch({ responseType: 'base64' }) to import a remote image.

addImage(data: string, fileName?: string) → Promise<string>

tintero.project.addNote() #

Create a new note. Requires location.

addNote(data: NoteInput) → Promise<Note>

tintero.project.addWorldbuildingElement() #

Create a new worldbuilding element. Requires name and type.

addWorldbuildingElement(data: WorldbuildingInput) → Promise<WorldbuildingElement>

tintero.project.createFlowMap() #

Create an empty flow map. Requires project.write.flowmaps.

createFlowMap(name: string) → Promise<FlowMap>

tintero.project.deleteFlowMap() #

Delete a flow map. Requires project.write.flowmaps.

deleteFlowMap(flowMapId: string) → Promise<boolean>

tintero.project.getCardboards() #

Get all cardboard grids with their cells.

getCardboards() → Promise<CardboardGrid[]>

tintero.project.getCharacterById() #

Get a character by ID.

getCharacterById(id: string) → Promise<Character | null>

tintero.project.getCharacters() #

Get all characters.

getCharacters() → Promise<Character[]>

tintero.project.getCollections() #

Get all collections.

getCollections() → Promise<Collection[]>

tintero.project.getCustomWorldbuildingTemplates() #

Get the project's custom worldbuilding templates. Read-only.

getCustomWorldbuildingTemplates() → Promise<CustomWorldbuildingTemplate[]>

tintero.project.getDocContent() #

Get the raw content of a document by its ID. Returns a ProseMirror/TipTap JSON string, or null. Same format as getFileContent().

getDocContent(docId: string) → Promise<string | null>

tintero.project.getDocs() #

Get all documents (metadata only).

getDocs() → Promise<DocMetadata[]>

tintero.project.getFileContent() #

Get the raw content of a file by its ID. Returns the file content as a ProseMirror/TipTap JSON string (the internal document format), or null if the file does not exist or has no content. You must JSON.parse() the result to obtain a ProseMirrorDocument object, or pass the raw string directly to tintero.convert.toHtml() / toMarkdown() / toText(). Those methods accept both the raw string and a parsed object.

getFileContent(fileId: string) → Promise<string | null>

tintero.project.getFileSnapshots() #

Get the version snapshots of a file by its ID. Read-only.

getFileSnapshots(fileId: string) → Promise<FileSnapshot[]>

tintero.project.getFiles() #

Get all project files (metadata only, no content).

getFiles() → Promise<FileMetadata[]>

tintero.project.getFlowMapById() #

Get one flow map by its ID, or null if it does not exist. Requires project.read.flowmaps.

getFlowMapById(flowMapId: string) → Promise<FlowMap | null>

tintero.project.getFlowMaps() #

Get all flow maps (nodes and connections). Requires project.read.flowmaps.

getFlowMaps() → Promise<FlowMap[]>

tintero.project.getFolders() #

Get the project's folder tree structure.

getFolders() → Promise<FolderInfo[]>

tintero.project.getImageData() #

Get a project image as a base64 data URL. Accepts the image fileName or relativePath (e.g. "portrait.png" or "images/portrait.png"). Returns a string like "data:image/png;base64,..." or null if not found. Use this to display project images inside plugin iframes.

getImageData(imageRef: string) → Promise<string | null>

tintero.project.getImages() #

Get all images metadata.

getImages() → Promise<ImageInfo[]>

tintero.project.getMetadata() #

Get project metadata (name, dates, description).

getMetadata() → Promise<ProjectMetadata>

tintero.project.getNotes() #

Get all notes.

getNotes() → Promise<Note[]>

tintero.project.getPlotGrids() #

Get all plot grids with their columns and cells.

getPlotGrids() → Promise<PlotGrid[]>

tintero.project.getScenes() #

Get the scenes defined within a file by its ID. Read-only.

getScenes(fileId: string) → Promise<Scene[]>

tintero.project.getTags() #

Get all project tags.

getTags() → Promise<string[]>

tintero.project.getTimelines() #

Get all timelines (lanes, blocks, notes, milestones). Read-only.

getTimelines() → Promise<Timeline[]>

tintero.project.getWordCountLog() #

Get the per-day word count log. Read-only.

getWordCountLog() → Promise<WordCountLog[]>

tintero.project.getWorldbuilding() #

Get all worldbuilding elements.

getWorldbuilding() → Promise<WorldbuildingElement[]>

tintero.project.getWorldbuildingByType() #

Get worldbuilding elements by type (e.g. "location", "faction").

getWorldbuildingByType(type: string) → Promise<WorldbuildingElement[]>

tintero.project.getWritingGoals() #

Get the user's writing goals (words/chapters/minutes targets). Read-only.

getWritingGoals() → Promise<WritingGoal[]>

tintero.project.getWritingMinutesLog() #

Get the per-day writing-minutes log. Read-only.

getWritingMinutesLog() → Promise<WritingMinutesLog[]>

tintero.project.removeWorldbuildingElement() #

Delete a worldbuilding element by ID.

removeWorldbuildingElement(id: string) → Promise<void>

tintero.project.renameFlowMap() #

Rename a flow map. Requires project.write.flowmaps.

renameFlowMap(flowMapId: string, name: string) → Promise<FlowMap>

tintero.project.searchProse() #

Search the chapter PROSE (not the metadata) for a term, matching whole words and ignoring accents. Returns the chapters where it occurs, how many times, and a few excerpts around the matches. Use it to answer "where/how does X appear" when the metadata is not enough. Bounded on purpose: maxChapters (250 by default) keeps a large manuscript from being read end to end on every call. Pass several forms of the same name (full name, first name) as an array to match any of them in one pass.

searchProse(term: string | string[], options?: ProseSearchOptions) → Promise<ProseSearchHit[]>

tintero.project.updateCharacter() #

Update an existing character's fields. Only provided fields are changed.

updateCharacter(id: string, data: Partial<CharacterInput>) → Promise<void>

tintero.project.updateDocContent() #

Update the content of a document. Same format as updateFileContent().

updateDocContent(docId: string, jsonContent: string) → Promise<void>

tintero.project.updateDocMeta() #

Update document metadata (not content). Only provided fields are changed.

updateDocMeta(id: string, data: DocMetaUpdate) → Promise<void>

tintero.project.updateFileContent() #

Update the content of a file. jsonContent must be a ProseMirror/TipTap JSON string, i.e. the result of JSON.stringify(proseMirrorDocumentObject). To build a document from other formats, use tintero.convert.fromHtml(), fromMarkdown(), or fromText() first, then JSON.stringify() the returned object before passing it here.

updateFileContent(fileId: string, jsonContent: string) → Promise<void>

tintero.project.updateFileMeta() #

Update file metadata (not content). Only provided fields are changed.

updateFileMeta(id: string, data: FileMetaUpdate) → Promise<void>

tintero.project.updateFlowMap() #

Replace a flow map's nodes and connections. The payload is validated in full BEFORE anything is written, so a malformed one leaves the project untouched: ids must be unique strings, every connection must point at a node in the same payload, coordinates must be finite numbers and colours must be plain CSS colours. Requires project.write.flowmaps.

updateFlowMap(flowMapId: string, update: FlowMapUpdate) → Promise<FlowMap>

tintero.project.updateTags() #

Replace all project tags.

updateTags(tags: string[]) → Promise<void>

tintero.project.updateWorldbuildingElement() #

Update an existing worldbuilding element.

updateWorldbuildingElement(id: string, data: Partial<WorldbuildingInput>) → Promise<void>

tintero.knowledge

Derived questions answered in prose: chapters and characters resolved by name.

tintero.knowledge.chaptersWithCharacter() #

The chapters a character appears in, according to the project metadata.

chaptersWithCharacter(character: string) → Promise<string>

tintero.knowledge.characterAppearanceCounts() #

Appearance counts per character, most frequent first. With an argument, that character's chapters.

characterAppearanceCounts(character?: string) → Promise<string>

tintero.knowledge.findChapter() #

Resolve a chapter by number ("chapter 7"), id, or a fragment of its title.

findChapter(reference: string) → Promise<string>

tintero.knowledge.getChapterSynopsis() #

The author-written synopsis of a chapter. Cheap: prefer it over the full prose.

getChapterSynopsis(chapter: string) → Promise<string>

tintero.knowledge.getChapterText() #

The prose of a chapter resolved by reference, clipped to 20.000 characters.

getChapterText(chapter: string) → Promise<string>

tintero.knowledge.getCharacterProfile() #

The full profile of a character (traits, backstory, goals, fears) by id or name.

getCharacterProfile(character: string) → Promise<string>

tintero.knowledge.getCharacterRelationships() #

A character's relationships with other characters, with the names resolved.

getCharacterRelationships(character: string) → Promise<string>

tintero.knowledge.getDocument() #

The text of a non-chapter document (synopsis, world bible) by id, name or title fragment.

getDocument(document: string) → Promise<string>

tintero.knowledge.getWorldbuildingProfile() #

The full profile of a worldbuilding element by id or name.

getWorldbuildingProfile(element: string) → Promise<string>

tintero.knowledge.listChapters() #

Every chapter with its number, status, length, whether it has a summary, and its characters.

listChapters() → Promise<string>

tintero.knowledge.summarizeChapter() #

ai.summarize Medium

A summary of a chapter the author never summarised, generated on demand. Scopes: ai.summarize AND project.read.fileContent (the summary is derived from the prose). It calls the AI server configured in Tintero's settings, so it costs the user time and quota; returns the author's own summary when there is one, without calling any model.

summarizeChapter(chapter: string) → Promise<string>

tintero.structure

Writing the structure around the prose: timelines, flow maps, collections, scenes, notes.

tintero.structure.addFlowMapConnection() #

Joins two existing nodes with an arrow. Both node ids must exist or the call fails.

addFlowMapConnection(flowMapId: string, connection: FlowMapConnectionInput) → Promise<FlowMapConnection>

tintero.structure.addFlowMapNode() #

Adds a node to a flow map and returns it, with the id Tintero assigned.

addFlowMapNode(flowMapId: string, node: FlowMapNodeInput) → Promise<FlowMapNode>

tintero.structure.addTimelineBlock() #

Puts a chapter, a scene or a worldbuilding event on a lane. A document block needs fileId; an event block needs eventId. The id of the block is assigned by Tintero.

addTimelineBlock(timelineId: string, laneId: string, block: TimelineBlockInput) → Promise<TimelineBlock>

tintero.structure.addTimelineLane() #

Adds a lane (one strand of the story) and returns it.

addTimelineLane(timelineId: string, name: string) → Promise<TimelineLane>

tintero.structure.addTimelineMilestone() #

Adds a milestone across every lane (a turning point, a climax).

addTimelineMilestone(timelineId: string, milestone: { text: string; position: number; color?: string }) → Promise<TimelineMilestone>

tintero.structure.addTimelineSegment() #

Names a stretch of the axis: an act, a part, a season.

addTimelineSegment(timelineId: string, segment: { name: string; startCol: number; spanCols: number; color?: string }) → Promise<TimelineSegment>

tintero.structure.addToCollection() #

Puts a chapter (file) or a document (doc) into a collection.

addToCollection(collectionId: string, itemId: string, itemType: 'file' | 'doc') → Promise<void>

tintero.structure.createCollection() #

Creates a note collection and returns it.

createCollection(name: string) → Promise<Collection>

tintero.structure.createFlowMap() #

Creates a flow map and returns it.

createFlowMap(name: string) → Promise<FlowMap>

tintero.structure.createScene() #

Creates a scene inside a chapter. Unlike the editor's own dialog, it needs the chapter id.

createScene(fileId: string, scene: SceneInput) → Promise<Scene>

tintero.structure.createTimeline() #

Creates a timeline and returns it. parentId hangs it off a block of another timeline.

createTimeline(name: string, parentId?: string) → Promise<Timeline>

tintero.structure.deleteCollection() #

Deletes a collection. The chapters and documents in it are not deleted.

deleteCollection(collectionId: string) → Promise<void>

tintero.structure.deleteFlowMap() #

Deletes a flow map with its nodes and arrows.

deleteFlowMap(flowMapId: string) → Promise<void>

tintero.structure.deleteNote() #

Deletes a note and its body.

deleteNote(noteId: string) → Promise<void>

tintero.structure.deleteScene() #

Deletes a scene from the chapter that owns it.

deleteScene(sceneId: string) → Promise<void>

tintero.structure.deleteTimeline() #

Deletes a timeline and everything on it.

deleteTimeline(timelineId: string) → Promise<void>

tintero.structure.removeFlowMapConnection() #

Removes an arrow.

removeFlowMapConnection(flowMapId: string, connectionId: string) → Promise<void>

tintero.structure.removeFlowMapNode() #

Removes a node. Arrows that pointed at it are left dangling, so remove them too.

removeFlowMapNode(flowMapId: string, nodeId: string) → Promise<void>

tintero.structure.removeFromCollection() #

Takes an item out of a collection.

removeFromCollection(collectionId: string, itemId: string, itemType: 'file' | 'doc') → Promise<void>

tintero.structure.removeTimelineBlock() #

Removes a block from a lane.

removeTimelineBlock(timelineId: string, laneId: string, blockId: string) → Promise<void>

tintero.structure.renameCollection() #

Renames a collection.

renameCollection(collectionId: string, name: string) → Promise<void>

tintero.structure.renameFlowMap() #

Renames a flow map.

renameFlowMap(flowMapId: string, name: string) → Promise<void>

tintero.structure.setTimelineAxis() #

Sets how the axis is labelled. These are labels, never real dates. Pass null to unset it.

setTimelineAxis(timelineId: string, axis: { unit?: string; start: number; step: number } | null) → Promise<void>

tintero.structure.updateNote() #

Rewrites a note's body and colour. The body hash is resealed, which is what sync compares.

updateNote(noteId: string, data: { content: string; type?: string }) → Promise<void>

tintero.structure.updateScene() #

Edits a scene. Only the fields you pass change.

updateScene(sceneId: string, updates: Partial<SceneInput>) → Promise<Scene | null>

tintero.boards

Writing the boards: the cardboard and the plot grids.

tintero.boards.addCardboardColumn() #

Adds an empty column at the right.

addCardboardColumn(gridId: string) → Promise<void>

tintero.boards.addCardboardNote() #

Adds a sticky note or a checkbox to a card. Image, audio and pdf notes need an asset and are not available here.

addCardboardNote(gridId: string, cellId: string, note: { kind: 'sticky' | 'checkbox'; title?: string; content?: string; color?: string; checked?: boolean }) → Promise<CardboardCell>

tintero.boards.addCardboardReference() #

Pins a chapter, doc, character or worldbuilding element to a card. The target must exist.

addCardboardReference(gridId: string, cellId: string, refType: 'chapter' | 'doc' | 'character' | 'worldbuilding', targetId: string) → Promise<CardboardCell>

tintero.boards.addCardboardRow() #

Adds an empty row at the bottom.

addCardboardRow(gridId: string) → Promise<void>

tintero.boards.addPlotGridColumn() #

Adds a plot column at the right and returns it.

addPlotGridColumn(gridId: string, name?: string) → Promise<PlotGridColumn>

tintero.boards.addPlotGridRow() #

Adds a row at the bottom.

addPlotGridRow(gridId: string) → Promise<void>

tintero.boards.addPlotGridRowNote() #

Adds a banner above a row (an act, a part). rowIndex equal to the row count puts it after the last row.

addPlotGridRowNote(gridId: string, rowIndex: number, note?: { content?: string; color?: string; height?: number }) → Promise<{ id: string; rowIndex: number; content: string; color?: string; height?: number }>

tintero.boards.clearPlotGridCell() #

Empties a cell.

clearPlotGridCell(gridId: string, cellId: string) → Promise<void>

tintero.boards.createCardboard() #

Creates a cardboard with empty cells and returns it. rows and cols default to 3.

createCardboard(name: string, rows?: number, cols?: number) → Promise<CardboardGrid>

tintero.boards.createPlotGrid() #

Creates a plot grid with the chapters column and two empty plot columns, three rows.

createPlotGrid(name: string) → Promise<PlotGrid>

tintero.boards.deleteCardboard() #

Deletes a cardboard with every card on it.

deleteCardboard(gridId: string) → Promise<void>

tintero.boards.deleteCardboardColumn() #

Deletes a column and its cards. The columns to the right move left.

deleteCardboardColumn(gridId: string, colIndex: number) → Promise<void>

tintero.boards.deleteCardboardNote() #

Removes a note from a card.

deleteCardboardNote(gridId: string, cellId: string, noteId: string) → Promise<CardboardCell>

tintero.boards.deleteCardboardRow() #

Deletes a row and its cards. The rows below move up. A cardboard keeps at least one row.

deleteCardboardRow(gridId: string, rowIndex: number) → Promise<void>

tintero.boards.deletePlotGrid() #

Deletes a plot grid with everything in it.

deletePlotGrid(gridId: string) → Promise<void>

tintero.boards.deletePlotGridColumn() #

Deletes a column and its cells. The chapters column (position 0) cannot be deleted.

deletePlotGridColumn(gridId: string, columnId: string) → Promise<void>

tintero.boards.deletePlotGridRow() #

Deletes a row and its cells. The rows below move up, and so do the banners anchored below it.

deletePlotGridRow(gridId: string, rowIndex: number) → Promise<void>

tintero.boards.deletePlotGridRowNote() #

Deletes a banner.

deletePlotGridRowNote(gridId: string, noteId: string) → Promise<void>

tintero.boards.movePlotGridColumn() #

Swaps a plot column with its neighbour. The chapters column stays where it is.

movePlotGridColumn(gridId: string, columnId: string, direction: 'left' | 'right') → Promise<boolean>

tintero.boards.movePlotGridRow() #

Swaps a row with the one above or below.

movePlotGridRow(gridId: string, rowIndex: number, direction: 'up' | 'down') → Promise<boolean>

tintero.boards.removeCardboardReference() #

Unpins a reference from a card. A card left empty goes back to unassigned.

removeCardboardReference(gridId: string, cellId: string, referenceId: string) → Promise<CardboardCell>

tintero.boards.renameCardboard() #

Renames a cardboard.

renameCardboard(gridId: string, name: string) → Promise<void>

tintero.boards.renamePlotGrid() #

Renames a plot grid.

renamePlotGrid(gridId: string, name: string) → Promise<void>

tintero.boards.renamePlotGridColumn() #

Renames a column.

renamePlotGridColumn(gridId: string, columnId: string, name: string) → Promise<void>

tintero.boards.setCardboardHeader() #

Labels a row or a column (an act, a character arc). An empty label removes the header.

setCardboardHeader(gridId: string, axis: 'row' | 'col', index: number, label: string, color?: string) → Promise<void>

tintero.boards.setPlotGridCell() #

Sets the cell of a column and a row, creating it if needed. A chapter cell only fits in the chapters column (position 0) and needs the chapter id in referenceId; a note cell fits anywhere else.

setPlotGridCell(gridId: string, columnId: string, rowIndex: number, cell: { type: 'unassigned' | 'chapter' | 'note'; referenceId?: string; content?: string; color?: string }) → Promise<PlotGridCell>

tintero.boards.updateCardboardCell() #

Changes the title, status, tags or color of a card. Other fields are ignored.

updateCardboardCell(gridId: string, cellId: string, patch: { title?: string; status?: string; tags?: string[]; color?: string }) → Promise<CardboardCell>

tintero.boards.updatePlotGridRowNote() #

Changes the text, color or height of a banner.

updatePlotGridRowNote(gridId: string, noteId: string, changes: { content?: string; color?: string; height?: number }) → Promise<void>

tintero.fs

tintero.fs.deleteProjectFile() #

fs.write High

Delete a file from the project directory (relative path).

deleteProjectFile(location: string) → Promise<void>

tintero.fs.getPlatform() #

Get the current platform as a compound string: "<os> | <runtime>". Examples: "darwin | Desktop", "win32 | Desktop", "linux | Desktop", "ios | Mobile", "android | Mobile", "unknown | Web".

getPlatform() → Promise<string>

tintero.fs.readProjectFile() #

fs.read Medium

Read a file from the project directory (relative path).

readProjectFile(location: string) → Promise<string | null>

tintero.fs.saveProject() #

fs.write High

Save the project metadata to disk.

saveProject() → Promise<void>

tintero.fs.writeProjectFile() #

fs.write High

Write a file to the project directory (relative path).

writeProjectFile(location: string, content: string) → Promise<void>

tintero.ui

tintero.ui.closeDialog() #

ui.dialog Medium

Close the plugin's open dialog.

closeDialog() → Promise<void>

tintero.ui.hideSidebar() #

ui.window Medium

Hide the application sidebar.

hideSidebar() → Promise<void>

tintero.ui.isFullscreen() #

ui.window Medium

Check if the application is currently in fullscreen mode.

isFullscreen() → Promise<boolean>

tintero.ui.openDialog() #

ui.dialog Medium

Open a modal dialog for this plugin.

openDialog(options?: DialogOptions) → Promise<void>

tintero.ui.render() #

ui.sidebar Medium

Render HTML into the active context. If a dialog is open for this plugin, renders into the dialog. Otherwise, renders into the sidebar panel's #plugin-root.

render(html: string) → Promise<void>

tintero.ui.showNotification() #

Show a toast notification.

showNotification(message: string, type?: NotificationType, durationMs?: number) → Promise<void>

tintero.ui.showSidebar() #

ui.window Medium

Show the application sidebar.

showSidebar() → Promise<void>

tintero.ui.toggleFullscreen() #

ui.window Medium

Toggle fullscreen mode (Desktop only).

toggleFullscreen() → Promise<void>

tintero.ui.toggleSidebar() #

ui.window Medium

Toggle the application sidebar visibility.

toggleSidebar() → Promise<void>

tintero.storage

tintero.storage.get() #

storage Low

Get a stored value by key. Returns null if not found.

get(key: string) → Promise<any | null>

tintero.storage.getAll() #

storage Low

Get all stored key-value pairs.

getAll() → Promise<Record<string, any>>

tintero.storage.remove() #

storage Low

Remove a stored key.

remove(key: string) → Promise<void>

tintero.storage.set() #

storage Low

Store a value. Values are JSON-serializable.

set(key: string, value: any) → Promise<void>

tintero.settings

tintero.settings.get() #

settings Low

Get all plugin settings (manifest defaults merged with stored overrides).

get() → Promise<Record<string, any>>

tintero.settings.getField() #

settings Low

Get a specific setting field value.

getField(key: string) → Promise<any | null>

tintero.app

tintero.app.getSettings() #

Get a sanitized copy of application settings (AI credentials excluded).

getSettings() → Promise<AppSettings>

tintero.app.getSettingsField() #

Get a specific setting field by dot path (e.g. "generalSettings.languageIsoCode").

getSettingsField(path: string) → Promise<any | null>

tintero.app.updateSettings() #

Modify application settings. Allowed sections: generalSettings, trophySettings, hideSettings, editorSettings, editorToolbarSettings. AI settings cannot be modified.

updateSettings(changes: Partial<Pick<AppSettings, 'generalSettings' | 'trophySettings' | 'hideSettings' | 'editorSettings' | 'editorToolbarSettings'>>) → Promise<void>

tintero.backup

tintero.backup.create() #

backup.create Medium

Create a backup. Returns the backup ID. Keep it to find the backup later. name becomes the user-visible label (empty or blank = no label); the entry's name is an internal folder id, so list().find(b => b.name === name) no longer finds it.

create(name?: string, observations?: string) → Promise<string>

tintero.backup.getById() #

backup.list Medium

Get a specific backup by ID.

getById(id: string) → Promise<BackupEntry | null>

tintero.backup.list() #

backup.list Medium

List all backups.

list() → Promise<BackupEntry[]>

tintero.backup.restore() #

Restore a backup. WARNING: This replaces the current project data.

restore(id: string) → Promise<void>

tintero.events

tintero.events.on() #

no permission

Subscribe to an event.

on(event: PluginEvent, callback: EventCallback) → void

tintero.events.off() #

no permission

Unsubscribe from an event.

off(event: PluginEvent, callback: EventCallback) → void

tintero.export

tintero.export.exportFile() #

export.file Medium

Trigger a file download to the user's device.

exportFile(fileName: string, content: string, mimeType?: string) → Promise<void>

tintero.export.registerBookExporter() #

Register this plugin as a book exporter (all files concatenated).

registerBookExporter(config: BookExporterConfig) → Promise<void>

tintero.export.registerExporter() #

export.file Medium

Register this plugin as a file exporter. The convert function is called when the user exports.

registerExporter(config: FileExporterConfig) → Promise<void>

tintero.export.registerProjectExporter() #

Register this plugin as a project exporter.

registerProjectExporter(config: ProjectExporterConfig) → Promise<void>

tintero.import

tintero.import.registerImporter() #

import.file Medium

Register this plugin as a file importer. The convert function receives raw file data.

registerImporter(config: FileImporterConfig) → Promise<void>

tintero.import.registerProjectImporter() #

Register this plugin as a project importer.

registerProjectImporter(config: ProjectImporterConfig) → Promise<void>

tintero.editor

Live editor state: active document, open tabs, text selection, and write operations.

tintero.editor.getActiveDocument() #

Get the currently active/focused document, or null if no editor is open.

getActiveDocument() → Promise<OpenDocument | null>

tintero.editor.getOpenDocuments() #

Get all documents currently open in editor tabs.

getOpenDocuments() → Promise<OpenDocument[]>

tintero.editor.getSelection() #

Get the current text selection in the active editor. Returns null if no editor is open. Positions are ProseMirror document positions (use with insertAt/replaceRange).

getSelection() → Promise<EditorSelection | null>

tintero.editor.getWordCount() #

Get the word count of the active document. Returns 0 if no editor is open.

getWordCount() → Promise<number>

tintero.editor.insertAt() #

Insert HTML content at a specific position in the active editor.

insertAt(position: number, html: string) → Promise<void>

tintero.editor.insertFlowMap() #

Insert a read-only block showing one of the project's flow maps.

insertFlowMap(flowMapId: string, position?: number) → Promise<void>

tintero.editor.open() #

Open an item of the project in Tintero, as if the user had clicked it in the file tree. If it is already open, its tab becomes the active one. Works with the ids of documents, characters, worldbuilding elements, images, audio and PDFs: the id alone identifies the kind, so there is no type to pass. It takes the user to the editor. Called from an app view, that view is hidden, not destroyed: it keeps running and its state is intact if the user comes back within 10 minutes (and without opening another project in between). Rejects if nothing in the open project has that id, and when called from an app view the user has left (hidden): a view nobody is looking at cannot move them elsewhere.

open(id: string) → Promise<void>

tintero.editor.replaceRange() #

Replace a range of content in the active editor.

replaceRange(from: number, to: number, html: string) → Promise<void>

tintero.editor.replaceSelection() #

Replace the current selection with HTML content. If the selection is empty (cursor only), inserts at the cursor position.

replaceSelection(html: string) → Promise<void>

tintero.debug

tintero.debug.clear() #

Clear the console log buffer.

clear() → Promise<void>

tintero.debug.getLogs() #

Get all stored console log entries. Requires debug.console scope.

getLogs() → Promise<ConsoleEntry[]>

tintero.convert

Stateless format converters between ProseMirror JSON, HTML, Markdown, and plain text.

tintero.convert.fromHtml() #

Convert HTML to ProseMirror JSON. Supports standard HTML elements: <p>, <h1>–<h6>, <strong>, <em>, <a>, <ul>, <ol>, <blockquote>, <code>, <table>, etc.

fromHtml(html: string) → Promise<ProseMirrorDocument>

tintero.convert.fromMarkdown() #

Convert Markdown to ProseMirror JSON. Parses standard Markdown syntax (headings, bold, italic, links, lists, code blocks).

fromMarkdown(markdown: string) → Promise<ProseMirrorDocument>

tintero.convert.fromText() #

Convert plain text to ProseMirror JSON. Each line becomes a paragraph node.

fromText(text: string) → Promise<ProseMirrorDocument>

tintero.convert.toHtml() #

Convert ProseMirror JSON to clean HTML. Returns HTML fragment (no <html>/<body> wrapper). Supports headings, paragraphs, lists, bold, italic, links, images. Accepts a parsed ProseMirrorDocument object or a raw JSON string.

toHtml(json: ProseMirrorDocument | string) → Promise<string>

tintero.convert.toMarkdown() #

Convert ProseMirror JSON to Markdown. Uses ATX-style headings (#), bold, *italic*, [links](url). Accepts a parsed ProseMirrorDocument object or a raw JSON string.

toMarkdown(json: ProseMirrorDocument | string) → Promise<string>

tintero.convert.toText() #

Convert ProseMirror JSON to plain text. Extracts text content, discarding all formatting. Accepts a parsed ProseMirrorDocument object or a raw JSON string (as returned by getFileContent()).

toText(json: ProseMirrorDocument | string) → Promise<string>

tintero.net

Proxied HTTP access to the hosts declared in `network.domains`.

tintero.net.fetch() #

net.fetch High

Perform an HTTP request to an external host (proxied by the host app). Requires the net.fetch scope and the target host must be listed in the plugin manifest's network.domains allow-list (the user approves those domains at install time). Requests to any other host are rejected. Supports exact hosts and leading-wildcard subdomains (*.example.com).

fetch(url: string, options?: NetFetchOptions) → Promise<NetFetchResponse>

tintero.media

Control the host's background media player (public YouTube playback).

tintero.media.getNowPlaying() #

media.control Medium
getNowPlaying() → Promise<MediaNowPlaying | null>

tintero.media.getState() #

media.control Medium
getState() → Promise<'idle' | 'playing' | 'paused' | 'buffering' | 'ended'>

tintero.media.next() #

media.control Medium
next() → Promise<void>

tintero.media.pause() #

media.control Medium
pause() → Promise<void>

tintero.media.play() #

media.control Medium

Play a public YouTube video or playlist (URL or id) in the host's background player.

play(source: string) → Promise<void>

tintero.media.previous() #

media.control Medium
previous() → Promise<void>

tintero.media.resume() #

media.control Medium
resume() → Promise<void>

tintero.media.setVolume() #

media.control Medium

Set the volume, 0–100.

setVolume(volume: number) → Promise<void>

tintero.media.stop() #

media.control Medium
stop() → Promise<void>