***`
@jupyterlite / @jupyterlite/application / SingleWidgetApp
类:SingleWidgetApp
#
定义于:packages/application/src/singleWidgetApp.ts:19
App 是主应用程序类。它被实例化一次并共享。
扩展#
JupyterFrontEnd
<ISingleWidgetShell
>
构造函数#
构造函数
#
**new SingleWidgetApp**
(options
):SingleWidgetApp
定义于:packages/application/src/singleWidgetApp.ts:25
构造一个新的 SingleWidgetApp 对象。
参数#
选项#
IOptions
= ...
应用程序的实例化选项。
返回#
SingleWidgetApp
覆盖#
JupyterFrontEnd<ISingleWidgetShell>.constructor
属性#
commandLinker
#
readonly
**commandLinker**
:CommandLinker
定义于:node_modules/@jupyterlab/application/lib/frontend.d.ts:50
应用程序使用的命令链接器。
继承自#
JupyterFrontEnd.commandLinker
`***
commands
#
readonly
commands
:CommandRegistry
定义于:node_modules/@lumino/application/types/index.d.ts:32
应用程序命令注册表。
继承自#
JupyterFrontEnd.commands
***`
docRegistry
#
readonly
docRegistry
:DocumentRegistry
定义于:node_modules/@jupyterlab/application/lib/frontend.d.ts:58
应用程序使用的文档注册表实例。
继承自#
JupyterFrontEnd.docRegistry
***`
name
#
readonly
**name**
:"Single Widget Application"
='Single Widget Application'
定义于:packages/application/src/singleWidgetApp.ts:40
应用程序的名称。
覆盖#
JupyterFrontEnd.name
`***
namespace
#
readonly
namespace
:"Single Widget Application"
定义于:packages/application/src/singleWidgetApp.ts:45
插件可用于表示其来源的命名空间/前缀。
覆盖#
JupyterFrontEnd.namespace
***`
pluginRegistry
#
protected
**pluginRegistry**
:PluginRegistry
定义于:node_modules/@lumino/application/types/index.d.ts:283
应用程序插件注册表。
继承自#
JupyterFrontEnd.pluginRegistry
`***
restored
#
readonly
restored
:Promise
<void
>
定义于:node_modules/@jupyterlab/application/lib/frontend.d.ts:62
状态首次恢复时解析的 Promise。
继承自#
JupyterFrontEnd.restored
***`
serviceManager
#
readonly
**serviceManager**
:IManager
定义于:node_modules/@jupyterlab/application/lib/frontend.d.ts:66
应用程序使用的服务管理器。
继承自#
JupyterFrontEnd.serviceManager
`***
shell
#
readonly
shell
:ISingleWidgetShell
定义于:node_modules/@lumino/application/types/index.d.ts:45
应用程序 shell 小部件。
备注#
shell 小部件是整个应用程序的根“容器”小部件。它通常会公开一个 API,允许应用程序插件在各种位置插入内容。
继承自#
JupyterFrontEnd.shell
***`
status
#
readonly
**status**
:LabStatus
定义于:packages/application/src/singleWidgetApp.ts:50
应用程序的忙碌和脏状态信号和标志。
`***
version
#
readonly
version
:string
定义于:packages/application/src/singleWidgetApp.ts:55
应用程序的版本。
覆盖#
JupyterFrontEnd.version
访问器#
deferredPlugins
#
获取签名#
get
deferredPlugins
():string
[]
定义于:node_modules/@lumino/application/types/index.d.ts:49
所有延迟插件的列表。
返回#
string
[]
继承自#
JupyterFrontEnd.deferredPlugins
***`
format
#
获取签名#
**get**
**format**
():U
定义于:node_modules/@jupyterlab/application/lib/frontend.d.ts:70
应用程序的外形,例如desktop
或mobile
。
返回#
U
设置签名#
**set**
**format**
(format
):void
定义于:node_modules/@jupyterlab/application/lib/frontend.d.ts:71
参数#
格式#
U
返回#
void
继承自#
JupyterFrontEnd.format
`***
formatChanged
#
获取签名#
get
formatChanged
():ISignal
<this
,U
>
定义于:node_modules/@jupyterlab/application/lib/frontend.d.ts:75
当应用程序外形发生变化时发出的信号。
返回#
ISignal
<this
, U
>
继承自#
JupyterFrontEnd.formatChanged
***`
paths
#
获取签名#
**get**
**paths**
():IPaths
定义于:packages/application/src/singleWidgetApp.ts:60
JupyterLab 应用程序路径字典。
返回#
IPaths
`***
started
#
获取签名#
get
started
():Promise
<void
>
定义于:node_modules/@lumino/application/types/index.d.ts:57
应用程序启动后解析的 Promise。
备注#
此 Promise 将在调用 start()
方法后,当所有引导和 shell 挂载工作完成后解析。
返回#
Promise
<void
>
继承自#
JupyterFrontEnd.started
方法#
activateDeferredPlugins()
#
activateDeferredPlugins
():Promise
<void
>
定义于:node_modules/@lumino/application/types/index.d.ts:64
激活所有延迟插件。
返回#
Promise
<void
>
一个 Promise,当每个插件被激活时解析,如果有一个插件无法激活,则以错误拒绝。
继承自#
JupyterFrontEnd.activateDeferredPlugins
***`
activatePlugin()
#
**activatePlugin**
(id
):Promise
<void
>
定义于:node_modules/@lumino/application/types/index.d.ts:73
激活具有给定 ID 的插件。
参数#
id#
string
感兴趣的插件 ID。
返回#
Promise
<void
>
一个 Promise,当插件被激活时解析,如果它无法激活,则以错误拒绝。
继承自#
JupyterFrontEnd.activatePlugin
`***
addEventListeners()
#
protected
addEventListeners
():void
定义于:node_modules/@lumino/application/types/index.d.ts:236
添加应用程序事件监听器。
备注#
此方法的默认实现添加了 'keydown'
和 'resize'
事件的监听器。
子类可以根据需要重新实现此方法。
返回#
void
继承自#
JupyterFrontEnd.addEventListeners
***`
attachShell()
#
protected
**attachShell**
(id
):void
定义于:node_modules/@lumino/application/types/index.d.ts:226
将应用程序 shell 附加到 DOM。
参数#
id#
string
shell 宿主节点的 ID,或 ''
。
备注#
如果未提供 ID,则文档主体将是宿主。
子类可以根据需要重新实现此方法。
返回#
void
继承自#
JupyterFrontEnd.attachShell
`***
deactivatePlugin()
#
**deactivatePlugin**
(id
):Promise
<string
[]>
定义于:node_modules/@lumino/application/types/index.d.ts:82
仅当插件及其所有下游依赖项都支持 deactivate
时,才停用该插件及其下游依赖项。
参数#
id#
string
感兴趣的插件 ID。
返回#
Promise
<string
[]>
与此插件一起停用的下游插件 ID 列表。
继承自#
JupyterFrontEnd.deactivatePlugin
`***
deregisterPlugin()
#
deregisterPlugin
(id
,force?
):void
定义于:node_modules/@lumino/application/types/index.d.ts:90
向应用程序注销插件。
参数#
id#
string
感兴趣的插件 ID。
force?#
boolean
即使插件处于活动状态,是否也注销它。
返回#
void
继承自#
JupyterFrontEnd.deregisterPlugin
***`
evtKeydown()
#
protected
evtKeydown
(event
):void
定义于:node_modules/@lumino/application/types/index.d.ts:246
文档 'keydown'
事件触发的方法。
备注#
此方法的默认实现调用应用程序命令注册表的按键处理方法。
子类可以根据需要重新实现此方法。
参数#
event#
KeyboardEvent
返回#
void
继承自#
JupyterFrontEnd.evtKeydown
***`
evtKeyup()
#
protected
**evtKeyup**
(event
):void
定义于:node_modules/@lumino/application/types/index.d.ts:256
文档 'keyup'
事件触发的方法。
备注#
此方法的默认实现调用应用程序命令注册表的按键释放处理方法。
子类可以根据需要重新实现此方法。
参数#
event#
KeyboardEvent
返回#
void
继承自#
JupyterFrontEnd.evtKeyup
`***
evtResize()
#
protected
evtResize
(event
):void
定义于:node_modules/@lumino/application/types/index.d.ts:279
窗口 'resize'
事件触发的方法。
备注#
此方法的默认实现更新 shell。
子类可以根据需要重新实现此方法。
参数#
event#
事件
返回#
void
继承自#
JupyterFrontEnd.evtResize
***`
getPluginDescription()
#
**getPluginDescription**
(id
):string
定义于:node_modules/@lumino/application/types/index.d.ts:98
获取插件描述。
参数#
id#
string
感兴趣的插件 ID。
返回#
string
插件描述。
继承自#
JupyterFrontEnd.getPluginDescription
`***
handleEvent()
#
handleEvent
(event
):void
定义于:node_modules/@lumino/application/types/index.d.ts:215
处理应用程序的 DOM 事件。
参数#
event#
事件
发送到应用程序的 DOM 事件。
备注#
此方法实现 DOM EventListener
接口,并响应为应用程序注册的事件而被调用。用户代码不应直接调用它。
返回#
void
继承自#
JupyterFrontEnd.handleEvent
***`
hasPlugin()
#
**hasPlugin**
(id
):boolean
定义于:node_modules/@lumino/application/types/index.d.ts:106
测试插件是否已注册到应用程序。
参数#
id#
string
感兴趣的插件 ID。
返回#
boolean
如果插件已注册,则为 true
,否则为 false
。
继承自#
JupyterFrontEnd.hasPlugin
`***
isPluginActivated()
#
isPluginActivated
(id
):boolean
定义于:node_modules/@lumino/application/types/index.d.ts:114
测试插件是否已在应用程序中激活。
参数#
id#
string
感兴趣的插件 ID。
返回#
boolean
如果插件已激活,则为 true
,否则为 false
。
继承自#
JupyterFrontEnd.isPluginActivated
***`
listPlugins()
#
**listPlugins**
():string
[]
定义于:node_modules/@lumino/application/types/index.d.ts:120
列出已注册到应用程序的插件 ID。
返回#
string
[]
注册插件 ID 的新数组。
继承自#
JupyterFrontEnd.listPlugins
`***
registerPlugin()
#
registerPlugin
(plugin
):void
定义于:node_modules/@lumino/application/types/index.d.ts:133
向应用程序注册插件。
参数#
插件#
IPlugin
<SingleWidgetApp
, any
>
要注册的插件。
备注#
如果具有相同 ID 的插件已注册,或者插件存在循环依赖,则会抛出错误。
如果插件提供了一个已被其他插件提供的服务,则新服务将覆盖旧服务。
返回#
void
继承自#
JupyterFrontEnd.registerPlugin
***`
registerPlugins()
#
**registerPlugins**
(plugins
):void
定义于:node_modules/@lumino/application/types/index.d.ts:142
向应用程序注册多个插件。
参数#
插件#
IPlugin
<SingleWidgetApp
, any
>[]
要注册的插件。
备注#
这将为每个给定插件调用 registerPlugin()
。
返回#
void
继承自#
JupyterFrontEnd.registerPlugins
`***
resolveOptionalService()
#
resolveOptionalService
<U
>(token
):Promise
<null
|U
>
定义于:node_modules/@lumino/application/types/index.d.ts:162
解析给定类型的可选服务。
类型参数#
U#
U
参数#
token#
Token
<U
>
感兴趣的服务类型的令牌。
返回#
Promise
<null
| U
>
一个 Promise,它解析为所请求服务的实例,如果无法解析则为 null
。
备注#
服务是单例。每次解析给定服务令牌时,将返回相同的实例。
如果提供服务的插件尚未激活,解析服务将自动激活插件。
用户代码通常不会直接调用此方法。相反,用户的插件的可选服务将在插件激活时自动解析。
继承自#
JupyterFrontEnd.resolveOptionalService
***`
resolveRequiredService()
#
**resolveRequiredService**
<U
>(token
):Promise
<U
>
定义于:node_modules/@lumino/application/types/index.d.ts:182
解析给定类型的所需服务。
类型参数#
U#
U
参数#
token#
Token
<U
>
感兴趣的服务类型的令牌。
返回#
Promise
<U
>
一个 Promise,它解析为所请求服务的实例,如果无法解析则以错误拒绝。
备注#
服务是单例。每次解析给定服务令牌时,将返回相同的实例。
如果提供服务的插件尚未激活,解析服务将自动激活插件。
用户代码通常不会直接调用此方法。相反,用户的插件的所需服务将在插件激活时自动解析。
继承自#
JupyterFrontEnd.resolveRequiredService
`***
start()
#
start
(options?
):Promise
<void
>
定义于:node_modules/@lumino/application/types/index.d.ts:204
启动应用程序。
参数#
options?#
IStartOptions
启动应用程序的选项。
返回#
Promise
<void
>
一个 Promise,当所有引导工作完成且 shell 挂载到 DOM 时解析。
备注#
在所有初始插件注册后,应用程序创建者应调用此方法一次。
如果插件加载失败,错误将被记录,其他有效插件将继续加载。
引导应用程序包括以下步骤:
激活启动插件
等待这些插件激活
将 shell 小部件附加到 DOM
添加应用程序事件监听器
继承自#
JupyterFrontEnd.start