import { i18n } from '@osd/i18n' ; import { IContainer , EmbeddableInput , EmbeddableFactoryDefinition , EmbeddableFactory , } from '../../../../src/plugins/embeddable/public' ; import { HelloWorldEmbeddable , HELLO_WORLD_EMBEDDABLE } from './hello_world_embeddable' ; export type HelloWorldEmbeddableFactory = EmbeddableFactory ; export class HelloWorldEmbeddableFactoryDefinition implements EmbeddableFactoryDefinition { public readonly type = HELLO_WORLD_EMBEDDABLE ; /**
     * In our simple example, we let everyone have permissions to edit this. Most
     * embeddables should check the UI Capabilities service to be sure of
     * the right permissions.
     */ public async isEditable ( ) { return true ; } public async create ( initialInput , parent ? ) { return new HelloWorldEmbeddable ( initialInput , parent ) ; } public getDisplayName ( ) { return i18n . translate ( 'embeddableExamples.helloworld.displayName' , { defaultMessage : 'hello world' , } ) ; } }