My code snippet looks like this:
module Dialog {
export class Modal {
static createAccessModal(link: Link) {
createModal(link);
}
static createAdminModal(link: Link) {
link.Modal.MaxHeight = 600;
link.Modal.Width = false;
createModal(link);
}
static private createModal(link: Link) {
...
}
}
}
I attempted to restrict direct calls to the 'createModal' function by marking it as private. However, even though intellisense visually indicates that it's locked, I'm still able to use it without any errors. Is there a better way to achieve this restriction? Here is how I try to call the function:
Dialog.Modal.createAccessModal(link); // This call is permitted
Dialog.Modal.createModal(link); // This call should not be allowed
Additionally, I've opted for static functions throughout, as these functions are solely responsible for creating objects on the screen which then handle themselves with their own functionality (i.e., submit button). Would you consider this approach reasonable?