Free Use Bible API
Guide
Reference
SDKs
Seed Bible
GitHub
Support
  • English
  • Afrikaans
  • አማርኛ
  • العربية
  • বাংলা
  • Deutsch
  • Español
  • Français
  • Hausa
  • हिन्दी
  • Bahasa Indonesia
  • Italiano
  • 日本語
  • Português
  • Русский
  • Kiswahili
  • اردو
  • 简体中文
  • isiZulu
Guide
Reference
SDKs
Seed Bible
GitHub
Support
  • English
  • Afrikaans
  • አማርኛ
  • العربية
  • বাংলা
  • Deutsch
  • Español
  • Français
  • Hausa
  • हिन्दी
  • Bahasa Indonesia
  • Italiano
  • 日本語
  • Português
  • Русский
  • Kiswahili
  • اردو
  • 简体中文
  • isiZulu
  • Seed Bible
  • Guides
    • Developer Guide
    • Extension API
    • Security Model
  • API Reference (v1.18.0)
    • seed-bible/extensions
      • Classes

        • SandboxError
      • Interfaces

        • SandboxBook
        • SandboxChapter
        • SandboxChapterRef
        • SandboxChatMessage
        • SandboxChatRequest
        • SandboxCommentary
        • SandboxCommentaryBook
        • SandboxCommentaryChapter
        • SandboxCommentaryProfile
        • SandboxContext
        • SandboxDataset
        • SandboxDatasetBook
        • SandboxDatasetChapter
        • SandboxDatasetReference
        • SandboxDiscoverRequest
        • SandboxExtensionDefinition
        • SandboxFootnote
        • SandboxFriend
        • SandboxHighlight
        • SandboxNote
        • SandboxPaneHandle
        • SandboxPaneOptions
        • SandboxPlayback
        • SandboxPortalHandle
        • SandboxPortalOptions
        • SandboxProfile
        • SandboxReadingEvent
        • SandboxReadingPosition
        • SandboxReference
        • SandboxSave
        • SandboxSearchQuery
        • SandboxSearchResult
        • SandboxSearchResults
        • SandboxSelectedVerse
        • SandboxSessionParticipant
        • SandboxSharedSession
        • SandboxToolHandle
        • SandboxToolItemOptions
        • SandboxToolOptions
        • SandboxToolSelectContext
        • SandboxTranslation
        • SandboxVerseRef
        • SandboxViewProps
      • Type Aliases

        • SandboxCasualOSPattern
        • SandboxChapterContent
        • SandboxDiscoverResult
        • SandboxExtension
        • SandboxIcon
        • SandboxJsonValue
        • SandboxPermission
        • SandboxTitle
      • Variables

        • SANDBOX_PERMISSION_INFO
        • SANDBOX_PERMISSIONS
      • Functions

        • createSandboxClient
        • defineExtension
      • Unexported types
        • Interfaces

          • ChapterRef
          • SandboxInit
          • SandboxPermissionInfo
          • SandboxState
        • Type Aliases

          • SandboxErrorCode
          • SandboxFrameMode
          • SandboxPanePlacement
          • ToolFlag
    • seed-bible/extensions/testing
      • Interfaces

        • TestCall
        • TestHost
        • TestHostOptions
        • TestPane
      • Type Aliases

        • TestAnswer
      • Functions

        • createTestHost
      • Unexported types
        • Interfaces

          • SandboxCapture
          • SandboxMethods
          • SandboxToolDefinition
          • SandboxToolItem
        • Type Aliases

          • SandboxMethod
          • SandboxToolPatch
          • SandboxToolSurface
    • seed-bible/components
      • Interfaces

        • BottomSheetExpansion
        • BottomSheetProps
        • MaterialIconProps
        • PortalComponentHandle
        • PortalComponentProps
        • SearchBarProps
        • TranslationListProps
      • Type Aliases

        • ButtonProps
        • ButtonShape
        • ButtonSize
        • ButtonTone
        • ButtonVariant
        • CasualOSPattern
        • CloseButtonLook
        • CloseButtonSize
        • ContextMenuTriggerProps
        • ContextMenuWithButtonProps
        • IconButtonLook
        • IconButtonProps
        • IconButtonSize
        • SkeletonShape
      • Variables

        • AddIcon
        • AddTab
        • AiChatIcon
        • AiIcon
        • ApologistIcon
        • AskIcon
        • BibleIcon
        • BookmarkIcon
        • BookOutlineIcon
        • BurgerMenuIcon
        • CalendarStarIcon
        • ChatParticipantsIcon
        • ClientLogo
        • ColorSelect
        • CommunityIcon
        • CopyIcon
        • DiscordIcon
        • DonateIcon
        • DualScreenIcon
        • EditIcon
        • Eraser
        • ExtensionsIcon
        • FiltersIcon
        • FolderIcon
        • FormatLine
        • GoPrivateIcon
        • HighlightIcon
        • InfoSettingsIcon
        • JoinSession
        • LoadSpace
        • MarginIcon
        • MarginXIcon
        • MarginYIcon
        • MaterialIcon
        • MenuDown
        • MenuIcon
        • MinusIcon
        • MoreIcon
        • OpenFolderIcon
        • Panal
        • Panel1
        • Panel2
        • Panel3
        • Panel3Row
        • Panel4
        • Panel4Row
        • Playlist
        • PortalComponent
        • QuadScreenIcon
        • SbTabsIcon
        • SelectedIcon
        • SelectionUIIcon
        • SettingsIcon
        • ShareIcon
        • SingleScreenIcon
        • Space
        • SpaceDefaultIcon
        • SplitScreenIcon
        • StarIcon
        • StartSessionIcon
        • SupportIcon
        • T
        • TabsIcon
        • ThemeIcon
        • ThreeScreenIcon
        • TickIcon
        • TodayIcon
        • ToolbarIcon
        • UserAvatar
      • Functions

        • BottomSheet
        • Button
        • CloseButton
        • ContextMenuItem
        • ContextMenuWithButton
        • ExpandableText
        • IconButton
        • InstallAppsIcon
        • PlaylistLinkContent
        • SafariIcon
        • ScriptureLineHeightIcon
        • SearchBar
        • SeedBibleIcon
        • SeedBibleWordmark
        • Skeleton
        • SkeletonContainer
        • StopIcon
        • TranslationList
        • TranslationViewModeMenu
        • useDragReorder
      • Unexported types
        • Interfaces

          • Translation
          • TranslationLanguageGroup
          • UseDragReorderOptions
        • Type Aliases

          • CloseButtonProps
          • SvgIconProps
          • TranslationViewMode

Seed Bible extension API (v1.18.0) / seed-bible/extensions/testing / TestHost

Interface: TestHost

Properties

calls

calls: TestCall[];

Every call that got past the permission check, in order.


chat

chat: (
  providerId: string,
  request: Omit<SandboxChatRequest, "providerId">,
) => Promise<string | null>;

Asks a chat provider for its reply.

Parameters

ParameterType
providerIdstring
requestOmit<SandboxChatRequest, "providerId">

Returns

Promise<string | null>


chatProviders

chatProviders: Set<string>;

clipboard

clipboard: string[];

What sb.clipboard.writeText copied.


discover

discover: (
  providerId: string,
  request: Omit<SandboxDiscoverRequest, "providerId">,
) => Promise<SandboxDiscoverResult[]>;

Asks a Discover provider for results, as the Discover panel does.

Parameters

ParameterType
providerIdstring
requestOmit<SandboxDiscoverRequest, "providerId">

Returns

Promise<SandboxDiscoverResult[]>


discoverProviders

discoverProviders: Set<string>;

Registered Discover and chat providers, by id.


dispose

dispose: () => void;

Closes every channel. Call it at the end of each test.

Returns

void


flush

flush: () => Promise<void>;

Waits until every message already sent between the two sides has arrived.

Returns

Promise<void>


granted

granted: () => (
  | "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"
)[];

What's granted now, implied permissions included.

Returns

( | "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")[]


opened

opened: SandboxVerseRef[];

Every sb.reading.open.


panes

panes: Map<string, TestPane>;

Open panes and portals, by pane id.


ready

ready: Promise<void>;

Settles once main has finished, or rejects with its error.


renderView

renderView: (
  view: string,
  options?: {
    container?: HTMLElement;
    paneId?: string;
    props?: SandboxJsonValue;
    surface?: "pane" | "modal" | "settings";
  },
) => Promise<HTMLElement>;

Renders a view into container (or a new element in document.body) with its own sb, as a pane would. Returns the element it rendered in.

Parameters

ParameterType
viewstring
options?{ container?: HTMLElement; paneId?: string; props?: SandboxJsonValue; surface?: "pane" | "modal" | "settings"; }
options.container?HTMLElement
options.paneId?string
options.props?SandboxJsonValue
options.surface?"pane" | "modal" | "settings"

Returns

Promise<HTMLElement>


requests

requests: {
  granted: boolean;
  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"
  )[];
}[];

The permission prompts the user would have seen, and their answers. A request for what's already granted is answered without one, as in the app.

granted

granted: boolean;

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"
)[];

selectTool

selectTool: (
  id: string,
  options?: {
    itemId?: string;
    selection?: SandboxSelectedVerse[];
  },
) => Promise<void>;

The user selects a tool (or one of its items). Waits for its handler.

Parameters

ParameterType
idstring
options?{ itemId?: string; selection?: SandboxSelectedVerse[]; }
options.itemId?string
options.selection?SandboxSelectedVerse[]

Returns

Promise<void>


setState

setState: (state: Partial<SandboxState>) => Promise<void>;

The app's state changes, e.g. the reader moves to another chapter.

Parameters

ParameterType
statePartial<SandboxState>

Returns

Promise<void>


storage

storage: Map<string, SandboxJsonValue>;

The extension's sb.storage. Set entries on it to seed storage.


toasts

toasts: string[];

Every sb.app.toast message, in order.


tools

tools: Map<string, SandboxToolDefinition>;

Registered tools, by the id the extension gave them.

Prev
TestCall
Next
TestHostOptions