Skip to main content

Class: HostSDK

Defined in: host/hostSDK.ts:55

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:59


components2init​

components2init: IMyopComponent[] = []

Defined in: host/hostSDK.ts:58


componentsLoaders​

componentsLoaders: IMyopLoader[] = []

Defined in: host/hostSDK.ts:60


initiated​

initiated: boolean = false

Defined in: host/hostSDK.ts:68


loaderHooks?​

optional loaderHooks: loaderHooks

Defined in: host/hostSDK.ts:356


type2InstanceCount​

type2InstanceCount: Record<string, number> = {}

Defined in: host/hostSDK.ts:72


version​

version: any

Defined in: host/hostSDK.ts:70

Methods​

assignId()​

assignId(componentDefinition): string

Defined in: host/hostSDK.ts:73

Parameters​

componentDefinition​

IComponentDefinitionConfig

Returns​

string


getRenderPolicy()​

getRenderPolicy(): undefined | RenderPolicy

Defined in: host/hostSDK.ts:66

Returns​

undefined | RenderPolicy


init()​

init(customComponentLoaderCreators?): void

Defined in: host/hostSDK.ts:231

Parameters​

customComponentLoaderCreators?​

componentLoaderCreator[]

Returns​

void


inspect()​

inspect(): void

Defined in: host/hostSDK.ts:83

Returns​

void


loadComponent()​

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

Defined in: host/hostSDK.ts:358

Type Parameters​

• T extends IMyopComponent = IMyopComponent

Parameters​

componentConfig​

IComponentConfig

container?​

HTMLElement | Ref

options?​

loaderOptions

Returns​

Promise<T>


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

Defined in: host/hostSDK.ts:520

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:223

Parameters​

message​

BaseMyopMessage

Returns​

void


setRenderPolicy()​

setRenderPolicy(policy?): void

Defined in: host/hostSDK.ts:65

Parameters​

policy?​

RenderPolicy

Returns​

void


Instance()​

static Instance(): HostSDK

Defined in: host/hostSDK.ts:56

Returns​

HostSDK