JavaScript/JSON Interface Description Language
问题 Take as example MDN Spider Monkey Parser API web page. You can see that an object returned by a Javascript method is described by a meta-language. The following snippet in that page: interface Node { type: string; loc: SourceLocation | null; } Describes an object called Node which has two properties: type and loc . And the following: interface Program <: Node { type: "Program"; body: [ Statement ]; } Describes another object which will inherit properties type and loc from Node plus will have