import { i18n } from '@kbn/i18n' ; import { EmbeddableFactoryDefinition , ContainerInput , EmbeddableStart , EmbeddableFactory , ContainerOutput , } from '../../../../src/plugins/embeddable/public' ; import { LIST_CONTAINER , ListContainer } from './list_container' ; interface StartServices { embeddableServices : EmbeddableStart ; } export type ListContainerFactory = EmbeddableFactory < ContainerInput , ContainerOutput > ; export class ListContainerFactoryDefinition implements EmbeddableFactoryDefinition < ContainerInput , ContainerOutput > { public readonly type = LIST_CONTAINER ; public readonly isContainerType = true ; constructor ( private getStartServices ) { } public async isEditable ( ) { return true ; } public create = async ( initialInput ) => { const { embeddableServices } = await this . getStartServices ( ) ; return new ListContainer ( initialInput , embeddableServices ) ; } ; public getDisplayName ( ) { return i18n . translate ( 'embeddableExamples.searchableListContainer.displayName' , { defaultMessage : 'List container' , } ) ; } }