Skip to main content

Class: MyopExtractedWebComponent

Defined in: host/components/myopExtractedWebComponent.ts:14

Component wrapper for Myop Web Components that are extracted from HTML and run directly on the host document (not in an iframe).

These components use the native Web Components API (Custom Elements + Shadow DOM) and communicate via direct method calls and CustomEvents instead of postMessage.

Extends

Constructors

new MyopExtractedWebComponent()

new MyopExtractedWebComponent(componentDefinition, skin, container, customElement, tagName, options?): MyopExtractedWebComponent

Defined in: host/components/myopExtractedWebComponent.ts:19

Parameters

componentDefinition

IComponentDefinitionConfig

skin

ISkinConfig

container

HTMLElement

customElement

HTMLElement

tagName

string

options?

loaderOptions

Returns

MyopExtractedWebComponent

Overrides

BaseMyopComponent.constructor

Properties

_markedForDisposed

_markedForDisposed: boolean = false

Defined in: host/components/IMyopComponent.ts:151

Inherited from

BaseMyopComponent._markedForDisposed


_whenInitiated

_whenInitiated: Promise<any>

Defined in: host/components/IMyopComponent.ts:255

Inherited from

BaseMyopComponent._whenInitiated


_whenInitiatedReject()?

optional _whenInitiatedReject: (value?) => any

Defined in: host/components/IMyopComponent.ts:253

Parameters

value?

any

Returns

any

Inherited from

BaseMyopComponent._whenInitiatedReject


_whenInitiatedResolve()?

optional _whenInitiatedResolve: (value?) => any

Defined in: host/components/IMyopComponent.ts:252

Parameters

value?

any

Returns

any

Inherited from

BaseMyopComponent._whenInitiatedResolve


cleanupInspect

cleanupInspect: CleanupHandler

Defined in: host/components/myopExtractedWebComponent.ts:34


componentDefinition

componentDefinition: IComponentDefinitionConfig

Defined in: host/components/IMyopComponent.ts:133

Inherited from

BaseMyopComponent.componentDefinition


container

container: HTMLElement

Defined in: host/components/myopExtractedWebComponent.ts:22

Inherited from

BaseMyopComponent.container


element?

optional element: HTMLElement

Defined in: host/components/IMyopComponent.ts:131

Inherited from

BaseMyopComponent.element


id

id: string = ''

Defined in: host/components/IMyopComponent.ts:127

Inherited from

BaseMyopComponent.id


isInitiated

isInitiated: boolean = false

Defined in: host/components/IMyopComponent.ts:250

Inherited from

BaseMyopComponent.isInitiated


messageHandlers

messageHandlers: Record<string, messageHandler<any>[]> = {}

Defined in: host/components/IMyopComponent.ts:129

Inherited from

BaseMyopComponent.messageHandlers


props

props: any

Defined in: host/components/IMyopComponent.ts:366

Inherited from

BaseMyopComponent.props


refs

refs: RefTypes

Defined in: host/components/IMyopComponent.ts:367

Inherited from

BaseMyopComponent.refs

Accessors

markedForDisposed

Get Signature

get markedForDisposed(): boolean

Defined in: host/components/IMyopComponent.ts:153

Returns

boolean

Set Signature

set markedForDisposed(value): void

Defined in: host/components/IMyopComponent.ts:157

Parameters
value

boolean

Returns

void

Inherited from

BaseMyopComponent.markedForDisposed

Methods

bind()

bind<T>(messageType, handler): void

Defined in: host/components/IMyopComponent.ts:171

Type Parameters

T extends BaseMyopMessage

Parameters

messageType

string

handler

(message) => boolean

Returns

void

Inherited from

BaseMyopComponent.bind


bindWhen()

bindWhen<T>(messageType, predicate, handler): CleanupHandler

Defined in: host/components/IMyopComponent.ts:182

Type Parameters

T extends BaseMyopMessage

Parameters

messageType

string

predicate

(message) => boolean

handler

(message) => void

Returns

CleanupHandler

Inherited from

BaseMyopComponent.bindWhen


dispose()

dispose(): void

Defined in: host/components/myopExtractedWebComponent.ts:138

Returns

void

Overrides

BaseMyopComponent.dispose


getData()

getData(): unknown

Defined in: host/components/myopExtractedWebComponent.ts:71

Get current data from the component

Returns

unknown


hide()

hide(): void

Defined in: host/components/myopExtractedWebComponent.ts:41

Returns

void

Overrides

BaseMyopComponent.hide


initiated()

initiated(): Promise<any>

Defined in: host/components/IMyopComponent.ts:260

Returns

Promise<any>

Inherited from

BaseMyopComponent.initiated


initWithData()

initWithData(data): void

Defined in: host/components/myopExtractedWebComponent.ts:62

Initialize the component with data by calling myop_init_interface directly

Parameters

data

unknown

Returns

void


inspect()

inspect(): CleanupHandler

Defined in: host/components/myopExtractedWebComponent.ts:36

Returns

CleanupHandler

Overrides

BaseMyopComponent.inspect


onMessageReceived()

onMessageReceived(incomeMessage): boolean

Defined in: host/components/IMyopComponent.ts:212

Parameters

incomeMessage

BaseMyopMessage

Returns

boolean

Inherited from

BaseMyopComponent.onMessageReceived


send()

send(message): CleanupHandler

Defined in: host/components/myopExtractedWebComponent.ts:127

For compatibility with message-based components. Web components don't use postMessage, so this is a no-op for most messages.

Parameters

message

BaseMyopMessage

Returns

CleanupHandler

Overrides

BaseMyopComponent.send


setCtaHandler()

setCtaHandler(handler): void

Defined in: host/components/myopExtractedWebComponent.ts:82

Set CTA handler - unified API with iframe components. Called via props.myop_cta_handler = handler

Parameters

handler

(action, payload) => void

Returns

void


setInitiated()

setInitiated(): void

Defined in: host/components/IMyopComponent.ts:243

Returns

void

Inherited from

BaseMyopComponent.setInitiated


show()

show(): void

Defined in: host/components/myopExtractedWebComponent.ts:50

Returns

void

Overrides

BaseMyopComponent.show