Skip to content

@sqlrooms/app-runtime / CreateHtmlAppRevisionCommandsOptions

Type Alias: CreateHtmlAppRevisionCommandsOptions<TRoomState>

CreateHtmlAppRevisionCommandsOptions<TRoomState> = object

Type Parameters

Type Parameter
TRoomState extends BaseRoomStoreState

Properties

resolveCurrentAppId?

optional resolveCurrentAppId?: (state) => string | undefined

Resolve the current host-selected HTML app id, when any.

Parameters

ParameterType
stateTRoomState

Returns

string | undefined


getHtmlAppIds

getHtmlAppIds: (state) => string[]

Return all HTML app ids known to the host.

Parameters

ParameterType
stateTRoomState

Returns

string[]


getHtmlAppState

getHtmlAppState: (state, appId) => HtmlAppState | undefined

Return an HTML app by id.

Parameters

ParameterType
stateTRoomState
appIdstring

Returns

HtmlAppState | undefined


renameHtmlApp

renameHtmlApp: (state, appId, title) => void

Rename an HTML app without committing source files.

Parameters

ParameterType
stateTRoomState
appIdstring
titlestring

Returns

void


commitHtmlAppRevision

commitHtmlAppRevision: (state, appId, patch, metadata?) => HtmlAppRevision | undefined

Commit a durable HTML app revision.

Parameters

ParameterType
stateTRoomState
appIdstring
patchHtmlAppRevisionPatch
metadata?CommitHtmlAppRevisionMetadata

Returns

HtmlAppRevision | undefined


restoreHtmlAppRevision

restoreHtmlAppRevision: (state, appId, revisionId, metadata?) => HtmlAppRevision | undefined

Restore a durable HTML app revision by id.

Parameters

ParameterType
stateTRoomState
appIdstring
revisionIdstring
metadata?RestoreHtmlAppRevisionMetadata

Returns

HtmlAppRevision | undefined


undoHtmlAppRevision

undoHtmlAppRevision: (state, appId) => HtmlAppRevision | undefined

Move backward through HTML app revisions.

Parameters

ParameterType
stateTRoomState
appIdstring

Returns

HtmlAppRevision | undefined


redoHtmlAppRevision

redoHtmlAppRevision: (state, appId) => HtmlAppRevision | undefined

Move forward through undone HTML app revisions.

Parameters

ParameterType
stateTRoomState
appIdstring

Returns

HtmlAppRevision | undefined


ambiguousTargetMessage?

optional ambiguousTargetMessage?: string

Error message used when no app id can be chosen unambiguously.