import { i18n } from '@osd/i18n' ; import { ContainerOutput , EmbeddableFactory , EmbeddableFactoryDefinition , EmbeddableStart , } from '../../../../src/plugins/embeddable/public' ; import { SEARCHABLE_LIST_CONTAINER , SearchableListContainer , SearchableContainerInput , } from './searchable_list_container' ; interface StartServices { embeddableServices : EmbeddableStart ; } export type SearchableListContainerFactory = EmbeddableFactory < SearchableContainerInput , ContainerOutput > ; export class SearchableListContainerFactoryDefinition implements EmbeddableFactoryDefinition < SearchableContainerInput , ContainerOutput > { public readonly type = SEARCHABLE_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 SearchableListContainer ( initialInput , embeddableServices ) ; } ; public getDisplayName ( ) { return i18n . translate ( 'embeddableExamples.searchableListContainer.displayName' , { defaultMessage : 'Searchable list container' , } ) ; } }