পদ্ধতি স্বাক্ষর 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 সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-01-10 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-01-10 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"]]