Check out example codes for "How to pass optional parameters while omitting some other optional parameters?". It will help you in understanding the concepts better.

Code Example 1

export interface INotificationService {
    error(message: string, title?: string, autoHideAfter? : number);
}

class X {
    error(message: string, title?: string, autoHideAfter?: number) {
        console.log(message, title, autoHideAfter);
    }
}

new X().error("hi there", undefined, 1000);

Learn ReactJs, React Native from akashmittal.com