আপনি ইন্টারফেসে একাধিক পদ্ধতি স্বাক্ষর নির্দিষ্ট করতে পারেন তারপরে শ্রেণিক পদ্ধতিতে একাধিক পদ্ধতি ওভারলোড রয়েছে:
interface INotificationService {
error(message: string, title?: string, autoHideAfter?: number);
error(message: string, autoHideAfter: number);
}
class MyNotificationService implements INotificationService {
error(message: string, title?: string, autoHideAfter?: number);
error(message: string, autoHideAfter?: number);
error(message: string, param1?: (string|number), param2?: number) {
var autoHideAfter: number,
title: string;
// example of mapping the parameters
if (param2 != null) {
autoHideAfter = param2;
title = <string> param1;
}
else if (param1 != null) {
if (typeof param1 === "string") {
title = param1;
}
else {
autoHideAfter = param1;
}
}
// use message, autoHideAfter, and title here
}
}
এখন এই সমস্ত কাজ করবে:
var service: INotificationService = new MyNotificationService();
service.error("My message");
service.error("My message", 1000);
service.error("My message", "My title");
service.error("My message", "My title", 1000);
... এবং errorপদ্ধতিতে INotificationServiceনিম্নলিখিত বিকল্পগুলি থাকবে:

খেলার মাঠ
?ফাংশনে যোগ করা হয় সংজ্ঞা , কিন্তু প্রশ্ন আসলে সম্পর্কে কলিং ফাংশন।