Is there a way to declare an object as protected or private in Typescript?
I have found that I cannot achieve this in an interface (only public is allowed), and attempts to do so inside the class does not work either.
private options : interface{
collapsible : boolean;
collapsed : boolean;
editable : boolean;
}
Any suggestions or hints would be greatly appreciated. Thank you.
Zoltán Tamási - Thanks for the help!
In the Interface
declare module ICoreModule{
// protected or private
interface IOptions{
initWhenDataReady : boolean;
collapsible : boolean;
collapsed : boolean;
editable : boolean;
}
export interface ICoreScope extends ng.IScope{
sandboxSave : Function;
data : Object;
}
export interface Class extends App.Directive{
$scope : ICoreScope;
$element : ng.IRootElementService;
$attr : ICoreAttr;
$ctrl : ng.IFormController;
}
}
In the class:
protected options : ICoreModule.IOptions = <ICoreModule.IOptions>{
initWhenDataReady : true,
collapsible : true,
collapsed : true,
editable : true
};