Skip to content

williamjuan027/interfaceGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InterfaceGenerator

What's this?

A simple tool that converts JSON input to a Typescript interface, built with angular. The app is hosted on github pages and can be accessed here.

Usage

Input

"maths": {
    "q1": {
        "question": "5 + 7 = ?",
        "options": [
            "10",
            "11",
            "12",
            "13"
        ],
        "answer": "12"
    },
    "q2": {
        "question": "12 - 8 = ?",
        "options": [
            "1",
            "2",
            "3",
            "4"
        ],
        "answer": "4"
    }
}

Output

export interface Maths { 
  q1 : Q1, 
  q2 : Q1 
}
export interface Q1 { 
  question : string, 
  options : number[], 
  answer : string 
}