| | |
| | | |
| | | var _utils = require("./utils"); |
| | | |
| | | const defineType = (0, _utils.defineAliasedType)("Flow"); |
| | | |
| | | const defineInterfaceishType = (name, typeParameterType = "TypeParameterDeclaration") => { |
| | | (0, _utils.default)(name, { |
| | | defineType(name, { |
| | | builder: ["id", "typeParameters", "extends", "body"], |
| | | visitor: ["id", "typeParameters", "extends", "mixins", "implements", "body"], |
| | | aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], |
| | | aliases: ["FlowDeclaration", "Statement", "Declaration"], |
| | | fields: { |
| | | id: (0, _utils.validateType)("Identifier"), |
| | | typeParameters: (0, _utils.validateOptionalType)(typeParameterType), |
| | |
| | | }); |
| | | }; |
| | | |
| | | (0, _utils.default)("AnyTypeAnnotation", { |
| | | aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] |
| | | defineType("AnyTypeAnnotation", { |
| | | aliases: ["FlowType", "FlowBaseAnnotation"] |
| | | }); |
| | | (0, _utils.default)("ArrayTypeAnnotation", { |
| | | defineType("ArrayTypeAnnotation", { |
| | | visitor: ["elementType"], |
| | | aliases: ["Flow", "FlowType"], |
| | | aliases: ["FlowType"], |
| | | fields: { |
| | | elementType: (0, _utils.validateType)("FlowType") |
| | | } |
| | | }); |
| | | (0, _utils.default)("BooleanTypeAnnotation", { |
| | | aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] |
| | | defineType("BooleanTypeAnnotation", { |
| | | aliases: ["FlowType", "FlowBaseAnnotation"] |
| | | }); |
| | | (0, _utils.default)("BooleanLiteralTypeAnnotation", { |
| | | defineType("BooleanLiteralTypeAnnotation", { |
| | | builder: ["value"], |
| | | aliases: ["Flow", "FlowType"], |
| | | aliases: ["FlowType"], |
| | | fields: { |
| | | value: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("NullLiteralTypeAnnotation", { |
| | | aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] |
| | | defineType("NullLiteralTypeAnnotation", { |
| | | aliases: ["FlowType", "FlowBaseAnnotation"] |
| | | }); |
| | | (0, _utils.default)("ClassImplements", { |
| | | defineType("ClassImplements", { |
| | | visitor: ["id", "typeParameters"], |
| | | aliases: ["Flow"], |
| | | fields: { |
| | | id: (0, _utils.validateType)("Identifier"), |
| | | typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation") |
| | | } |
| | | }); |
| | | defineInterfaceishType("DeclareClass"); |
| | | (0, _utils.default)("DeclareFunction", { |
| | | defineType("DeclareFunction", { |
| | | visitor: ["id"], |
| | | aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], |
| | | aliases: ["FlowDeclaration", "Statement", "Declaration"], |
| | | fields: { |
| | | id: (0, _utils.validateType)("Identifier"), |
| | | predicate: (0, _utils.validateOptionalType)("DeclaredPredicate") |
| | | } |
| | | }); |
| | | defineInterfaceishType("DeclareInterface"); |
| | | (0, _utils.default)("DeclareModule", { |
| | | defineType("DeclareModule", { |
| | | builder: ["id", "body", "kind"], |
| | | visitor: ["id", "body"], |
| | | aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], |
| | | aliases: ["FlowDeclaration", "Statement", "Declaration"], |
| | | fields: { |
| | | id: (0, _utils.validateType)(["Identifier", "StringLiteral"]), |
| | | body: (0, _utils.validateType)("BlockStatement"), |
| | | kind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("CommonJS", "ES")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("DeclareModuleExports", { |
| | | defineType("DeclareModuleExports", { |
| | | visitor: ["typeAnnotation"], |
| | | aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], |
| | | aliases: ["FlowDeclaration", "Statement", "Declaration"], |
| | | fields: { |
| | | typeAnnotation: (0, _utils.validateType)("TypeAnnotation") |
| | | } |
| | | }); |
| | | (0, _utils.default)("DeclareTypeAlias", { |
| | | defineType("DeclareTypeAlias", { |
| | | visitor: ["id", "typeParameters", "right"], |
| | | aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], |
| | | aliases: ["FlowDeclaration", "Statement", "Declaration"], |
| | | fields: { |
| | | id: (0, _utils.validateType)("Identifier"), |
| | | typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), |
| | | right: (0, _utils.validateType)("FlowType") |
| | | } |
| | | }); |
| | | (0, _utils.default)("DeclareOpaqueType", { |
| | | defineType("DeclareOpaqueType", { |
| | | visitor: ["id", "typeParameters", "supertype"], |
| | | aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], |
| | | aliases: ["FlowDeclaration", "Statement", "Declaration"], |
| | | fields: { |
| | | id: (0, _utils.validateType)("Identifier"), |
| | | typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), |
| | |
| | | impltype: (0, _utils.validateOptionalType)("FlowType") |
| | | } |
| | | }); |
| | | (0, _utils.default)("DeclareVariable", { |
| | | defineType("DeclareVariable", { |
| | | visitor: ["id"], |
| | | aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], |
| | | aliases: ["FlowDeclaration", "Statement", "Declaration"], |
| | | fields: { |
| | | id: (0, _utils.validateType)("Identifier") |
| | | } |
| | | }); |
| | | (0, _utils.default)("DeclareExportDeclaration", { |
| | | defineType("DeclareExportDeclaration", { |
| | | visitor: ["declaration", "specifiers", "source"], |
| | | aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], |
| | | aliases: ["FlowDeclaration", "Statement", "Declaration"], |
| | | fields: { |
| | | declaration: (0, _utils.validateOptionalType)("Flow"), |
| | | specifiers: (0, _utils.validateOptional)((0, _utils.arrayOfType)(["ExportSpecifier", "ExportNamespaceSpecifier"])), |
| | |
| | | default: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("DeclareExportAllDeclaration", { |
| | | defineType("DeclareExportAllDeclaration", { |
| | | visitor: ["source"], |
| | | aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], |
| | | aliases: ["FlowDeclaration", "Statement", "Declaration"], |
| | | fields: { |
| | | source: (0, _utils.validateType)("StringLiteral"), |
| | | exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("DeclaredPredicate", { |
| | | defineType("DeclaredPredicate", { |
| | | visitor: ["value"], |
| | | aliases: ["Flow", "FlowPredicate"], |
| | | aliases: ["FlowPredicate"], |
| | | fields: { |
| | | value: (0, _utils.validateType)("Flow") |
| | | } |
| | | }); |
| | | (0, _utils.default)("ExistsTypeAnnotation", { |
| | | aliases: ["Flow", "FlowType"] |
| | | defineType("ExistsTypeAnnotation", { |
| | | aliases: ["FlowType"] |
| | | }); |
| | | (0, _utils.default)("FunctionTypeAnnotation", { |
| | | defineType("FunctionTypeAnnotation", { |
| | | visitor: ["typeParameters", "params", "rest", "returnType"], |
| | | aliases: ["Flow", "FlowType"], |
| | | aliases: ["FlowType"], |
| | | fields: { |
| | | typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), |
| | | params: (0, _utils.validate)((0, _utils.arrayOfType)("FunctionTypeParam")), |
| | |
| | | returnType: (0, _utils.validateType)("FlowType") |
| | | } |
| | | }); |
| | | (0, _utils.default)("FunctionTypeParam", { |
| | | defineType("FunctionTypeParam", { |
| | | visitor: ["name", "typeAnnotation"], |
| | | aliases: ["Flow"], |
| | | fields: { |
| | | name: (0, _utils.validateOptionalType)("Identifier"), |
| | | typeAnnotation: (0, _utils.validateType)("FlowType"), |
| | | optional: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("GenericTypeAnnotation", { |
| | | defineType("GenericTypeAnnotation", { |
| | | visitor: ["id", "typeParameters"], |
| | | aliases: ["Flow", "FlowType"], |
| | | aliases: ["FlowType"], |
| | | fields: { |
| | | id: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]), |
| | | typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation") |
| | | } |
| | | }); |
| | | (0, _utils.default)("InferredPredicate", { |
| | | aliases: ["Flow", "FlowPredicate"] |
| | | defineType("InferredPredicate", { |
| | | aliases: ["FlowPredicate"] |
| | | }); |
| | | (0, _utils.default)("InterfaceExtends", { |
| | | defineType("InterfaceExtends", { |
| | | visitor: ["id", "typeParameters"], |
| | | aliases: ["Flow"], |
| | | fields: { |
| | | id: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]), |
| | | typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation") |
| | | } |
| | | }); |
| | | defineInterfaceishType("InterfaceDeclaration"); |
| | | (0, _utils.default)("InterfaceTypeAnnotation", { |
| | | defineType("InterfaceTypeAnnotation", { |
| | | visitor: ["extends", "body"], |
| | | aliases: ["Flow", "FlowType"], |
| | | aliases: ["FlowType"], |
| | | fields: { |
| | | extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")), |
| | | body: (0, _utils.validateType)("ObjectTypeAnnotation") |
| | | } |
| | | }); |
| | | (0, _utils.default)("IntersectionTypeAnnotation", { |
| | | defineType("IntersectionTypeAnnotation", { |
| | | visitor: ["types"], |
| | | aliases: ["Flow", "FlowType"], |
| | | aliases: ["FlowType"], |
| | | fields: { |
| | | types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("MixedTypeAnnotation", { |
| | | aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] |
| | | defineType("MixedTypeAnnotation", { |
| | | aliases: ["FlowType", "FlowBaseAnnotation"] |
| | | }); |
| | | (0, _utils.default)("EmptyTypeAnnotation", { |
| | | aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] |
| | | defineType("EmptyTypeAnnotation", { |
| | | aliases: ["FlowType", "FlowBaseAnnotation"] |
| | | }); |
| | | (0, _utils.default)("NullableTypeAnnotation", { |
| | | defineType("NullableTypeAnnotation", { |
| | | visitor: ["typeAnnotation"], |
| | | aliases: ["Flow", "FlowType"], |
| | | aliases: ["FlowType"], |
| | | fields: { |
| | | typeAnnotation: (0, _utils.validateType)("FlowType") |
| | | } |
| | | }); |
| | | (0, _utils.default)("NumberLiteralTypeAnnotation", { |
| | | defineType("NumberLiteralTypeAnnotation", { |
| | | builder: ["value"], |
| | | aliases: ["Flow", "FlowType"], |
| | | aliases: ["FlowType"], |
| | | fields: { |
| | | value: (0, _utils.validate)((0, _utils.assertValueType)("number")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("NumberTypeAnnotation", { |
| | | aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] |
| | | defineType("NumberTypeAnnotation", { |
| | | aliases: ["FlowType", "FlowBaseAnnotation"] |
| | | }); |
| | | (0, _utils.default)("ObjectTypeAnnotation", { |
| | | defineType("ObjectTypeAnnotation", { |
| | | visitor: ["properties", "indexers", "callProperties", "internalSlots"], |
| | | aliases: ["Flow", "FlowType"], |
| | | aliases: ["FlowType"], |
| | | builder: ["properties", "indexers", "callProperties", "internalSlots", "exact"], |
| | | fields: { |
| | | properties: (0, _utils.validate)((0, _utils.arrayOfType)(["ObjectTypeProperty", "ObjectTypeSpreadProperty"])), |
| | | indexers: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeIndexer")), |
| | | callProperties: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeCallProperty")), |
| | | internalSlots: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ObjectTypeInternalSlot")), |
| | | indexers: { |
| | | validate: (0, _utils.arrayOfType)("ObjectTypeIndexer"), |
| | | optional: true, |
| | | default: [] |
| | | }, |
| | | callProperties: { |
| | | validate: (0, _utils.arrayOfType)("ObjectTypeCallProperty"), |
| | | optional: true, |
| | | default: [] |
| | | }, |
| | | internalSlots: { |
| | | validate: (0, _utils.arrayOfType)("ObjectTypeInternalSlot"), |
| | | optional: true, |
| | | default: [] |
| | | }, |
| | | exact: { |
| | | validate: (0, _utils.assertValueType)("boolean"), |
| | | default: false |
| | |
| | | inexact: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("ObjectTypeInternalSlot", { |
| | | defineType("ObjectTypeInternalSlot", { |
| | | visitor: ["id", "value", "optional", "static", "method"], |
| | | aliases: ["Flow", "UserWhitespacable"], |
| | | aliases: ["UserWhitespacable"], |
| | | fields: { |
| | | id: (0, _utils.validateType)("Identifier"), |
| | | value: (0, _utils.validateType)("FlowType"), |
| | |
| | | method: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("ObjectTypeCallProperty", { |
| | | defineType("ObjectTypeCallProperty", { |
| | | visitor: ["value"], |
| | | aliases: ["Flow", "UserWhitespacable"], |
| | | aliases: ["UserWhitespacable"], |
| | | fields: { |
| | | value: (0, _utils.validateType)("FlowType"), |
| | | static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("ObjectTypeIndexer", { |
| | | defineType("ObjectTypeIndexer", { |
| | | visitor: ["id", "key", "value", "variance"], |
| | | aliases: ["Flow", "UserWhitespacable"], |
| | | aliases: ["UserWhitespacable"], |
| | | fields: { |
| | | id: (0, _utils.validateOptionalType)("Identifier"), |
| | | key: (0, _utils.validateType)("FlowType"), |
| | |
| | | variance: (0, _utils.validateOptionalType)("Variance") |
| | | } |
| | | }); |
| | | (0, _utils.default)("ObjectTypeProperty", { |
| | | defineType("ObjectTypeProperty", { |
| | | visitor: ["key", "value", "variance"], |
| | | aliases: ["Flow", "UserWhitespacable"], |
| | | aliases: ["UserWhitespacable"], |
| | | fields: { |
| | | key: (0, _utils.validateType)(["Identifier", "StringLiteral"]), |
| | | value: (0, _utils.validateType)("FlowType"), |
| | |
| | | method: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("ObjectTypeSpreadProperty", { |
| | | defineType("ObjectTypeSpreadProperty", { |
| | | visitor: ["argument"], |
| | | aliases: ["Flow", "UserWhitespacable"], |
| | | aliases: ["UserWhitespacable"], |
| | | fields: { |
| | | argument: (0, _utils.validateType)("FlowType") |
| | | } |
| | | }); |
| | | (0, _utils.default)("OpaqueType", { |
| | | defineType("OpaqueType", { |
| | | visitor: ["id", "typeParameters", "supertype", "impltype"], |
| | | aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], |
| | | aliases: ["FlowDeclaration", "Statement", "Declaration"], |
| | | fields: { |
| | | id: (0, _utils.validateType)("Identifier"), |
| | | typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), |
| | |
| | | impltype: (0, _utils.validateType)("FlowType") |
| | | } |
| | | }); |
| | | (0, _utils.default)("QualifiedTypeIdentifier", { |
| | | defineType("QualifiedTypeIdentifier", { |
| | | visitor: ["id", "qualification"], |
| | | aliases: ["Flow"], |
| | | fields: { |
| | | id: (0, _utils.validateType)("Identifier"), |
| | | qualification: (0, _utils.validateType)(["Identifier", "QualifiedTypeIdentifier"]) |
| | | } |
| | | }); |
| | | (0, _utils.default)("StringLiteralTypeAnnotation", { |
| | | defineType("StringLiteralTypeAnnotation", { |
| | | builder: ["value"], |
| | | aliases: ["Flow", "FlowType"], |
| | | aliases: ["FlowType"], |
| | | fields: { |
| | | value: (0, _utils.validate)((0, _utils.assertValueType)("string")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("StringTypeAnnotation", { |
| | | aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] |
| | | defineType("StringTypeAnnotation", { |
| | | aliases: ["FlowType", "FlowBaseAnnotation"] |
| | | }); |
| | | (0, _utils.default)("SymbolTypeAnnotation", { |
| | | aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] |
| | | defineType("SymbolTypeAnnotation", { |
| | | aliases: ["FlowType", "FlowBaseAnnotation"] |
| | | }); |
| | | (0, _utils.default)("ThisTypeAnnotation", { |
| | | aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] |
| | | defineType("ThisTypeAnnotation", { |
| | | aliases: ["FlowType", "FlowBaseAnnotation"] |
| | | }); |
| | | (0, _utils.default)("TupleTypeAnnotation", { |
| | | defineType("TupleTypeAnnotation", { |
| | | visitor: ["types"], |
| | | aliases: ["Flow", "FlowType"], |
| | | aliases: ["FlowType"], |
| | | fields: { |
| | | types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("TypeofTypeAnnotation", { |
| | | defineType("TypeofTypeAnnotation", { |
| | | visitor: ["argument"], |
| | | aliases: ["Flow", "FlowType"], |
| | | aliases: ["FlowType"], |
| | | fields: { |
| | | argument: (0, _utils.validateType)("FlowType") |
| | | } |
| | | }); |
| | | (0, _utils.default)("TypeAlias", { |
| | | defineType("TypeAlias", { |
| | | visitor: ["id", "typeParameters", "right"], |
| | | aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"], |
| | | aliases: ["FlowDeclaration", "Statement", "Declaration"], |
| | | fields: { |
| | | id: (0, _utils.validateType)("Identifier"), |
| | | typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), |
| | | right: (0, _utils.validateType)("FlowType") |
| | | } |
| | | }); |
| | | (0, _utils.default)("TypeAnnotation", { |
| | | aliases: ["Flow"], |
| | | defineType("TypeAnnotation", { |
| | | visitor: ["typeAnnotation"], |
| | | fields: { |
| | | typeAnnotation: (0, _utils.validateType)("FlowType") |
| | | } |
| | | }); |
| | | (0, _utils.default)("TypeCastExpression", { |
| | | defineType("TypeCastExpression", { |
| | | visitor: ["expression", "typeAnnotation"], |
| | | aliases: ["Flow", "ExpressionWrapper", "Expression"], |
| | | aliases: ["ExpressionWrapper", "Expression"], |
| | | fields: { |
| | | expression: (0, _utils.validateType)("Expression"), |
| | | typeAnnotation: (0, _utils.validateType)("TypeAnnotation") |
| | | } |
| | | }); |
| | | (0, _utils.default)("TypeParameter", { |
| | | aliases: ["Flow"], |
| | | defineType("TypeParameter", { |
| | | visitor: ["bound", "default", "variance"], |
| | | fields: { |
| | | name: (0, _utils.validate)((0, _utils.assertValueType)("string")), |
| | |
| | | variance: (0, _utils.validateOptionalType)("Variance") |
| | | } |
| | | }); |
| | | (0, _utils.default)("TypeParameterDeclaration", { |
| | | aliases: ["Flow"], |
| | | defineType("TypeParameterDeclaration", { |
| | | visitor: ["params"], |
| | | fields: { |
| | | params: (0, _utils.validate)((0, _utils.arrayOfType)("TypeParameter")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("TypeParameterInstantiation", { |
| | | aliases: ["Flow"], |
| | | defineType("TypeParameterInstantiation", { |
| | | visitor: ["params"], |
| | | fields: { |
| | | params: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("UnionTypeAnnotation", { |
| | | defineType("UnionTypeAnnotation", { |
| | | visitor: ["types"], |
| | | aliases: ["Flow", "FlowType"], |
| | | aliases: ["FlowType"], |
| | | fields: { |
| | | types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("Variance", { |
| | | aliases: ["Flow"], |
| | | defineType("Variance", { |
| | | builder: ["kind"], |
| | | fields: { |
| | | kind: (0, _utils.validate)((0, _utils.assertOneOf)("minus", "plus")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("VoidTypeAnnotation", { |
| | | aliases: ["Flow", "FlowType", "FlowBaseAnnotation"] |
| | | defineType("VoidTypeAnnotation", { |
| | | aliases: ["FlowType", "FlowBaseAnnotation"] |
| | | }); |
| | | (0, _utils.default)("EnumDeclaration", { |
| | | defineType("EnumDeclaration", { |
| | | aliases: ["Statement", "Declaration"], |
| | | visitor: ["id", "body"], |
| | | fields: { |
| | |
| | | body: (0, _utils.validateType)(["EnumBooleanBody", "EnumNumberBody", "EnumStringBody", "EnumSymbolBody"]) |
| | | } |
| | | }); |
| | | (0, _utils.default)("EnumBooleanBody", { |
| | | defineType("EnumBooleanBody", { |
| | | aliases: ["EnumBody"], |
| | | visitor: ["members"], |
| | | fields: { |
| | |
| | | hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("EnumNumberBody", { |
| | | defineType("EnumNumberBody", { |
| | | aliases: ["EnumBody"], |
| | | visitor: ["members"], |
| | | fields: { |
| | |
| | | hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("EnumStringBody", { |
| | | defineType("EnumStringBody", { |
| | | aliases: ["EnumBody"], |
| | | visitor: ["members"], |
| | | fields: { |
| | |
| | | hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("EnumSymbolBody", { |
| | | defineType("EnumSymbolBody", { |
| | | aliases: ["EnumBody"], |
| | | visitor: ["members"], |
| | | fields: { |
| | |
| | | hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) |
| | | } |
| | | }); |
| | | (0, _utils.default)("EnumBooleanMember", { |
| | | defineType("EnumBooleanMember", { |
| | | aliases: ["EnumMember"], |
| | | visitor: ["id"], |
| | | fields: { |
| | |
| | | init: (0, _utils.validateType)("BooleanLiteral") |
| | | } |
| | | }); |
| | | (0, _utils.default)("EnumNumberMember", { |
| | | defineType("EnumNumberMember", { |
| | | aliases: ["EnumMember"], |
| | | visitor: ["id", "init"], |
| | | fields: { |
| | |
| | | init: (0, _utils.validateType)("NumericLiteral") |
| | | } |
| | | }); |
| | | (0, _utils.default)("EnumStringMember", { |
| | | defineType("EnumStringMember", { |
| | | aliases: ["EnumMember"], |
| | | visitor: ["id", "init"], |
| | | fields: { |
| | |
| | | init: (0, _utils.validateType)("StringLiteral") |
| | | } |
| | | }); |
| | | (0, _utils.default)("EnumDefaultedMember", { |
| | | defineType("EnumDefaultedMember", { |
| | | aliases: ["EnumMember"], |
| | | visitor: ["id"], |
| | | fields: { |
| | | id: (0, _utils.validateType)("Identifier") |
| | | } |
| | | }); |
| | | (0, _utils.default)("IndexedAccessType", { |
| | | defineType("IndexedAccessType", { |
| | | visitor: ["objectType", "indexType"], |
| | | aliases: ["Flow", "FlowType"], |
| | | aliases: ["FlowType"], |
| | | fields: { |
| | | objectType: (0, _utils.validateType)("FlowType"), |
| | | indexType: (0, _utils.validateType)("FlowType") |
| | | } |
| | | }); |
| | | (0, _utils.default)("OptionalIndexedAccessType", { |
| | | defineType("OptionalIndexedAccessType", { |
| | | visitor: ["objectType", "indexType"], |
| | | aliases: ["Flow", "FlowType"], |
| | | aliases: ["FlowType"], |
| | | fields: { |
| | | objectType: (0, _utils.validateType)("FlowType"), |
| | | indexType: (0, _utils.validateType)("FlowType"), |