Skip to content

Commit

Permalink
Add ApplicationService mounting
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdover committed Aug 1, 2019
1 parent c9ef9b4 commit 52ece80
Show file tree
Hide file tree
Showing 65 changed files with 1,510 additions and 238 deletions.
20 changes: 20 additions & 0 deletions docs/development/core/public/kibana-plugin-public.app.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [App](./kibana-plugin-public.app.md)

## App interface

Extension of with the mount function.

<b>Signature:</b>

```typescript
export interface App extends AppBase
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [mount](./kibana-plugin-public.app.mount.md) | <code>(context: ApplicationContext, targetDomElement: HTMLElement) =&gt; AppUnmount &#124; Promise&lt;AppUnmount&gt;</code> | A mount function called when the user navigates to this app's <code>rootRoute</code>. |
13 changes: 13 additions & 0 deletions docs/development/core/public/kibana-plugin-public.app.mount.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [App](./kibana-plugin-public.app.md) &gt; [mount](./kibana-plugin-public.app.mount.md)

## App.mount property

A mount function called when the user navigates to this app's `rootRoute`<!-- -->.

<b>Signature:</b>

```typescript
mount: (context: ApplicationContext, targetDomElement: HTMLElement) => AppUnmount | Promise<AppUnmount>;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [AppBase](./kibana-plugin-public.appbase.md) &gt; [capabilities](./kibana-plugin-public.appbase.capabilities.md)

## AppBase.capabilities property

Custom capabilities defined by the app.

<b>Signature:</b>

```typescript
capabilities?: Partial<Capabilities>;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [AppBase](./kibana-plugin-public.appbase.md) &gt; [euiIconType](./kibana-plugin-public.appbase.euiicontype.md)

## AppBase.euiIconType property

A EUI iconType that will be used for the app's icon. This icon takes precendence over the `icon` property.

<b>Signature:</b>

```typescript
euiIconType?: string;
```
13 changes: 13 additions & 0 deletions docs/development/core/public/kibana-plugin-public.appbase.icon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [AppBase](./kibana-plugin-public.appbase.md) &gt; [icon](./kibana-plugin-public.appbase.icon.md)

## AppBase.icon property

A URL to an image file used as an icon. Used as a fallback if `euiIconType` is not provided.

<b>Signature:</b>

```typescript
icon?: string;
```
11 changes: 11 additions & 0 deletions docs/development/core/public/kibana-plugin-public.appbase.id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [AppBase](./kibana-plugin-public.appbase.md) &gt; [id](./kibana-plugin-public.appbase.id.md)

## AppBase.id property

<b>Signature:</b>

```typescript
id: string;
```
25 changes: 25 additions & 0 deletions docs/development/core/public/kibana-plugin-public.appbase.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [AppBase](./kibana-plugin-public.appbase.md)

## AppBase interface


<b>Signature:</b>

```typescript
export interface AppBase
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [capabilities](./kibana-plugin-public.appbase.capabilities.md) | <code>Partial&lt;Capabilities&gt;</code> | Custom capabilities defined by the app. |
| [euiIconType](./kibana-plugin-public.appbase.euiicontype.md) | <code>string</code> | A EUI iconType that will be used for the app's icon. This icon takes precendence over the <code>icon</code> property. |
| [icon](./kibana-plugin-public.appbase.icon.md) | <code>string</code> | A URL to an image file used as an icon. Used as a fallback if <code>euiIconType</code> is not provided. |
| [id](./kibana-plugin-public.appbase.id.md) | <code>string</code> | |
| [order](./kibana-plugin-public.appbase.order.md) | <code>number</code> | An ordinal used to sort nav links relative to one another for display. |
| [title](./kibana-plugin-public.appbase.title.md) | <code>string</code> | The title of the application. |
| [tooltip$](./kibana-plugin-public.appbase.tooltip$.md) | <code>Observable&lt;string&gt;</code> | An observable for a tooltip shown when hovering over app link. |

13 changes: 13 additions & 0 deletions docs/development/core/public/kibana-plugin-public.appbase.order.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [AppBase](./kibana-plugin-public.appbase.md) &gt; [order](./kibana-plugin-public.appbase.order.md)

## AppBase.order property

An ordinal used to sort nav links relative to one another for display.

<b>Signature:</b>

```typescript
order: number;
```
13 changes: 13 additions & 0 deletions docs/development/core/public/kibana-plugin-public.appbase.title.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [AppBase](./kibana-plugin-public.appbase.md) &gt; [title](./kibana-plugin-public.appbase.title.md)

## AppBase.title property

The title of the application.

<b>Signature:</b>

```typescript
title: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [AppBase](./kibana-plugin-public.appbase.md) &gt; [tooltip$](./kibana-plugin-public.appbase.tooltip$.md)

## AppBase.tooltip$ property

An observable for a tooltip shown when hovering over app link.

<b>Signature:</b>

```typescript
tooltip$?: Observable<string>;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ApplicationContext](./kibana-plugin-public.applicationcontext.md) &gt; [core](./kibana-plugin-public.applicationcontext.core.md)

## ApplicationContext.core property

Core service APIs available to mounted applications.

<b>Signature:</b>

```typescript
core: {
chrome: ChromeStart;
docLinks: DocLinksStart;
http: HttpStart;
i18n: I18nStart;
notifications: NotificationsStart;
overlays: OverlayStart;
uiSettings: UiSettingsClientContract;
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ApplicationContext](./kibana-plugin-public.applicationcontext.md)

## ApplicationContext interface

The context object received when applications are mounted to the DOM.

<b>Signature:</b>

```typescript
export interface ApplicationContext
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [core](./kibana-plugin-public.applicationcontext.core.md) | <code>{</code><br/><code> chrome: ChromeStart;</code><br/><code> docLinks: DocLinksStart;</code><br/><code> http: HttpStart;</code><br/><code> i18n: I18nStart;</code><br/><code> notifications: NotificationsStart;</code><br/><code> overlays: OverlayStart;</code><br/><code> uiSettings: UiSettingsClientContract;</code><br/><code> }</code> | Core service APIs available to mounted applications. |

## Methods

| Method | Description |
| --- | --- |
| [navigateToApp(appId, path)](./kibana-plugin-public.applicationcontext.navigatetoapp.md) | Unmounts the current application and navigates to the given app and optional path. |

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ApplicationContext](./kibana-plugin-public.applicationcontext.md) &gt; [navigateToApp](./kibana-plugin-public.applicationcontext.navigatetoapp.md)

## ApplicationContext.navigateToApp() method

Unmounts the current application and navigates to the given app and optional path.

<b>Signature:</b>

```typescript
navigateToApp(appId: string, path?: string): void;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| appId | <code>string</code> | |
| path | <code>string</code> | |

<b>Returns:</b>

`void`

Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ export interface ApplicationSetup

| Method | Description |
| --- | --- |
| [registerApp(app)](./kibana-plugin-public.applicationsetup.registerapp.md) | Register an mountable application to the system. Apps will be mounted based on their <code>rootRoute</code>. |
| [registerApp(plugin, app)](./kibana-plugin-public.applicationsetup.registerapp.md) | Register an mountable application to the system. Apps will be mounted based on their <code>rootRoute</code>. |
| [registerMountContext(pluginOpaqueId, contextName, provider)](./kibana-plugin-public.applicationsetup.registermountcontext.md) | Register a context provider for application mounting. Will only be available to applications that depend on the plugin that registered this context. |

Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ Register an mountable application to the system. Apps will be mounted based on t
<b>Signature:</b>

```typescript
registerApp(app: App): void;
registerApp(plugin: PluginOpaqueId, app: App): void;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| plugin | <code>PluginOpaqueId</code> | opaque ID of the plugin that registers this application |
| app | <code>App</code> | |

<b>Returns:</b>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ApplicationSetup](./kibana-plugin-public.applicationsetup.md) &gt; [registerMountContext](./kibana-plugin-public.applicationsetup.registermountcontext.md)

## ApplicationSetup.registerMountContext() method

Register a context provider for application mounting. Will only be available to applications that depend on the plugin that registered this context.

<b>Signature:</b>

```typescript
registerMountContext<T extends keyof ApplicationContext>(pluginOpaqueId: PluginOpaqueId, contextName: T, provider: IContextProvider<ApplicationContext, keyof ApplicationContext>): void;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| pluginOpaqueId | <code>PluginOpaqueId</code> | The opaque ID of the plugin that is registering the context. |
| contextName | <code>T</code> | The key of [ApplicationContext](./kibana-plugin-public.applicationcontext.md) this provider's return value should be attached to. |
| provider | <code>IContextProvider&lt;ApplicationContext, keyof ApplicationContext&gt;</code> | A [IContextProvider](./kibana-plugin-public.icontextprovider.md) function |
<b>Returns:</b>
`void`
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ Apps available based on the current capabilities. Should be used to show navigat
<b>Signature:</b>

```typescript
availableApps: readonly App[];
availableApps: ReadonlyMap<string, App>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ export interface ApplicationStart

| Property | Type | Description |
| --- | --- | --- |
| [availableApps](./kibana-plugin-public.applicationstart.availableapps.md) | <code>readonly App[]</code> | Apps available based on the current capabilities. Should be used to show navigation links and make routing decisions. |
| [availableApps](./kibana-plugin-public.applicationstart.availableapps.md) | <code>ReadonlyMap&lt;string, App&gt;</code> | Apps available based on the current capabilities. Should be used to show navigation links and make routing decisions. |
| [capabilities](./kibana-plugin-public.applicationstart.capabilities.md) | <code>RecursiveReadonly&lt;Capabilities&gt;</code> | Gets the read-only capabilities. |

## Methods

| Method | Description |
| --- | --- |
| [navigateToApp(appId, path)](./kibana-plugin-public.applicationstart.navigatetoapp.md) | Navigiate to a given app |
| [registerMountContext(pluginOpaqueId, contextName, provider)](./kibana-plugin-public.applicationstart.registermountcontext.md) | Register a context provider for application mounting. Will only be available to applications that depend on the plugin that registered this context. |

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ApplicationStart](./kibana-plugin-public.applicationstart.md) &gt; [navigateToApp](./kibana-plugin-public.applicationstart.navigatetoapp.md)

## ApplicationStart.navigateToApp() method

Navigiate to a given app

<b>Signature:</b>

```typescript
navigateToApp(appId: string, path?: string): void;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| appId | <code>string</code> | |
| path | <code>string</code> | |

<b>Returns:</b>

`void`

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ApplicationStart](./kibana-plugin-public.applicationstart.md) &gt; [registerMountContext](./kibana-plugin-public.applicationstart.registermountcontext.md)

## ApplicationStart.registerMountContext() method

Register a context provider for application mounting. Will only be available to applications that depend on the plugin that registered this context.

<b>Signature:</b>

```typescript
registerMountContext<T extends keyof ApplicationContext>(pluginOpaqueId: PluginOpaqueId, contextName: T, provider: IContextProvider<ApplicationContext, T>): void;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| pluginOpaqueId | <code>PluginOpaqueId</code> | The opaque ID of the plugin that is registering the context. |
| contextName | <code>T</code> | The key of [ApplicationContext](./kibana-plugin-public.applicationcontext.md) this provider's return value should be attached to. |
| provider | <code>IContextProvider&lt;ApplicationContext, T&gt;</code> | A [IContextProvider](./kibana-plugin-public.icontextprovider.md) function |
<b>Returns:</b>
`void`
13 changes: 13 additions & 0 deletions docs/development/core/public/kibana-plugin-public.appunmount.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [AppUnmount](./kibana-plugin-public.appunmount.md)

## AppUnmount type

A function called when an application should be unmounted from the page. This function should be synchronous.

<b>Signature:</b>

```typescript
export declare type AppUnmount = () => void;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [CoreSetup](./kibana-plugin-public.coresetup.md) &gt; [application](./kibana-plugin-public.coresetup.application.md)

## CoreSetup.application property

[ApplicationSetup](./kibana-plugin-public.applicationsetup.md)

<b>Signature:</b>

```typescript
application: ApplicationSetup;
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface CoreSetup

| Property | Type | Description |
| --- | --- | --- |
| [application](./kibana-plugin-public.coresetup.application.md) | <code>ApplicationSetup</code> | [ApplicationSetup](./kibana-plugin-public.applicationsetup.md) |
| [context](./kibana-plugin-public.coresetup.context.md) | <code>ContextSetup</code> | [ContextSetup](./kibana-plugin-public.contextsetup.md) |
| [fatalErrors](./kibana-plugin-public.coresetup.fatalerrors.md) | <code>FatalErrorsSetup</code> | [FatalErrorsSetup](./kibana-plugin-public.fatalerrorssetup.md) |
| [http](./kibana-plugin-public.coresetup.http.md) | <code>HttpSetup</code> | [HttpSetup](./kibana-plugin-public.httpsetup.md) |
Expand Down
Loading

0 comments on commit 52ece80

Please sign in to comment.