UNPKG

799 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const types_1 = require("@babel/types");
4const GenericType = (name, ...types) => types_1.TSTypeReference(types_1.identifier(name), types_1.TSTypeParameterInstantiation(types));
5exports.MaybeType = (type) => GenericType("Maybe", type);
6exports.PartialType = (type) => GenericType("Partial", type);
7exports.IfType = (possibleTypes, type) => GenericType("If", types_1.TSUnionType(possibleTypes
8 .sort()
9 .toArray()
10 .map(type => types_1.TSLiteralType(types_1.stringLiteral(type)))), type);
11exports.OptionalType = (type) => GenericType("Optional", type);
12exports.OperationType = (type) => GenericType("Operation", type);
13exports.ByIdType = (type) => GenericType("ById", type);
14//# sourceMappingURL=genericTypes.js.map
\No newline at end of file