import { i18n } from '@kbn/i18n' ; import { IContainer , EmbeddableFactoryDefinition , EmbeddableFactory , } from '../../../../src/plugins/embeddable/public' ; import { MultiTaskTodoEmbeddable , MULTI_TASK_TODO_EMBEDDABLE , MultiTaskTodoInput , MultiTaskTodoOutput , } from './multi_task_todo_embeddable' ; export type MultiTaskTodoEmbeddableFactory = EmbeddableFactory < MultiTaskTodoInput , MultiTaskTodoOutput , MultiTaskTodoEmbeddable > ; export class MultiTaskTodoEmbeddableFactoryDefinition implements EmbeddableFactoryDefinition < MultiTaskTodoInput , MultiTaskTodoOutput , MultiTaskTodoEmbeddable > { public readonly type = MULTI_TASK_TODO_EMBEDDABLE ; public async isEditable ( ) { return true ; } public async create ( initialInput , parent ? ) { return new MultiTaskTodoEmbeddable ( initialInput , parent ) ; } /**
     * Check out todo_embeddable_factory for a better example that asks for data from
     * the user. This just returns default data.  That's okay too though, if you want to
     * start with default data and expose an "edit" action to modify it.
     */ public async getExplicitInput ( ) { return { title : 'default title' , tasks : [ 'Im default data' ] } ; } public getDisplayName ( ) { return i18n . translate ( 'embeddableExamples.multiTaskTodo.displayName' , { defaultMessage : 'Multi-task todo item' , } ) ; } }