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