Firma del metodo MeetAddonClient.on
Fornisce l'accesso ai
AddonCallbacks
utilizzabili dal componente aggiuntivo.
Firma
on<T extends keyof AddonCallbacks>(
eventId: T,
eventHandler: AddonCallbacks[T],
): void;
Parametri del tipo
Dettagli
Parametri
Nome |
Tipo |
Facoltativo |
Descrizione |
eventId |
T |
No |
|
eventHandler |
AddonCallbacks[T] |
No |
|
Resi
void
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2024-10-15 UTC.
[null,null,["Ultimo aggiornamento 2024-10-15 UTC."],[[["Gives add-ons access to `AddonCallbacks` for utilizing various functionalities."],["Employs the `on` method, accepting an event ID and handler to manage add-on events."],["Utilizes generics for type safety and flexibility in handling different event types."],["Offers a parameter named `eventId` of a generic type `T` and an `eventHandler` with a type based on the provided `eventId`."],["Returns void, indicating it primarily focuses on event registration and execution rather than returning a specific value."]]],["The core functionality allows add-ons to subscribe to events defined within `AddonCallbacks`. The `on` method is used to register an `eventHandler` for a specific `eventId`. `eventId` must be a valid key within `AddonCallbacks`. The `eventHandler` is a function type that corresponds to the chosen `eventId` in `AddonCallbacks`. The method returns `void`, meaning it does not return any value.\n"]]