Interface: ICardService

Class for working with ICards by defining types and instantiating/destroying card instances

Methods

createCard()

createCard(cardId, location?, ...parameters?): ICard

Creates a new card instance

Parameters

cardId: string

The card id from the ICardConfig.id

location?: ICardLocation

The starting location for the card. If undefined, the card will be placed in the the default location from ICardConfig or the default location for the layout.

• ...parameters?: any[]

Additional parameters to make available to the card instance. These are placed in the ICard.parameters array.

Returns

ICard

A new ICard if successful, undefined if an error occurred


defineCard()

defineCard(...config): boolean

Defines one or more new card types

Parameters

• ...config: ICardConfig[]

The card configuration(s)

Returns

boolean

true if successful, false if an error occurred


destroyCard()

destroyCard(card): void

Removes a card from the card service. This method should be called when a temporary card is no longer needed. It is not necessary to call destroyCard() for any cards when the card service is being shut down.

Parameters

card: ICard

Returns

void


getCard()

getCard(instanceId): ICard

Retrieves an instance of a card

Parameters

instanceId: string

The instance id of the card to retrieve

Returns

ICard

The card instance if it exists, undefined otherwise.