@get-advantage/advantage / advantage/advantage / Advantage
Class: Advantage
advantage/advantage.Advantage
The main class for the Advantage library. This class is a singleton and is used to configure the library, register wrappers, and register custom elements.
Constructors
constructor
• new Advantage(): Advantage
Returns
Defined in
Properties
#customWrappers
• Private
#customWrappers: HTMLElement
[] = []
Defined in
config
• config: null
| AdvantageConfig
= null
Defined in
defaultFormats
• defaultFormats: AdvantageFormat
[] = defaultFormats
Defined in
formatIntegrations
• formatIntegrations: Map
<string
, AdvantageFormatIntegration
>
Defined in
formats
• formats: Map
<string
, AdvantageFormat
>
Defined in
wrappers
• wrappers: IAdvantageWrapper
[] = []
Defined in
id
▪ Static
id: number
= 0
Defined in
instance
▪ Static
Private
instance: null
| Advantage
= null
Defined in
Methods
applyConfig
▸ applyConfig(config
): void
Parameters
Name | Type |
---|---|
config | AdvantageConfig |
Returns
void
Defined in
configure
▸ configure(config
): void
Parameters
Name | Type |
---|---|
config | AdvantageConfig |
Returns
void
Defined in
loadConfig
▸ loadConfig(configUrl
): void
Parameters
Name | Type |
---|---|
configUrl | string |
Returns
void
Defined in
mergeUniqueFormats
▸ mergeUniqueFormats(localFormats
, userFormats
): AdvantageFormat
[]
Parameters
Name | Type |
---|---|
localFormats | AdvantageFormat [] |
userFormats | AdvantageFormat [] |
Returns
Defined in
registerCustomWrapper
▸ registerCustomWrapper(wrapper
): void
Parameters
Name | Type |
---|---|
wrapper | HTMLElement |
Returns
void
Defined in
registerWrapper
▸ registerWrapper(wrapper
): void
Parameters
Name | Type |
---|---|
wrapper | IAdvantageWrapper |
Returns
void
Defined in
getInstance
▸ getInstance(): Advantage