Skip to content

Latest commit

 

History

History
44 lines (42 loc) · 797 Bytes

README.md

File metadata and controls

44 lines (42 loc) · 797 Bytes

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 
}