mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* Narrow type of PluginDeps to an object * re-generate docs
This commit is contained in:
parent
245b82c3a4
commit
93e4815b61
10 changed files with 30 additions and 30 deletions
|
@ -9,7 +9,7 @@ The interface that should be returned by a `PluginInitializer`<!-- -->.
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface Plugin<TSetup = void, TStart = void, TPluginsSetup extends {} = {}, TPluginsStart extends {} = {}>
|
||||
export interface Plugin<TSetup = void, TStart = void, TPluginsSetup extends object = object, TPluginsStart extends object = object>
|
||||
```
|
||||
|
||||
## Methods
|
||||
|
|
|
@ -9,5 +9,5 @@ The `plugin` export at the root of a plugin's `public` directory should conform
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type PluginInitializer<TSetup, TStart, TPluginsSetup extends Record<string, any> = {}, TPluginsStart extends Record<string, any> = {}> = (core: PluginInitializerContext) => Plugin<TSetup, TStart, TPluginsSetup, TPluginsStart>;
|
||||
export declare type PluginInitializer<TSetup, TStart, TPluginsSetup extends object = object, TPluginsStart extends object = object> = (core: PluginInitializerContext) => Plugin<TSetup, TStart, TPluginsSetup, TPluginsStart>;
|
||||
```
|
||||
|
|
|
@ -9,7 +9,7 @@ The interface that should be returned by a `PluginInitializer`<!-- -->.
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface Plugin<TSetup = void, TStart = void, TPluginsSetup extends {} = {}, TPluginsStart extends {} = {}>
|
||||
export interface Plugin<TSetup = void, TStart = void, TPluginsSetup extends object = object, TPluginsStart extends object = object>
|
||||
```
|
||||
|
||||
## Methods
|
||||
|
|
|
@ -9,5 +9,5 @@ The `plugin` export at the root of a plugin's `server` directory should conform
|
|||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export declare type PluginInitializer<TSetup, TStart, TPluginsSetup extends Record<PluginName, unknown> = {}, TPluginsStart extends Record<PluginName, unknown> = {}> = (core: PluginInitializerContext) => Plugin<TSetup, TStart, TPluginsSetup, TPluginsStart>;
|
||||
export declare type PluginInitializer<TSetup, TStart, TPluginsSetup extends object = object, TPluginsStart extends object = object> = (core: PluginInitializerContext) => Plugin<TSetup, TStart, TPluginsSetup, TPluginsStart>;
|
||||
```
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { DiscoveredPlugin, PluginName } from '../../server';
|
||||
import { DiscoveredPlugin } from '../../server';
|
||||
import { PluginInitializerContext } from './plugin_context';
|
||||
import { loadPluginBundle } from './plugin_loader';
|
||||
import { CoreStart, CoreSetup } from '..';
|
||||
|
@ -30,8 +30,8 @@ import { CoreStart, CoreSetup } from '..';
|
|||
export interface Plugin<
|
||||
TSetup = void,
|
||||
TStart = void,
|
||||
TPluginsSetup extends {} = {},
|
||||
TPluginsStart extends {} = {}
|
||||
TPluginsSetup extends object = object,
|
||||
TPluginsStart extends object = object
|
||||
> {
|
||||
setup(core: CoreSetup, plugins: TPluginsSetup): TSetup | Promise<TSetup>;
|
||||
start(core: CoreStart, plugins: TPluginsStart): TStart | Promise<TStart>;
|
||||
|
@ -47,8 +47,8 @@ export interface Plugin<
|
|||
export type PluginInitializer<
|
||||
TSetup,
|
||||
TStart,
|
||||
TPluginsSetup extends Record<string, any> = {},
|
||||
TPluginsStart extends Record<string, any> = {}
|
||||
TPluginsSetup extends object = object,
|
||||
TPluginsStart extends object = object
|
||||
> = (core: PluginInitializerContext) => Plugin<TSetup, TStart, TPluginsSetup, TPluginsStart>;
|
||||
|
||||
/**
|
||||
|
@ -60,8 +60,8 @@ export type PluginInitializer<
|
|||
export class PluginWrapper<
|
||||
TSetup = unknown,
|
||||
TStart = unknown,
|
||||
TPluginsSetup extends Record<PluginName, any> = Record<PluginName, unknown>,
|
||||
TPluginsStart extends Record<PluginName, any> = Record<PluginName, unknown>
|
||||
TPluginsSetup extends object = object,
|
||||
TPluginsStart extends object = object
|
||||
> {
|
||||
public readonly name: DiscoveredPlugin['id'];
|
||||
public readonly configPath: DiscoveredPlugin['configPath'];
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
import { omit } from 'lodash';
|
||||
|
||||
import { DiscoveredPlugin, PluginName } from '../../server';
|
||||
import { DiscoveredPlugin } from '../../server';
|
||||
import { CoreContext } from '../core_system';
|
||||
import { PluginWrapper } from './plugin';
|
||||
import { PluginsServiceSetupDeps, PluginsServiceStartDeps } from './plugins_service';
|
||||
|
@ -61,8 +61,8 @@ export function createPluginInitializerContext(
|
|||
export function createPluginSetupContext<
|
||||
TSetup,
|
||||
TStart,
|
||||
TPluginsSetup extends Record<PluginName, unknown>,
|
||||
TPluginsStart extends Record<PluginName, unknown>
|
||||
TPluginsSetup extends object,
|
||||
TPluginsStart extends object
|
||||
>(
|
||||
coreContext: CoreContext,
|
||||
deps: PluginsServiceSetupDeps,
|
||||
|
@ -89,8 +89,8 @@ export function createPluginSetupContext<
|
|||
export function createPluginStartContext<
|
||||
TSetup,
|
||||
TStart,
|
||||
TPluginsSetup extends Record<PluginName, unknown>,
|
||||
TPluginsStart extends Record<PluginName, unknown>
|
||||
TPluginsSetup extends object,
|
||||
TPluginsStart extends object
|
||||
>(
|
||||
coreContext: CoreContext,
|
||||
deps: PluginsServiceStartDeps,
|
||||
|
|
|
@ -62,8 +62,8 @@ export const LOAD_TIMEOUT = 120 * 1000; // 2 minutes
|
|||
export const loadPluginBundle: LoadPluginBundle = <
|
||||
TSetup,
|
||||
TStart,
|
||||
TPluginsSetup extends Record<string, unknown>,
|
||||
TPluginsStart extends Record<string, unknown>
|
||||
TPluginsSetup extends object,
|
||||
TPluginsStart extends object
|
||||
>(
|
||||
addBasePath: (path: string) => string,
|
||||
pluginName: PluginName,
|
||||
|
@ -125,8 +125,8 @@ export const loadPluginBundle: LoadPluginBundle = <
|
|||
export type LoadPluginBundle = <
|
||||
TSetup,
|
||||
TStart,
|
||||
TPluginsSetup extends Record<string, unknown>,
|
||||
TPluginsStart extends Record<string, unknown>
|
||||
TPluginsSetup extends object,
|
||||
TPluginsStart extends object
|
||||
>(
|
||||
addBasePath: (path: string) => string,
|
||||
pluginName: PluginName,
|
||||
|
|
|
@ -475,7 +475,7 @@ export interface OverlayStart {
|
|||
}
|
||||
|
||||
// @public
|
||||
export interface Plugin<TSetup = void, TStart = void, TPluginsSetup extends {} = {}, TPluginsStart extends {} = {}> {
|
||||
export interface Plugin<TSetup = void, TStart = void, TPluginsSetup extends object = object, TPluginsStart extends object = object> {
|
||||
// (undocumented)
|
||||
setup(core: CoreSetup, plugins: TPluginsSetup): TSetup | Promise<TSetup>;
|
||||
// (undocumented)
|
||||
|
@ -485,7 +485,7 @@ export interface Plugin<TSetup = void, TStart = void, TPluginsSetup extends {} =
|
|||
}
|
||||
|
||||
// @public
|
||||
export type PluginInitializer<TSetup, TStart, TPluginsSetup extends Record<string, any> = {}, TPluginsStart extends Record<string, any> = {}> = (core: PluginInitializerContext) => Plugin<TSetup, TStart, TPluginsSetup, TPluginsStart>;
|
||||
export type PluginInitializer<TSetup, TStart, TPluginsSetup extends object = object, TPluginsStart extends object = object> = (core: PluginInitializerContext) => Plugin<TSetup, TStart, TPluginsSetup, TPluginsStart>;
|
||||
|
||||
// @public
|
||||
export interface PluginInitializerContext {
|
||||
|
|
|
@ -138,8 +138,8 @@ export interface DiscoveredPluginInternal extends DiscoveredPlugin {
|
|||
export interface Plugin<
|
||||
TSetup = void,
|
||||
TStart = void,
|
||||
TPluginsSetup extends {} = {},
|
||||
TPluginsStart extends {} = {}
|
||||
TPluginsSetup extends object = object,
|
||||
TPluginsStart extends object = object
|
||||
> {
|
||||
setup(core: CoreSetup, plugins: TPluginsSetup): TSetup | Promise<TSetup>;
|
||||
start(core: CoreStart, plugins: TPluginsStart): TStart | Promise<TStart>;
|
||||
|
@ -155,8 +155,8 @@ export interface Plugin<
|
|||
export type PluginInitializer<
|
||||
TSetup,
|
||||
TStart,
|
||||
TPluginsSetup extends Record<PluginName, unknown> = {},
|
||||
TPluginsStart extends Record<PluginName, unknown> = {}
|
||||
TPluginsSetup extends object = object,
|
||||
TPluginsStart extends object = object
|
||||
> = (core: PluginInitializerContext) => Plugin<TSetup, TStart, TPluginsSetup, TPluginsStart>;
|
||||
|
||||
/**
|
||||
|
@ -168,8 +168,8 @@ export type PluginInitializer<
|
|||
export class PluginWrapper<
|
||||
TSetup = unknown,
|
||||
TStart = unknown,
|
||||
TPluginsSetup extends Record<PluginName, unknown> = Record<PluginName, unknown>,
|
||||
TPluginsStart extends Record<PluginName, unknown> = Record<PluginName, unknown>
|
||||
TPluginsSetup extends object = object,
|
||||
TPluginsStart extends object = object
|
||||
> {
|
||||
public readonly name: PluginManifest['id'];
|
||||
public readonly configPath: PluginManifest['configPath'];
|
||||
|
|
|
@ -331,7 +331,7 @@ export interface OnPreAuthToolkit {
|
|||
}
|
||||
|
||||
// @public
|
||||
export interface Plugin<TSetup = void, TStart = void, TPluginsSetup extends {} = {}, TPluginsStart extends {} = {}> {
|
||||
export interface Plugin<TSetup = void, TStart = void, TPluginsSetup extends object = object, TPluginsStart extends object = object> {
|
||||
// (undocumented)
|
||||
setup(core: CoreSetup, plugins: TPluginsSetup): TSetup | Promise<TSetup>;
|
||||
// (undocumented)
|
||||
|
@ -341,7 +341,7 @@ export interface Plugin<TSetup = void, TStart = void, TPluginsSetup extends {} =
|
|||
}
|
||||
|
||||
// @public
|
||||
export type PluginInitializer<TSetup, TStart, TPluginsSetup extends Record<PluginName, unknown> = {}, TPluginsStart extends Record<PluginName, unknown> = {}> = (core: PluginInitializerContext) => Plugin<TSetup, TStart, TPluginsSetup, TPluginsStart>;
|
||||
export type PluginInitializer<TSetup, TStart, TPluginsSetup extends object = object, TPluginsStart extends object = object> = (core: PluginInitializerContext) => Plugin<TSetup, TStart, TPluginsSetup, TPluginsStart>;
|
||||
|
||||
// @public
|
||||
export interface PluginInitializerContext<ConfigSchema = unknown> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue