Created
          April 4, 2019 01:40 
        
      - 
      
- 
        Save droidMakk/ffde017e7c021bb9ce8061e4c6e61b33 to your computer and use it in GitHub Desktop. 
    Using Types and Enums in Typescript
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | export enum ProperType { | |
| Lease, Rent, Own | |
| } | |
| export interface PayOffQuote { | |
| quoteDate: Date, | |
| goThroughDate: Date, | |
| ResidualValue: BigInteger, | |
| propertyType: ProperType, | |
| PayOFfTax: BigInteger, | |
| PaytmentsDue: BigInteger, | |
| PropertyId: Number | |
| } | |
| function processUsersRequest(parameters: PayOffQuote){ | |
| switch (parameters.propertyType) { | |
| case ProperType.Lease: | |
| console.info('It"s a lease') | |
| break; | |
| case ProperType.Rent: | |
| console.info("It's a Rent"); | |
| break; | |
| case ProperType.Own: | |
| console.info("This is user's own") | |
| default: | |
| break; | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment