I think you have basically five different options to do so. Choosing among them could be easy depending on the goal you would like to achieve.
The best way in most of the cases to use a class and instantiate it, because you are using TypeScript to apply type checking.
interface IModal {
content: string;
form: string;
//...
//Extra
foo: (bar: string): void;
}
class Modal implements IModal {
content: string;
form: string;
foo(param: string): void {
}
}
Even if other methods are offering easier ways to create an object from an interface you should consider splitting your interface apart, if you are using your object for different matters, and it does not cause interface over-segregation:
interface IBehaviour {
//Extra
foo(param: string): void;
}
interface IModal extends IBehaviour{
content: string;
form: string;
//...
}
On the other hand, for example during unit testing your code (if you may not applying separation of concerns frequently), you may be able to accept the drawbacks for the sake of productivity. You may apply other methods to create mocks mostly for big third party *.d.ts interfaces. And it could be a pain to always implement full anonymous objects for every huge interface.
On this path your first option is to create an empty object:
var modal = <IModal>{};
Secondly to fully realise the compulsory part of your interface. It can be useful whether you are calling 3rd party JavaScript libraries, but I think you should create a class instead, like before:
var modal: IModal = {
content: '',
form: '',
//...
foo: (param: string): void => {
}
};
Thirdly you can create just a part of your interface and create an anonymous object, but this way you are responsible to fulfil the contract
var modal: IModal = <any>{
foo: (param: string): void => {
}
};
Summarising my answer even if interfaces are optional, because they are not transpiled into JavaScript code, TypeScript is there to provide a new level of abstraction, if used wisely and consistently. I think, just because you can dismiss them in most of the cases from your own code you shouldn't.