kibana/examples/locator_examples/public/plugin.tsx
Vadim Dalecky 82e32faf1a
Locator docs (#103129)
* feat: 🎸 add locator_examples plugin

* feat: 🎸 add example app in locator_examples

* feat: 🎸 add locator_explorer plugin

* chore: 🤖 remove url_generaotrs_* example plugins

* docs: ✏️ update share plugin readme

* docs: ✏️ add locators readme

* docs: ✏️ update docs link in example plugin

* docs: ✏️ update navigation docs

* fix: 🐛 make P extend SerializableState

* test: 💍 update test mocks

* fix: 🐛 use correct type in ingest pipeline locator

* test: 💍 add missing methods in mock

* test: 💍 update test mocks

* chore: 🤖 update plugin list

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-06-28 21:44:11 +02:00

54 lines
1.5 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { SharePluginStart, SharePluginSetup } from '../../../src/plugins/share/public';
import { Plugin, CoreSetup, AppMountParameters, AppNavLinkStatus } from '../../../src/core/public';
import { HelloLocator, HelloLocatorDefinition } from './locator';
interface SetupDeps {
share: SharePluginSetup;
}
interface StartDeps {
share: SharePluginStart;
}
export interface LocatorExamplesSetup {
locator: HelloLocator;
}
export class LocatorExamplesPlugin
implements Plugin<LocatorExamplesSetup, void, SetupDeps, StartDeps> {
public setup(core: CoreSetup<StartDeps>, plugins: SetupDeps) {
const locator = plugins.share.url.locators.create(new HelloLocatorDefinition());
core.application.register({
id: 'locatorExamples',
title: 'Access links examples',
navLinkStatus: AppNavLinkStatus.hidden,
async mount(params: AppMountParameters) {
const { renderApp } = await import('./app');
return renderApp(
{
appBasePath: params.appBasePath,
},
params
);
},
});
return {
locator,
};
}
public start() {}
public stop() {}
}