本文整理匯總了TypeScript中@jupyterlab/apputils.ISplashScreen類的典型用法代碼示例。如果您正苦於以下問題:TypeScript ISplashScreen類的具體用法?TypeScript ISplashScreen怎麽用?TypeScript ISplashScreen使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ISplashScreen類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: ThemeManager
activate: (app: JupyterLab, settingRegistry: ISettingRegistry, splash: ISplashScreen): IThemeManager => {
let baseUrl = app.serviceManager.serverSettings.baseUrl;
let host = app.shell;
let when = app.started;
let manager = new ThemeManager({ baseUrl, settingRegistry, host, when });
let disposable = splash.show();
manager.ready.then(() => {
setTimeout(() => {
disposable.dispose();
}, 2500);
}, () => {
disposable.dispose();
});
return manager;
},
示例2: DisposableDelegate
execute: (args: IRouter.ILocation) => {
const { hash, path, search } = args;
const query = URLExt.queryStringToObject(search || '');
const reset = 'reset' in query;
const clone = 'clone' in query;
if (!reset) {
return;
}
// If a splash provider exists, launch the splash screen.
const loading = splash
? splash.show()
: new DisposableDelegate(() => undefined);
// If the state database has already been resolved, resetting is
// impossible without reloading.
if (resolved) {
return router.reload();
}
// Empty the state database.
resolved = true;
transform.resolve({ type: 'clear', contents: null });
// Maintain the query string parameters but remove `reset`.
delete query['reset'];
const silent = true;
const hard = true;
const url = path + URLExt.objectToQueryString(query) + hash;
const cleared = commands
.execute(CommandIDs.recoverState)
.then(() => router.stop); // Stop routing before new route navigation.
// After the state has been reset, navigate to the URL.
if (clone) {
void cleared.then(() => {
router.navigate(url, { silent, hard });
});
} else {
void cleared.then(() => {
router.navigate(url, { silent });
loading.dispose();
});
}
return cleared;
}