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