Add Object special
parent
d24a640ad5
commit
418f997d31
|
@ -2,7 +2,18 @@ import {invariant} from './utils';
|
|||
import type {Type} from './types';
|
||||
|
||||
export default {
|
||||
Buffer() {
|
||||
Object(params: (?Type)[]): ?Type {
|
||||
invariant(params.length === 0);
|
||||
|
||||
return {
|
||||
kind: 'map',
|
||||
keys: {kind: 'mixed'},
|
||||
values: {kind: 'mixed'},
|
||||
};
|
||||
},
|
||||
Buffer(params: (?Type)[]): ?Type {
|
||||
invariant(params.length === 0);
|
||||
|
||||
return {
|
||||
kind: 'reference',
|
||||
to: ['Buffer'],
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
type X = Object;
|
||||
|
||||
interface Y {
|
||||
y: Object;
|
||||
}
|
||||
|
||||
class Z {
|
||||
z: Object;
|
||||
}
|
||||
|
||||
export {X, Y, Z};
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"types": [
|
||||
{
|
||||
"id": ["objects", "X"],
|
||||
"kind": "map",
|
||||
"keys": {"kind": "mixed"},
|
||||
"values": {"kind": "mixed"}
|
||||
},
|
||||
{
|
||||
"id": ["objects", "Y"],
|
||||
"kind": "record",
|
||||
"fields": [{
|
||||
"name": "y",
|
||||
"value": {
|
||||
"kind": "map",
|
||||
"keys": {"kind": "mixed"},
|
||||
"values": {"kind": "mixed"}
|
||||
},
|
||||
"required": true
|
||||
}]
|
||||
},
|
||||
{
|
||||
"id": ["objects", "Z"],
|
||||
"kind": "record",
|
||||
"fields": [{
|
||||
"name": "z",
|
||||
"value": {
|
||||
"kind": "map",
|
||||
"keys": {"kind": "mixed"},
|
||||
"values": {"kind": "mixed"}
|
||||
},
|
||||
"required": true
|
||||
}]
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue