Seed Bible extension API (v1.19.0) / seed-bible/extensions/testing / SandboxMethods
Interface: SandboxMethods
Every call an extension can make to Seed Bible, by method name: what it takes and what it returns. The name is the sb path without sb., so sb.notes.create is "notes.create". Tests use it to type the answers passed to createTestHost.
Properties
app.toast
"app.toast": {
params: {
message: string;
};
result: null;
};params
params: {
message: string;
};params.message
message: string;result
result: null;audio.narrators
"audio.narrators": {
params: {
bookId: string;
chapter: number;
translationId: string;
};
result: string[];
};params
params: {
bookId: string;
chapter: number;
translationId: string;
};params.bookId
bookId: string;params.chapter
chapter: number;params.translationId
translationId: string;result
result: string[];audio.pause
"audio.pause": {
params: Record<string, never>;
result: null;
};params
params: Record<string, never>;result
result: null;audio.play
"audio.play": {
params: {
url: string;
};
result: {
finished: boolean;
};
};Each of these plays through the app's player, and resolves once it ends: finished is false if it was stopped rather than played to the end.
params
params: {
url: string;
};params.url
url: string;result
result: {
finished: boolean;
};result.finished
finished: boolean;audio.playNarration
"audio.playNarration": {
params: {
bookId: string;
chapter: number;
reader?: string;
translationId: string;
};
result: {
finished: boolean;
};
};params
params: {
bookId: string;
chapter: number;
reader?: string;
translationId: string;
};params.bookId
bookId: string;params.chapter
chapter: number;params.reader?
reader?: string;params.translationId
translationId: string;result
result: {
finished: boolean;
};result.finished
finished: boolean;audio.readAloud
"audio.readAloud": {
params: {
bookId: string;
chapter: number;
fromVerse?: number;
toVerse?: number;
translationId: string;
};
result: {
finished: boolean;
};
};params
params: {
bookId: string;
chapter: number;
fromVerse?: number;
toVerse?: number;
translationId: string;
};params.bookId
bookId: string;params.chapter
chapter: number;params.fromVerse?
fromVerse?: number;params.toVerse?
toVerse?: number;params.translationId
translationId: string;result
result: {
finished: boolean;
};result.finished
finished: boolean;audio.resume
"audio.resume": {
params: Record<string, never>;
result: null;
};params
params: Record<string, never>;result
result: null;audio.seek
"audio.seek": {
params: {
position: number;
};
result: null;
};params
params: {
position: number;
};params.position
position: number;result
result: null;audio.stop
"audio.stop": {
params: Record<string, never>;
result: null;
};params
params: Record<string, never>;result
result: null;bible.books
"bible.books": {
params: {
translationId: string;
};
result: {
books: SandboxBook[];
translation: SandboxTranslation;
};
};params
params: {
translationId: string;
};params.translationId
translationId: string;result
result: {
books: SandboxBook[];
translation: SandboxTranslation;
};result.books
books: SandboxBook[];result.translation
translation: SandboxTranslation;bible.chapter
"bible.chapter": {
params: {
bookId: string;
chapter: number;
translationId: string;
};
result: SandboxChapter;
};params
params: {
bookId: string;
chapter: number;
translationId: string;
};params.bookId
bookId: string;params.chapter
chapter: number;params.translationId
translationId: string;result
result: SandboxChapter;bible.commentaries
"bible.commentaries": {
params: Record<string, never>;
result: SandboxCommentary[];
};params
params: Record<string, never>;result
result: SandboxCommentary[];bible.commentaryBooks
"bible.commentaryBooks": {
params: {
commentaryId: string;
};
result: {
books: SandboxCommentaryBook[];
commentary: SandboxCommentary;
};
};params
params: {
commentaryId: string;
};params.commentaryId
commentaryId: string;result
result: {
books: SandboxCommentaryBook[];
commentary: SandboxCommentary;
};result.books
books: SandboxCommentaryBook[];result.commentary
commentary: SandboxCommentary;bible.commentaryChapter
"bible.commentaryChapter": {
params: {
bookId: string;
chapter: number;
commentaryId: string;
};
result: SandboxCommentaryChapter;
};params
params: {
bookId: string;
chapter: number;
commentaryId: string;
};params.bookId
bookId: string;params.chapter
chapter: number;params.commentaryId
commentaryId: string;result
result: SandboxCommentaryChapter;bible.commentaryProfile
"bible.commentaryProfile": {
params: {
commentaryId: string;
profileId: string;
};
result: SandboxCommentaryProfile & {
content: string[];
};
};params
params: {
commentaryId: string;
profileId: string;
};params.commentaryId
commentaryId: string;params.profileId
profileId: string;result
result: SandboxCommentaryProfile & {
content: string[];
};Type Declaration
content
content: string[];bible.commentaryProfiles
"bible.commentaryProfiles": {
params: {
commentaryId: string;
};
result: SandboxCommentaryProfile[];
};params
params: {
commentaryId: string;
};params.commentaryId
commentaryId: string;result
result: SandboxCommentaryProfile[];bible.datasetBooks
"bible.datasetBooks": {
params: {
datasetId: string;
};
result: {
books: SandboxDatasetBook[];
dataset: SandboxDataset;
};
};params
params: {
datasetId: string;
};params.datasetId
datasetId: string;result
result: {
books: SandboxDatasetBook[];
dataset: SandboxDataset;
};result.books
books: SandboxDatasetBook[];result.dataset
dataset: SandboxDataset;bible.datasetChapter
"bible.datasetChapter": {
params: {
bookId: string;
chapter: number;
datasetId: string;
};
result: SandboxDatasetChapter;
};params
params: {
bookId: string;
chapter: number;
datasetId: string;
};params.bookId
bookId: string;params.chapter
chapter: number;params.datasetId
datasetId: string;result
result: SandboxDatasetChapter;bible.datasets
"bible.datasets": {
params: Record<string, never>;
result: SandboxDataset[];
};params
params: Record<string, never>;result
result: SandboxDataset[];bible.search
"bible.search": {
params: SandboxSearchQuery;
result: SandboxSearchResults;
};params
params: SandboxSearchQuery;result
result: SandboxSearchResults;bible.translations
"bible.translations": {
params: Record<string, never>;
result: SandboxTranslation[];
};params
params: Record<string, never>;result
result: SandboxTranslation[];chats.register
"chats.register": {
params: {
id: string;
name: string;
shared?: boolean;
};
result: null;
};params
params: {
id: string;
name: string;
shared?: boolean;
};params.id
id: string;params.name
name: string;params.shared?
shared?: boolean;result
result: null;chats.unregister
"chats.unregister": {
params: {
id: string;
};
result: null;
};params
params: {
id: string;
};params.id
id: string;result
result: null;clipboard.writeText
"clipboard.writeText": {
params: {
text: string;
};
result: null;
};params
params: {
text: string;
};params.text
text: string;result
result: null;devices.recordAudio
"devices.recordAudio": {
params: {
maxSeconds?: number;
};
result: SandboxCapture | null;
};Null if the user cancelled.
params
params: {
maxSeconds?: number;
};params.maxSeconds?
maxSeconds?: number;result
result: SandboxCapture | null;devices.takePhoto
"devices.takePhoto": {
params: Record<string, never>;
result: SandboxCapture | null;
};Null if the user cancelled.
params
params: Record<string, never>;result
result: SandboxCapture | null;discover.register
"discover.register": {
params: {
description: string;
id: string;
title: string;
};
result: null;
};params
params: {
description: string;
id: string;
title: string;
};params.description
description: string;params.id
id: string;params.title
title: string;result
result: null;discover.unregister
"discover.unregister": {
params: {
id: string;
};
result: null;
};params
params: {
id: string;
};params.id
id: string;result
result: null;friends.list
"friends.list": {
params: Record<string, never>;
result: SandboxFriend[];
};params
params: Record<string, never>;result
result: SandboxFriend[];highlights.add
"highlights.add": {
params: {
bookId: string;
chapter: number;
colorId: string;
translationId: string;
verses: number[];
};
result: null;
};params
params: {
bookId: string;
chapter: number;
colorId: string;
translationId: string;
verses: number[];
};params.bookId
bookId: string;params.chapter
chapter: number;params.colorId
colorId: string;params.translationId
translationId: string;params.verses
verses: number[];result
result: null;highlights.colors
"highlights.colors": {
params: Record<string, never>;
result: string[];
};params
params: Record<string, never>;result
result: string[];highlights.list
"highlights.list": {
params: {
bookId: string;
chapter: number;
translationId: string;
};
result: SandboxHighlight[];
};params
params: {
bookId: string;
chapter: number;
translationId: string;
};params.bookId
bookId: string;params.chapter
chapter: number;params.translationId
translationId: string;result
result: SandboxHighlight[];highlights.remove
"highlights.remove": {
params: {
bookId: string;
chapter: number;
translationId: string;
verses: number[];
};
result: null;
};params
params: {
bookId: string;
chapter: number;
translationId: string;
verses: number[];
};params.bookId
bookId: string;params.chapter
chapter: number;params.translationId
translationId: string;params.verses
verses: number[];result
result: null;history.list
"history.list": {
params: {
from: number;
to: number;
};
result: SandboxReadingEvent[];
};params
params: {
from: number;
to: number;
};params.from
from: number;params.to
to: number;result
result: SandboxReadingEvent[];modals.open
"modals.open": {
params: {
message?: string;
props?: SandboxJsonValue;
title: string;
view?: string;
};
result: null;
};Resolves once the modal is closed.
params
params: {
message?: string;
props?: SandboxJsonValue;
title: string;
view?: string;
};params.message?
message?: string;params.props?
props?: SandboxJsonValue;params.title
title: string;params.view?
view?: string;result
result: null;notes.create
"notes.create": {
params: {
bookId: string;
chapter: number;
text: string;
verses?: number[];
};
result: {
id: string;
};
};params
params: {
bookId: string;
chapter: number;
text: string;
verses?: number[];
};params.bookId
bookId: string;params.chapter
chapter: number;params.text
text: string;params.verses?
verses?: number[];result
result: {
id: string;
};result.id
id: string;notes.delete
"notes.delete": {
params: {
bookId: string;
chapter: number;
id: string;
};
result: null;
};params
params: {
bookId: string;
chapter: number;
id: string;
};params.bookId
bookId: string;params.chapter
chapter: number;params.id
id: string;result
result: null;notes.list
"notes.list": {
params: {
bookId: string;
chapter: number;
};
result: SandboxNote[];
};params
params: {
bookId: string;
chapter: number;
};params.bookId
bookId: string;params.chapter
chapter: number;result
result: SandboxNote[];notes.update
"notes.update": {
params: {
bookId: string;
chapter: number;
id: string;
text: string;
};
result: null;
};params
params: {
bookId: string;
chapter: number;
id: string;
text: string;
};params.bookId
bookId: string;params.chapter
chapter: number;params.id
id: string;params.text
text: string;result
result: null;panes.close
"panes.close": {
params: {
paneId: string;
};
result: null;
};params
params: {
paneId: string;
};params.paneId
paneId: string;result
result: null;panes.open
"panes.open": {
params: SandboxPaneOptions;
result: {
paneId: string;
};
};params
params: SandboxPaneOptions;result
result: {
paneId: string;
};result.paneId
paneId: string;permissions.request
"permissions.request": {
params: {
permissions: (
| "reading:position"
| "reading:selection"
| "reading:navigate"
| "reading:history"
| "highlights:read"
| "highlights:write"
| "notes:read"
| "notes:write"
| "saves:read"
| "saves:write"
| "profile:read"
| "chat:respond"
| "chat:shared"
| "friends:read"
| "session:read"
| "audio:playback"
| "clipboard:write"
| "embed:casualos"
| "device:microphone"
| "device:camera"
)[];
};
result: {
granted: boolean;
};
};Asks the user for optional permissions. granted is true only if all of them are granted afterwards.
params
params: {
permissions: (
| "reading:position"
| "reading:selection"
| "reading:navigate"
| "reading:history"
| "highlights:read"
| "highlights:write"
| "notes:read"
| "notes:write"
| "saves:read"
| "saves:write"
| "profile:read"
| "chat:respond"
| "chat:shared"
| "friends:read"
| "session:read"
| "audio:playback"
| "clipboard:write"
| "embed:casualos"
| "device:microphone"
| "device:camera"
)[];
};params.permissions
permissions: (
| "reading:position"
| "reading:selection"
| "reading:navigate"
| "reading:history"
| "highlights:read"
| "highlights:write"
| "notes:read"
| "notes:write"
| "saves:read"
| "saves:write"
| "profile:read"
| "chat:respond"
| "chat:shared"
| "friends:read"
| "session:read"
| "audio:playback"
| "clipboard:write"
| "embed:casualos"
| "device:microphone"
| "device:camera"
)[];result
result: {
granted: boolean;
};result.granted
granted: boolean;pong
pong: {
params: Record<string, never>;
result: null;
};The background frame's answer to a heartbeat.
params
params: Record<string, never>;result
result: null;portals.open
"portals.open": {
params: SandboxPortalOptions;
result: {
paneId: string;
};
};params
params: SandboxPortalOptions;result
result: {
paneId: string;
};result.paneId
paneId: string;portals.send
"portals.send": {
params: {
message: SandboxJsonValue;
paneId: string;
};
result: null;
};params
params: {
message: SandboxJsonValue;
paneId: string;
};params.message
message: SandboxJsonValue;params.paneId
paneId: string;result
result: null;profile.get
"profile.get": {
params: Record<string, never>;
result: SandboxProfile | null;
};params
params: Record<string, never>;result
result: SandboxProfile | null;reading.open
"reading.open": {
params: SandboxVerseRef;
result: null;
};params
params: SandboxVerseRef;result
result: null;ready
ready: {
params: {
error?: string;
};
result: null;
};Sent once by the background frame when main has finished (or failed).
params
params: {
error?: string;
};params.error?
error?: string;result
result: null;respond
respond: {
params: {
error?: string;
requestId: number;
value?: unknown;
};
result: null;
};The background frame's answer to a host request.
params
params: {
error?: string;
requestId: number;
value?: unknown;
};params.error?
error?: string;params.requestId
requestId: number;params.value?
value?: unknown;result
result: null;saves.add
"saves.add": {
params: {
bookId: string;
categories?: string[];
chapter: number;
translationId: string;
verse?: number | [number, number];
};
result: null;
};params
params: {
bookId: string;
categories?: string[];
chapter: number;
translationId: string;
verse?: number | [number, number];
};params.bookId
bookId: string;params.categories?
categories?: string[];params.chapter
chapter: number;params.translationId
translationId: string;params.verse?
verse?: number | [number, number];result
result: null;saves.list
"saves.list": {
params: Record<string, never>;
result: SandboxSave[];
};params
params: Record<string, never>;result
result: SandboxSave[];saves.remove
"saves.remove": {
params: {
id: string;
};
result: null;
};params
params: {
id: string;
};params.id
id: string;result
result: null;sensitive.fetch
"sensitive.fetch": {
params: {
body?: unknown;
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD";
proxy?: string;
url: string;
};
result: {
body: string;
contentType: string | null;
ok: boolean;
status: number;
};
};params
params: {
body?: unknown;
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD";
proxy?: string;
url: string;
};params.body?
body?: unknown;params.method?
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD";params.proxy?
proxy?: string;params.url
url: string;result
result: {
body: string;
contentType: string | null;
ok: boolean;
status: number;
};result.body
body: string;result.contentType
contentType: string | null;result.ok
ok: boolean;result.status
status: number;settings.get
"settings.get": {
params: {
key: string;
};
result: string | number | boolean | null;
};params
params: {
key: string;
};params.key
key: string;result
result: string | number | boolean | null;settings.registerPanel
"settings.registerPanel": {
params: {
view: string;
};
result: null;
};params
params: {
view: string;
};params.view
view: string;result
result: null;storage.get
"storage.get": {
params: {
key: string;
};
result: SandboxJsonValue;
};params
params: {
key: string;
};params.key
key: string;result
result: SandboxJsonValue;storage.keys
"storage.keys": {
params: Record<string, never>;
result: string[];
};params
params: Record<string, never>;result
result: string[];storage.remove
"storage.remove": {
params: {
key: string;
};
result: null;
};params
params: {
key: string;
};params.key
key: string;result
result: null;storage.set
"storage.set": {
params: {
key: string;
value: SandboxJsonValue;
};
result: null;
};params
params: {
key: string;
value: SandboxJsonValue;
};params.key
key: string;params.value
value: SandboxJsonValue;result
result: null;tools.register
"tools.register": {
params: SandboxToolDefinition;
result: null;
};params
params: SandboxToolDefinition;result
result: null;tools.unregister
"tools.unregister": {
params: {
id: string;
};
result: null;
};params
params: {
id: string;
};params.id
id: string;result
result: null;tools.update
"tools.update": {
params: {
id: string;
patch: SandboxToolPatch;
};
result: null;
};params
params: {
id: string;
patch: SandboxToolPatch;
};params.id
id: string;params.patch
patch: SandboxToolPatch;result
result: null;