This has been a feature in Flow for a long time (couldn't easily find a specific commit adding this). Interfaces are basically undocumented, though, so it's easy to see how this was missed.
283 lines
6.3 KiB
JSON
283 lines
6.3 KiB
JSON
{
|
|
"type": "File",
|
|
"start": 0,
|
|
"end": 69,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 33
|
|
}
|
|
},
|
|
"program": {
|
|
"type": "Program",
|
|
"start": 0,
|
|
"end": 69,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 33
|
|
}
|
|
},
|
|
"sourceType": "module",
|
|
"body": [
|
|
{
|
|
"type": "DeclareInterface",
|
|
"start": 0,
|
|
"end": 35,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 35
|
|
}
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"start": 18,
|
|
"end": 19,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 18
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 19
|
|
}
|
|
},
|
|
"name": "I"
|
|
},
|
|
"typeParameters": null,
|
|
"extends": [],
|
|
"mixins": [],
|
|
"body": {
|
|
"type": "ObjectTypeAnnotation",
|
|
"start": 20,
|
|
"end": 35,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 20
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 35
|
|
}
|
|
},
|
|
"callProperties": [],
|
|
"properties": [
|
|
{
|
|
"type": "ObjectTypeProperty",
|
|
"start": 22,
|
|
"end": 33,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 22
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 33
|
|
}
|
|
},
|
|
"key": {
|
|
"type": "Identifier",
|
|
"start": 22,
|
|
"end": 25,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 22
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 25
|
|
}
|
|
},
|
|
"name": "foo"
|
|
},
|
|
"value": {
|
|
"type": "StringTypeAnnotation",
|
|
"start": 27,
|
|
"end": 33,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 27
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 33
|
|
}
|
|
}
|
|
},
|
|
"optional": false
|
|
}
|
|
],
|
|
"indexers": []
|
|
}
|
|
},
|
|
{
|
|
"type": "DeclareInterface",
|
|
"start": 36,
|
|
"end": 69,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 33
|
|
}
|
|
},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"start": 54,
|
|
"end": 55,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 18
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 19
|
|
}
|
|
},
|
|
"name": "I"
|
|
},
|
|
"typeParameters": {
|
|
"type": "TypeParameterDeclaration",
|
|
"start": 55,
|
|
"end": 58,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 19
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 22
|
|
}
|
|
},
|
|
"params": [
|
|
{
|
|
"type": "Identifier",
|
|
"start": 56,
|
|
"end": 57,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 20
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 21
|
|
}
|
|
},
|
|
"name": "T"
|
|
}
|
|
]
|
|
},
|
|
"extends": [],
|
|
"mixins": [],
|
|
"body": {
|
|
"type": "ObjectTypeAnnotation",
|
|
"start": 59,
|
|
"end": 69,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 23
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 33
|
|
}
|
|
},
|
|
"callProperties": [],
|
|
"properties": [
|
|
{
|
|
"type": "ObjectTypeProperty",
|
|
"start": 61,
|
|
"end": 67,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 25
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 31
|
|
}
|
|
},
|
|
"key": {
|
|
"type": "Identifier",
|
|
"start": 61,
|
|
"end": 64,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 25
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 28
|
|
}
|
|
},
|
|
"name": "foo"
|
|
},
|
|
"value": {
|
|
"type": "GenericTypeAnnotation",
|
|
"start": 66,
|
|
"end": 67,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 30
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 31
|
|
}
|
|
},
|
|
"typeParameters": null,
|
|
"id": {
|
|
"type": "Identifier",
|
|
"start": 66,
|
|
"end": 67,
|
|
"loc": {
|
|
"start": {
|
|
"line": 2,
|
|
"column": 30
|
|
},
|
|
"end": {
|
|
"line": 2,
|
|
"column": 31
|
|
}
|
|
},
|
|
"name": "T"
|
|
}
|
|
},
|
|
"optional": false
|
|
}
|
|
],
|
|
"indexers": []
|
|
}
|
|
}
|
|
],
|
|
"directives": []
|
|
}
|
|
} |