Skip to content

Instantly share code, notes, and snippets.

@matthewrwilton
Created September 1, 2015 00:43
Show Gist options
  • Select an option

  • Save matthewrwilton/e43ab8e9c1833982f9ec to your computer and use it in GitHub Desktop.

Select an option

Save matthewrwilton/e43ab8e9c1833982f9ec to your computer and use it in GitHub Desktop.
Demonstrates that an interface with only optional properties will not cause compile errors in TypeScript.
interface IOptions {
option1?: boolean;
option2?: boolean;
}
interface IParameter {
options: IOptions;
}
var parameter: IParameter = {
options: 1
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment