diff --git a/docs/development/core/public/kibana-plugin-public.plugin.md b/docs/development/core/public/kibana-plugin-public.plugin.md index 879897ec18d84..979436e6dab37 100644 --- a/docs/development/core/public/kibana-plugin-public.plugin.md +++ b/docs/development/core/public/kibana-plugin-public.plugin.md @@ -9,7 +9,7 @@ The interface that should be returned by a `PluginInitializer`. Signature: ```typescript -export interface Plugin +export interface Plugin ``` ## Methods diff --git a/docs/development/core/public/kibana-plugin-public.plugininitializer.md b/docs/development/core/public/kibana-plugin-public.plugininitializer.md index 3201e75e8aae3..0e1124afff369 100644 --- a/docs/development/core/public/kibana-plugin-public.plugininitializer.md +++ b/docs/development/core/public/kibana-plugin-public.plugininitializer.md @@ -9,5 +9,5 @@ The `plugin` export at the root of a plugin's `public` directory should conform Signature: ```typescript -export declare type PluginInitializer = {}, TPluginsStart extends Record = {}> = (core: PluginInitializerContext) => Plugin; +export declare type PluginInitializer = (core: PluginInitializerContext) => Plugin; ``` diff --git a/docs/development/core/server/kibana-plugin-server.plugin.md b/docs/development/core/server/kibana-plugin-server.plugin.md index 5cef833ecc30e..73faf020a4a16 100644 --- a/docs/development/core/server/kibana-plugin-server.plugin.md +++ b/docs/development/core/server/kibana-plugin-server.plugin.md @@ -9,7 +9,7 @@ The interface that should be returned by a `PluginInitializer`. Signature: ```typescript -export interface Plugin +export interface Plugin ``` ## Methods diff --git a/docs/development/core/server/kibana-plugin-server.plugininitializer.md b/docs/development/core/server/kibana-plugin-server.plugininitializer.md index 402b4001ce633..1254ed2c88da3 100644 --- a/docs/development/core/server/kibana-plugin-server.plugininitializer.md +++ b/docs/development/core/server/kibana-plugin-server.plugininitializer.md @@ -9,5 +9,5 @@ The `plugin` export at the root of a plugin's `server` directory should conform Signature: ```typescript -export declare type PluginInitializer = {}, TPluginsStart extends Record = {}> = (core: PluginInitializerContext) => Plugin; +export declare type PluginInitializer = (core: PluginInitializerContext) => Plugin; ``` diff --git a/src/core/public/plugins/plugin.ts b/src/core/public/plugins/plugin.ts index 5d40086336cdf..a24c19e3219f3 100644 --- a/src/core/public/plugins/plugin.ts +++ b/src/core/public/plugins/plugin.ts @@ -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; start(core: CoreStart, plugins: TPluginsStart): TStart | Promise; @@ -47,8 +47,8 @@ export interface Plugin< export type PluginInitializer< TSetup, TStart, - TPluginsSetup extends Record = {}, - TPluginsStart extends Record = {} + TPluginsSetup extends object = object, + TPluginsStart extends object = object > = (core: PluginInitializerContext) => Plugin; /** @@ -60,8 +60,8 @@ export type PluginInitializer< export class PluginWrapper< TSetup = unknown, TStart = unknown, - TPluginsSetup extends Record = Record, - TPluginsStart extends Record = Record + TPluginsSetup extends object = object, + TPluginsStart extends object = object > { public readonly name: DiscoveredPlugin['id']; public readonly configPath: DiscoveredPlugin['configPath']; diff --git a/src/core/public/plugins/plugin_context.ts b/src/core/public/plugins/plugin_context.ts index 022c71492f383..bc77b139a86dc 100644 --- a/src/core/public/plugins/plugin_context.ts +++ b/src/core/public/plugins/plugin_context.ts @@ -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, - TPluginsStart extends Record + 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, - TPluginsStart extends Record + TPluginsSetup extends object, + TPluginsStart extends object >( coreContext: CoreContext, deps: PluginsServiceStartDeps, diff --git a/src/core/public/plugins/plugin_loader.ts b/src/core/public/plugins/plugin_loader.ts index 9ec24adaabbe7..871091324a6b9 100644 --- a/src/core/public/plugins/plugin_loader.ts +++ b/src/core/public/plugins/plugin_loader.ts @@ -62,8 +62,8 @@ export const LOAD_TIMEOUT = 120 * 1000; // 2 minutes export const loadPluginBundle: LoadPluginBundle = < TSetup, TStart, - TPluginsSetup extends Record, - TPluginsStart extends Record + 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, - TPluginsStart extends Record + TPluginsSetup extends object, + TPluginsStart extends object >( addBasePath: (path: string) => string, pluginName: PluginName, diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index 55f2a25210321..36c5ed84cd248 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -475,7 +475,7 @@ export interface OverlayStart { } // @public -export interface Plugin { +export interface Plugin { // (undocumented) setup(core: CoreSetup, plugins: TPluginsSetup): TSetup | Promise; // (undocumented) @@ -485,7 +485,7 @@ export interface Plugin = {}, TPluginsStart extends Record = {}> = (core: PluginInitializerContext) => Plugin; +export type PluginInitializer = (core: PluginInitializerContext) => Plugin; // @public export interface PluginInitializerContext { diff --git a/src/core/server/plugins/plugin.ts b/src/core/server/plugins/plugin.ts index 3f24d44992b37..289f6f7cda7ac 100644 --- a/src/core/server/plugins/plugin.ts +++ b/src/core/server/plugins/plugin.ts @@ -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; start(core: CoreStart, plugins: TPluginsStart): TStart | Promise; @@ -155,8 +155,8 @@ export interface Plugin< export type PluginInitializer< TSetup, TStart, - TPluginsSetup extends Record = {}, - TPluginsStart extends Record = {} + TPluginsSetup extends object = object, + TPluginsStart extends object = object > = (core: PluginInitializerContext) => Plugin; /** @@ -168,8 +168,8 @@ export type PluginInitializer< export class PluginWrapper< TSetup = unknown, TStart = unknown, - TPluginsSetup extends Record = Record, - TPluginsStart extends Record = Record + TPluginsSetup extends object = object, + TPluginsStart extends object = object > { public readonly name: PluginManifest['id']; public readonly configPath: PluginManifest['configPath']; diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md index 952a4e7ba815e..0fefb2d80892e 100644 --- a/src/core/server/server.api.md +++ b/src/core/server/server.api.md @@ -331,7 +331,7 @@ export interface OnPreAuthToolkit { } // @public -export interface Plugin { +export interface Plugin { // (undocumented) setup(core: CoreSetup, plugins: TPluginsSetup): TSetup | Promise; // (undocumented) @@ -341,7 +341,7 @@ export interface Plugin = {}, TPluginsStart extends Record = {}> = (core: PluginInitializerContext) => Plugin; +export type PluginInitializer = (core: PluginInitializerContext) => Plugin; // @public export interface PluginInitializerContext {