Skip to main content

Class: HostSDK

Defined in: host/hostSDK.ts:53

The Host SDK is designed for integration within the host application that serves as the container for Myop components.

It provides essential functionalities and APIs for registering, managing, and communicating with Myop components.

This SDK enables seamless embedding of independently developed components into the host application, ensuring smooth interoperability and consistent user experience across various Myop component implementations.

Constructors​

new HostSDK()​

new HostSDK(): HostSDK

Returns​

HostSDK

Properties​

components​

components: IMyopComponent[] = []

Defined in: host/hostSDK.ts:57


components2init​

components2init: IMyopComponent[] = []

Defined in: host/hostSDK.ts:56


componentsLoaders​

componentsLoaders: IMyopLoader[] = []

Defined in: host/hostSDK.ts:58


initiated​

initiated: boolean = false

Defined in: host/hostSDK.ts:60


loaderHooks?​

optional loaderHooks: loaderHooks

Defined in: host/hostSDK.ts:309


type2InstanceCount​

type2InstanceCount: Record<string, number> = {}

Defined in: host/hostSDK.ts:64


version​

version: any

Defined in: host/hostSDK.ts:62

Methods​

assignId()​

assignId(componentDefinition): string

Defined in: host/hostSDK.ts:65

Parameters​

componentDefinition​

IComponentDefinitionConfig

Returns​

string


init()​

init(customComponentLoaderCreators?): void

Defined in: host/hostSDK.ts:192

Parameters​

customComponentLoaderCreators?​

componentLoaderCreator[]

Returns​

void


inspect()​

inspect(): void

Defined in: host/hostSDK.ts:75

Returns​

void


loadComponent()​

loadComponent<T>(componentConfig, container?, options?): Promise<T>

Defined in: host/hostSDK.ts:311

Type Parameters​

• T extends IMyopComponent = IMyopComponent

Parameters​

componentConfig​

IComponentConfig

container?​

Ref | HTMLElement

options?​

loaderOptions

Returns​

Promise<T>


navigate<T>(component, newComponentConfig, options?): Promise<T>

Defined in: host/hostSDK.ts:443

Type Parameters​

• T extends IMyopComponent = IMyopComponent

Parameters​

component​

IMyopComponent

newComponentConfig​

IComponentConfig

options?​

navigationOptions

Returns​

Promise<T>


send()​

send(message): void

Defined in: host/hostSDK.ts:184

Parameters​

message​

BaseMyopMessage

Returns​

void


Instance()​

static Instance(): HostSDK

Defined in: host/hostSDK.ts:54

Returns​

HostSDK