Skip to content

@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

Advantage

Defined in

src/advantage/advantage.ts:25

Properties

#customWrappers

Private #customWrappers: HTMLElement[] = []

Defined in

src/advantage/advantage.ts:20


config

config: null | AdvantageConfig = null

Defined in

src/advantage/advantage.ts:17


defaultFormats

defaultFormats: AdvantageFormat[] = defaultFormats

Defined in

src/advantage/advantage.ts:18


formatIntegrations

formatIntegrations: Map<string, AdvantageFormatIntegration>

Defined in

src/advantage/advantage.ts:22


formats

formats: Map<string, AdvantageFormat>

Defined in

src/advantage/advantage.ts:21


wrappers

wrappers: IAdvantageWrapper[] = []

Defined in

src/advantage/advantage.ts:19


id

Static id: number = 0

Defined in

src/advantage/advantage.ts:23


instance

Static Private instance: null | Advantage = null

Defined in

src/advantage/advantage.ts:16

Methods

applyConfig

applyConfig(config): void

Parameters

NameType
configAdvantageConfig

Returns

void

Defined in

src/advantage/advantage.ts:76


configure

configure(config): void

Parameters

NameType
configAdvantageConfig

Returns

void

Defined in

src/advantage/advantage.ts:30


loadConfig

loadConfig(configUrl): void

Parameters

NameType
configUrlstring

Returns

void

Defined in

src/advantage/advantage.ts:64


mergeUniqueFormats

mergeUniqueFormats(localFormats, userFormats): AdvantageFormat[]

Parameters

NameType
localFormatsAdvantageFormat[]
userFormatsAdvantageFormat[]

Returns

AdvantageFormat[]

Defined in

src/advantage/advantage.ts:96


registerCustomWrapper

registerCustomWrapper(wrapper): void

Parameters

NameType
wrapperHTMLElement

Returns

void

Defined in

src/advantage/advantage.ts:49


registerWrapper

registerWrapper(wrapper): void

Parameters

NameType
wrapperIAdvantageWrapper

Returns

void

Defined in

src/advantage/advantage.ts:43


getInstance

getInstance(): Advantage

Returns

Advantage

Defined in

src/advantage/advantage.ts:55