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
skin
container
HTMLElement
customElement
HTMLElement
tagName
string
options?
Returns
Overrides
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
element?
optionalelement:HTMLElement
Defined in: host/components/IMyopComponent.ts:131
Inherited from
id
id:
string=''
Defined in: host/components/IMyopComponent.ts:127
Inherited from
isInitiated
isInitiated:
boolean=false
Defined in: host/components/IMyopComponent.ts:250
Inherited from
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
refs
refs:
RefTypes
Defined in: host/components/IMyopComponent.ts:367
Inherited from
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
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
Inherited from
dispose()
dispose():
void
Defined in: host/components/myopExtractedWebComponent.ts:138
Returns
void
Overrides
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
initiated()
initiated():
Promise<any>
Defined in: host/components/IMyopComponent.ts:260
Returns
Promise<any>
Inherited from
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
Overrides
onMessageReceived()
onMessageReceived(
incomeMessage):boolean
Defined in: host/components/IMyopComponent.ts:212
Parameters
incomeMessage
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
Returns
Overrides
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