तरीके सिग्नेचर MeetAddonClient.on
इस प्लैटफ़ॉर्म का ऐक्सेस देता है
AddonCallbacks
जिनका इस्तेमाल ऐड-ऑन कर सके.
हस्ताक्षर
on<T extends keyof AddonCallbacks>(
eventId: T,
eventHandler: AddonCallbacks[T],
): void;
टाइप पैरामीटर
विवरण
पैरामीटर
नाम |
टाइप |
वैकल्पिक |
ब्यौरा |
eventId |
T |
नहीं |
|
eventHandler |
AddonCallbacks[T] |
नहीं |
|
रिटर्न
void
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2024-10-15 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 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"]]