1717 * under the License.
1818 */
1919
20- import { Plugin , CoreSetup } from '../../../src/core/public' ;
21- import { UiActionsSetup } from '../../../src/plugins/ui_actions/public' ;
20+ import { Plugin , CoreSetup , CoreStart } from '../../../src/core/public' ;
21+ import { UiActionsSetup , UiActionsStart } from '../../../src/plugins/ui_actions/public' ;
2222import { createHelloWorldAction , ACTION_HELLO_WORLD } from './hello_world_action' ;
2323import { helloWorldTrigger , HELLO_WORLD_TRIGGER_ID } from './hello_world_trigger' ;
2424
25- interface UiActionExamplesSetupDependencies {
25+ export interface UiActionExamplesSetupDependencies {
2626 uiActions : UiActionsSetup ;
2727}
2828
29+ export interface UiActionExamplesStartDependencies {
30+ uiActions : UiActionsStart ;
31+ }
32+
2933declare module '../../../src/plugins/ui_actions/public' {
3034 export interface TriggerContextMapping {
3135 [ HELLO_WORLD_TRIGGER_ID ] : { } ;
@@ -37,18 +41,23 @@ declare module '../../../src/plugins/ui_actions/public' {
3741}
3842
3943export class UiActionExamplesPlugin
40- implements Plugin < void , void , UiActionExamplesSetupDependencies > {
41- public setup ( core : CoreSetup , { uiActions } : UiActionExamplesSetupDependencies ) {
44+ implements
45+ Plugin < void , void , UiActionExamplesSetupDependencies , UiActionExamplesStartDependencies > {
46+ public setup (
47+ core : CoreSetup < UiActionExamplesStartDependencies > ,
48+ { uiActions } : UiActionExamplesSetupDependencies
49+ ) {
4250 uiActions . registerTrigger ( helloWorldTrigger ) ;
4351
4452 const helloWorldAction = createHelloWorldAction ( async ( ) => ( {
4553 openModal : ( await core . getStartServices ( ) ) [ 0 ] . overlays . openModal ,
4654 } ) ) ;
4755
4856 uiActions . registerAction ( helloWorldAction ) ;
49- uiActions . attachAction ( helloWorldTrigger . id , helloWorldAction ) ;
57+ uiActions . addTriggerAction ( helloWorldTrigger . id , helloWorldAction ) ;
5058 }
5159
52- public start ( ) { }
60+ public start ( core : CoreStart , plugins : UiActionExamplesStartDependencies ) { }
61+
5362 public stop ( ) { }
5463}
0 commit comments