1321 lines
30 KiB
JavaScript
1321 lines
30 KiB
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.FsTypeModule = exports.FsParamModule = exports.FsCommentModule = exports.FsFileOut = exports.FsFile = exports.FsModule = exports.FsType = exports.FsMapped = exports.FsVariable = exports.FsExport = exports.FsImport = exports.ModuleImport = exports.TypeImport = exports.FsTuple = exports.FsTupleKind = exports.FsAlias = exports.FsUnion = exports.FsGenericType = exports.FsProperty = exports.FsPropertyKind = exports.FsFunction = exports.FsFunctionKind = exports.FsParam = exports.FsComment = exports.FsParamComment = exports.FsEnum = exports.FsEnumCase = exports.FsEnumCaseType = exports.FsGenericParameterDefaults = exports.FsTypeLiteral = exports.FsInterface = undefined;
|
|
exports.simpleType = simpleType;
|
|
exports.isStatic = isStatic;
|
|
exports.isConstructor = isConstructor;
|
|
exports.getName = getName;
|
|
exports.getFullName = getFullName;
|
|
|
|
var _Symbol2 = require("./fable-core/Symbol");
|
|
|
|
var _Symbol3 = _interopRequireDefault(_Symbol2);
|
|
|
|
var _Util = require("./fable-core/Util");
|
|
|
|
var _List = require("./fable-core/List");
|
|
|
|
var _List2 = _interopRequireDefault(_List);
|
|
|
|
var _Seq = require("./fable-core/Seq");
|
|
|
|
var _CurriedLambda = require("./fable-core/CurriedLambda");
|
|
|
|
var _CurriedLambda2 = _interopRequireDefault(_CurriedLambda);
|
|
|
|
var _Option = require("./fable-core/Option");
|
|
|
|
var _String = require("./fable-core/String");
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
class FsInterface {
|
|
constructor(comments, isStatic, isClass, name, fullName, typeParameters, inherits, members) {
|
|
this.Comments = comments;
|
|
this.IsStatic = isStatic;
|
|
this.IsClass = isClass;
|
|
this.Name = name;
|
|
this.FullName = fullName;
|
|
this.TypeParameters = typeParameters;
|
|
this.Inherits = inherits;
|
|
this.Members = members;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsInterface",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
Comments: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: FsComment
|
|
}),
|
|
IsStatic: "boolean",
|
|
IsClass: "boolean",
|
|
Name: "string",
|
|
FullName: "string",
|
|
TypeParameters: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: FsType
|
|
}),
|
|
Inherits: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: FsType
|
|
}),
|
|
Members: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: FsType
|
|
})
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
get HasStaticMembers() {
|
|
return (0, _Seq.exists)(tp => isStatic(tp), this.Members);
|
|
}
|
|
|
|
get StaticMembers() {
|
|
return (0, _List.filter)(tp => isStatic(tp), this.Members);
|
|
}
|
|
|
|
get NonStaticMembers() {
|
|
return (0, _List.filter)($var1 => !isStatic($var1), this.Members);
|
|
}
|
|
|
|
get HasConstructor() {
|
|
return (0, _Seq.exists)(tp => isConstructor(tp), this.Members);
|
|
}
|
|
|
|
get Constructors() {
|
|
return (0, _List.filter)(tp => isConstructor(tp), this.Members);
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsInterface = FsInterface;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsInterface", FsInterface);
|
|
|
|
class FsTypeLiteral {
|
|
constructor(members) {
|
|
this.Members = members;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsTypeLiteral",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
Members: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: FsType
|
|
})
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsTypeLiteral = FsTypeLiteral;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsTypeLiteral", FsTypeLiteral);
|
|
|
|
class FsGenericParameterDefaults {
|
|
constructor(_default, name, fullName) {
|
|
this.Default = _default;
|
|
this.Name = name;
|
|
this.FullName = fullName;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsGenericParameterDefaults",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
Default: FsType,
|
|
Name: "string",
|
|
FullName: "string"
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsGenericParameterDefaults = FsGenericParameterDefaults;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsGenericParameterDefaults", FsGenericParameterDefaults);
|
|
|
|
class FsEnumCaseType {
|
|
constructor(tag) {
|
|
this.tag = tag | 0;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsEnumCaseType",
|
|
interfaces: ["FSharpUnion", "System.IEquatable", "System.IComparable"],
|
|
cases: [["Numeric"], ["String"], ["Unknown"]]
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return this.tag === other.tag;
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.comparePrimitives)(this.tag, other.tag);
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsEnumCaseType = FsEnumCaseType;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsEnumCaseType", FsEnumCaseType);
|
|
|
|
class FsEnumCase {
|
|
constructor(name, type, value) {
|
|
this.Name = name;
|
|
this.Type = type;
|
|
this.Value = value;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsEnumCase",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
Name: "string",
|
|
Type: FsEnumCaseType,
|
|
Value: (0, _Util.Option)("string")
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsEnumCase = FsEnumCase;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsEnumCase", FsEnumCase);
|
|
|
|
class FsEnum {
|
|
constructor(name, cases) {
|
|
this.Name = name;
|
|
this.Cases = cases;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsEnum",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
Name: "string",
|
|
Cases: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: FsEnumCase
|
|
})
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
get Type() {
|
|
return (0, _Seq.exists)(c => c.Type.Equals(new FsEnumCaseType(2)), this.Cases) ? new FsEnumCaseType(2) : (0, _Seq.exists)(c_1 => c_1.Type.Equals(new FsEnumCaseType(1)), this.Cases) ? new FsEnumCaseType(1) : new FsEnumCaseType(0);
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsEnum = FsEnum;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsEnum", FsEnum);
|
|
|
|
class FsParamComment {
|
|
constructor(name, description) {
|
|
this.Name = name;
|
|
this.Description = description;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsParamComment",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
Name: "string",
|
|
Description: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: "string"
|
|
})
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsParamComment = FsParamComment;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsParamComment", FsParamComment);
|
|
|
|
class FsComment {
|
|
constructor(tag, data) {
|
|
this.tag = tag | 0;
|
|
this.data = data;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsComment",
|
|
interfaces: ["FSharpUnion", "System.IEquatable", "System.IComparable"],
|
|
cases: [["SummaryLine", "string"], ["Param", FsParamComment], ["Unknown", (0, _Util.Option)("string")]]
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return this === other || this.tag === other.tag && (0, _Util.equals)(this.data, other.data);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareUnions)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsComment = FsComment;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsComment", FsComment);
|
|
|
|
class FsParam {
|
|
constructor(comment, name, optional, paramArray, type) {
|
|
this.Comment = comment;
|
|
this.Name = name;
|
|
this.Optional = optional;
|
|
this.ParamArray = paramArray;
|
|
this.Type = type;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsParam",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
Comment: (0, _Util.Option)(FsComment),
|
|
Name: "string",
|
|
Optional: "boolean",
|
|
ParamArray: "boolean",
|
|
Type: FsType
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsParam = FsParam;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsParam", FsParam);
|
|
|
|
class FsFunctionKind {
|
|
constructor(tag, data) {
|
|
this.tag = tag | 0;
|
|
this.data = data;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsFunctionKind",
|
|
interfaces: ["FSharpUnion", "System.IEquatable", "System.IComparable"],
|
|
cases: [["Regular"], ["Constructor"], ["Call"], ["StringParam", "string"]]
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return this === other || this.tag === other.tag && (0, _Util.equals)(this.data, other.data);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareUnions)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsFunctionKind = FsFunctionKind;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsFunctionKind", FsFunctionKind);
|
|
|
|
class FsFunction {
|
|
constructor(comments, kind, isStatic, name, typeParameters, params, returnType) {
|
|
this.Comments = comments;
|
|
this.Kind = kind;
|
|
this.IsStatic = isStatic;
|
|
this.Name = name;
|
|
this.TypeParameters = typeParameters;
|
|
this.Params = params;
|
|
this.ReturnType = returnType;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsFunction",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
Comments: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: FsComment
|
|
}),
|
|
Kind: FsFunctionKind,
|
|
IsStatic: "boolean",
|
|
Name: (0, _Util.Option)("string"),
|
|
TypeParameters: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: FsType
|
|
}),
|
|
Params: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: FsParam
|
|
}),
|
|
ReturnType: FsType
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
get HasStringLiteralParams() {
|
|
return (0, _Seq.exists)(p => FsParamModule.isStringLiteral(p), this.Params);
|
|
}
|
|
|
|
get StringLiteralParams() {
|
|
return (0, _List.filter)(p => FsParamModule.isStringLiteral(p), this.Params);
|
|
}
|
|
|
|
get NonStringLiteralParams() {
|
|
return (0, _List.filter)($var2 => !FsParamModule.isStringLiteral($var2), this.Params);
|
|
}
|
|
|
|
get HasSummaryComments() {
|
|
return this.Comments.length > 0;
|
|
}
|
|
|
|
get HasParamComments() {
|
|
return (0, _Seq.exists)(p => FsParamModule.hasComment(p), this.Params);
|
|
}
|
|
|
|
get HasComments() {
|
|
return this.HasSummaryComments ? true : this.HasParamComments;
|
|
}
|
|
|
|
get SummaryLineComments() {
|
|
return (0, _List.choose)(v => FsCommentModule.asSummaryLine(v), this.Comments);
|
|
}
|
|
|
|
get ParamComments() {
|
|
return (0, _List.choose)(x => x, (0, _List.map)(p => FsParamModule.getComment(p), this.Params));
|
|
}
|
|
|
|
get AllComments() {
|
|
return (0, _List.append)(this.Comments, this.ParamComments);
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsFunction = FsFunction;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsFunction", FsFunction);
|
|
|
|
class FsPropertyKind {
|
|
constructor(tag) {
|
|
this.tag = tag | 0;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsPropertyKind",
|
|
interfaces: ["FSharpUnion", "System.IEquatable", "System.IComparable"],
|
|
cases: [["Regular"], ["Index"]]
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return this.tag === other.tag;
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.comparePrimitives)(this.tag, other.tag);
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsPropertyKind = FsPropertyKind;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsPropertyKind", FsPropertyKind);
|
|
|
|
class FsProperty {
|
|
constructor(comments, kind, index, name, option, type, isReadonly) {
|
|
this.Comments = comments;
|
|
this.Kind = kind;
|
|
this.Index = index;
|
|
this.Name = name;
|
|
this.Option = option;
|
|
this.Type = type;
|
|
this.IsReadonly = isReadonly;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsProperty",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
Comments: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: FsComment
|
|
}),
|
|
Kind: FsPropertyKind,
|
|
Index: (0, _Util.Option)(FsParam),
|
|
Name: "string",
|
|
Option: "boolean",
|
|
Type: FsType,
|
|
IsReadonly: "boolean"
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsProperty = FsProperty;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsProperty", FsProperty);
|
|
|
|
class FsGenericType {
|
|
constructor(type, typeParameters) {
|
|
this.Type = type;
|
|
this.TypeParameters = typeParameters;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsGenericType",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
Type: FsType,
|
|
TypeParameters: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: FsType
|
|
})
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsGenericType = FsGenericType;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsGenericType", FsGenericType);
|
|
|
|
class FsUnion {
|
|
constructor(option, types) {
|
|
this.Option = option;
|
|
this.Types = types;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsUnion",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
Option: "boolean",
|
|
Types: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: FsType
|
|
})
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsUnion = FsUnion;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsUnion", FsUnion);
|
|
|
|
class FsAlias {
|
|
constructor(name, type, typeParameters) {
|
|
this.Name = name;
|
|
this.Type = type;
|
|
this.TypeParameters = typeParameters;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsAlias",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
Name: "string",
|
|
Type: FsType,
|
|
TypeParameters: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: FsType
|
|
})
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsAlias = FsAlias;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsAlias", FsAlias);
|
|
|
|
class FsTupleKind {
|
|
constructor(tag) {
|
|
this.tag = tag | 0;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsTupleKind",
|
|
interfaces: ["FSharpUnion", "System.IEquatable", "System.IComparable"],
|
|
cases: [["Intersection"], ["Tuple"], ["Mapped"]]
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return this.tag === other.tag;
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.comparePrimitives)(this.tag, other.tag);
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsTupleKind = FsTupleKind;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsTupleKind", FsTupleKind);
|
|
|
|
class FsTuple {
|
|
constructor(types, kind) {
|
|
this.Types = types;
|
|
this.Kind = kind;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsTuple",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
Types: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: FsType
|
|
}),
|
|
Kind: FsTupleKind
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsTuple = FsTuple;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsTuple", FsTuple);
|
|
|
|
class TypeImport {
|
|
constructor(type, specifiedModule, resolvedModule) {
|
|
this.Type = type;
|
|
this.SpecifiedModule = specifiedModule;
|
|
this.ResolvedModule = resolvedModule;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.TypeImport",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
Type: "string",
|
|
SpecifiedModule: "string",
|
|
ResolvedModule: (0, _Util.Option)("string")
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.TypeImport = TypeImport;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.TypeImport", TypeImport);
|
|
|
|
class ModuleImport {
|
|
constructor(module, specifiedModule, resolvedModule) {
|
|
this.Module = module;
|
|
this.SpecifiedModule = specifiedModule;
|
|
this.ResolvedModule = resolvedModule;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.ModuleImport",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
Module: "string",
|
|
SpecifiedModule: "string",
|
|
ResolvedModule: (0, _Util.Option)("string")
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.ModuleImport = ModuleImport;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.ModuleImport", ModuleImport);
|
|
|
|
class FsImport {
|
|
constructor(tag, data) {
|
|
this.tag = tag | 0;
|
|
this.data = data;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsImport",
|
|
interfaces: ["FSharpUnion", "System.IEquatable", "System.IComparable"],
|
|
cases: [["Type", TypeImport], ["Module", ModuleImport]]
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return this === other || this.tag === other.tag && (0, _Util.equals)(this.data, other.data);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareUnions)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsImport = FsImport;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsImport", FsImport);
|
|
|
|
class FsExport {
|
|
constructor(isGlobal, selector, path) {
|
|
this.IsGlobal = isGlobal;
|
|
this.Selector = selector;
|
|
this.Path = path;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsExport",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
IsGlobal: "boolean",
|
|
Selector: "string",
|
|
Path: "string"
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsExport = FsExport;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsExport", FsExport);
|
|
|
|
class FsVariable {
|
|
constructor(_export, hasDeclare, name, type, isConst) {
|
|
this.Export = _export;
|
|
this.HasDeclare = hasDeclare;
|
|
this.Name = name;
|
|
this.Type = type;
|
|
this.IsConst = isConst;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsVariable",
|
|
interfaces: ["FSharpRecord", "System.IComparable"],
|
|
properties: {
|
|
Export: (0, _Util.Option)(FsExport),
|
|
HasDeclare: "boolean",
|
|
Name: "string",
|
|
Type: FsType,
|
|
IsConst: "boolean"
|
|
}
|
|
};
|
|
}
|
|
|
|
get IsGlobal() {
|
|
return (0, _CurriedLambda2.default)(() => this.Export != null)() ? (0, _Option.getValue)(this.Export).IsGlobal : false;
|
|
}
|
|
|
|
Equals(y) {
|
|
if (y instanceof FsVariable) {
|
|
return this.Name === y.Name;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
GetHashCode() {
|
|
return (0, _Util.hash)(this.Name);
|
|
}
|
|
|
|
CompareTo(y) {
|
|
if (y instanceof FsVariable) {
|
|
return (0, _Util.comparePrimitives)(this.Name, y.Name) | 0;
|
|
} else {
|
|
throw new Error("cannot compare values of different types" + "\nParameter name: " + "y");
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsVariable = FsVariable;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsVariable", FsVariable);
|
|
|
|
class FsMapped {
|
|
constructor(name, fullName) {
|
|
this.Name = name;
|
|
this.FullName = fullName;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsMapped",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
Name: "string",
|
|
FullName: "string"
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsMapped = FsMapped;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsMapped", FsMapped);
|
|
|
|
class FsType {
|
|
constructor(tag, data) {
|
|
this.tag = tag | 0;
|
|
this.data = data;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsType",
|
|
interfaces: ["FSharpUnion", "System.IEquatable", "System.IComparable"],
|
|
cases: [["Interface", FsInterface], ["Enum", FsEnum], ["Property", FsProperty], ["Param", FsParam], ["Array", FsType], ["TODO"], ["None"], ["Mapped", FsMapped], ["Function", FsFunction], ["Union", FsUnion], ["Alias", FsAlias], ["Generic", FsGenericType], ["Tuple", FsTuple], ["Module", FsModule], ["File", FsFile], ["FileOut", FsFileOut], ["Variable", FsVariable], ["StringLiteral", "string"], ["ExportAssignment", "string"], ["This"], ["Import", FsImport], ["TypeLiteral", FsTypeLiteral], ["GenericParameterDefaults", FsGenericParameterDefaults]]
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return this === other || this.tag === other.tag && (0, _Util.equals)(this.data, other.data);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareUnions)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsType = FsType;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsType", FsType);
|
|
|
|
class FsModule {
|
|
constructor(hasDeclare, isNamespace, name, types, helperLines, attributes) {
|
|
this.HasDeclare = hasDeclare;
|
|
this.IsNamespace = isNamespace;
|
|
this.Name = name;
|
|
this.Types = types;
|
|
this.HelperLines = helperLines;
|
|
this.Attributes = attributes;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsModule",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
HasDeclare: "boolean",
|
|
IsNamespace: "boolean",
|
|
Name: "string",
|
|
Types: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: FsType
|
|
}),
|
|
HelperLines: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: "string"
|
|
}),
|
|
Attributes: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: "string"
|
|
})
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
get IsHelper() {
|
|
return this.HelperLines.length > 0;
|
|
}
|
|
|
|
get HasAttributes() {
|
|
return this.Attributes.length > 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsModule = FsModule;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsModule", FsModule);
|
|
|
|
class FsFile {
|
|
constructor(fileName, moduleName, modules) {
|
|
this.FileName = fileName;
|
|
this.ModuleName = moduleName;
|
|
this.Modules = modules;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsFile",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
FileName: "string",
|
|
ModuleName: "string",
|
|
Modules: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: FsModule
|
|
})
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsFile = FsFile;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsFile", FsFile);
|
|
|
|
class FsFileOut {
|
|
constructor(namespace, opens, files) {
|
|
this.Namespace = namespace;
|
|
this.Opens = opens;
|
|
this.Files = files;
|
|
}
|
|
|
|
[_Symbol3.default.reflection]() {
|
|
return {
|
|
type: "ts2fable.Syntax.FsFileOut",
|
|
interfaces: ["FSharpRecord", "System.IEquatable", "System.IComparable"],
|
|
properties: {
|
|
Namespace: "string",
|
|
Opens: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: "string"
|
|
}),
|
|
Files: (0, _Util.makeGeneric)(_List2.default, {
|
|
T: FsFile
|
|
})
|
|
}
|
|
};
|
|
}
|
|
|
|
Equals(other) {
|
|
return (0, _Util.equalsRecords)(this, other);
|
|
}
|
|
|
|
CompareTo(other) {
|
|
return (0, _Util.compareRecords)(this, other) | 0;
|
|
}
|
|
|
|
}
|
|
|
|
exports.FsFileOut = FsFileOut;
|
|
(0, _Symbol2.setType)("ts2fable.Syntax.FsFileOut", FsFileOut);
|
|
|
|
const FsCommentModule = exports.FsCommentModule = function (__exports) {
|
|
const isSummaryLine = __exports.isSummaryLine = function (v) {
|
|
if (v.tag === 0) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
};
|
|
|
|
const asSummaryLine = __exports.asSummaryLine = function (v) {
|
|
if (v.tag === 0) {
|
|
return v.data;
|
|
} else {
|
|
return null;
|
|
}
|
|
};
|
|
|
|
const isParam = __exports.isParam = function (v) {
|
|
if (v.tag === 1) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
};
|
|
|
|
const asParam = __exports.asParam = function (v) {
|
|
if (v.tag === 1) {
|
|
return v.data;
|
|
} else {
|
|
return null;
|
|
}
|
|
};
|
|
|
|
return __exports;
|
|
}({});
|
|
|
|
const FsParamModule = exports.FsParamModule = function (__exports) {
|
|
const isStringLiteral = __exports.isStringLiteral = function (p) {
|
|
return FsTypeModule.isStringLiteral(p.Type);
|
|
};
|
|
|
|
const hasComment = __exports.hasComment = function (p) {
|
|
return (0, _CurriedLambda2.default)(() => p.Comment != null)();
|
|
};
|
|
|
|
const getComment = __exports.getComment = function (p) {
|
|
return p.Comment;
|
|
};
|
|
|
|
return __exports;
|
|
}({});
|
|
|
|
function simpleType(name) {
|
|
return new FsType(7, new FsMapped(name, name));
|
|
}
|
|
|
|
const FsTypeModule = exports.FsTypeModule = function (__exports) {
|
|
const isFunction = __exports.isFunction = function (tp) {
|
|
if (tp.tag === 8) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
};
|
|
|
|
const isInterface = __exports.isInterface = function (tp) {
|
|
if (tp.tag === 0) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
};
|
|
|
|
const isStringLiteral_1 = __exports.isStringLiteral = function (tp) {
|
|
if (tp.tag === 17) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
};
|
|
|
|
const isModule = __exports.isModule = function (tp) {
|
|
if (tp.tag === 13) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
};
|
|
|
|
const isVariable = __exports.isVariable = function (tp) {
|
|
if (tp.tag === 16) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
};
|
|
|
|
const isAlias = __exports.isAlias = function (tp) {
|
|
if (tp.tag === 10) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
};
|
|
|
|
const isGeneric = __exports.isGeneric = function (tp) {
|
|
if (tp.tag === 11) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
};
|
|
|
|
const asMapped = __exports.asMapped = function (tp) {
|
|
if (tp.tag === 7) {
|
|
return tp.data;
|
|
} else {
|
|
return null;
|
|
}
|
|
};
|
|
|
|
const asFunction = __exports.asFunction = function (tp) {
|
|
if (tp.tag === 8) {
|
|
return tp.data;
|
|
} else {
|
|
return null;
|
|
}
|
|
};
|
|
|
|
const asInterface = __exports.asInterface = function (tp) {
|
|
if (tp.tag === 0) {
|
|
return tp.data;
|
|
} else {
|
|
return null;
|
|
}
|
|
};
|
|
|
|
const asGeneric = __exports.asGeneric = function (tp) {
|
|
if (tp.tag === 11) {
|
|
return tp.data;
|
|
} else {
|
|
return null;
|
|
}
|
|
};
|
|
|
|
const asStringLiteral = __exports.asStringLiteral = function (tp) {
|
|
if (tp.tag === 17) {
|
|
return tp.data;
|
|
} else {
|
|
return null;
|
|
}
|
|
};
|
|
|
|
const asModule = __exports.asModule = function (tp) {
|
|
if (tp.tag === 13) {
|
|
return tp.data;
|
|
} else {
|
|
return null;
|
|
}
|
|
};
|
|
|
|
const asVariable = __exports.asVariable = function (tp) {
|
|
if (tp.tag === 16) {
|
|
return tp.data;
|
|
} else {
|
|
return null;
|
|
}
|
|
};
|
|
|
|
const asExportAssignment = __exports.asExportAssignment = function (tp) {
|
|
if (tp.tag === 18) {
|
|
return tp.data;
|
|
} else {
|
|
return null;
|
|
}
|
|
};
|
|
|
|
const asGenericParameterDefaults = __exports.asGenericParameterDefaults = function (tp) {
|
|
if (tp.tag === 22) {
|
|
return tp.data;
|
|
} else {
|
|
return null;
|
|
}
|
|
};
|
|
|
|
return __exports;
|
|
}({});
|
|
|
|
function isStatic(tp) {
|
|
if (tp.tag === 8) {
|
|
return tp.data.IsStatic;
|
|
} else if (tp.tag === 0) {
|
|
return tp.data.IsStatic;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function isConstructor(tp) {
|
|
if (tp.tag === 8) {
|
|
return tp.data.Kind.Equals(new FsFunctionKind(1));
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function getName(tp) {
|
|
getName: while (true) {
|
|
switch (tp.tag) {
|
|
case 0:
|
|
return tp.data.Name;
|
|
|
|
case 1:
|
|
return tp.data.Name;
|
|
|
|
case 3:
|
|
return tp.data.Name;
|
|
|
|
case 8:
|
|
return (0, _Option.defaultArg)(tp.data.Name, "");
|
|
|
|
case 2:
|
|
return tp.data.Name;
|
|
|
|
case 10:
|
|
return tp.data.Name;
|
|
|
|
case 16:
|
|
return tp.data.Name;
|
|
|
|
case 13:
|
|
return tp.data.Name;
|
|
|
|
case 14:
|
|
return tp.data.ModuleName;
|
|
|
|
case 11:
|
|
tp = tp.data.Type;
|
|
continue getName;
|
|
|
|
case 7:
|
|
return tp.data.Name;
|
|
|
|
case 4:
|
|
const name = getName(tp.data);
|
|
|
|
if (name === "") {
|
|
return "";
|
|
} else {
|
|
return (0, _String.toText)((0, _String.printf)("%sArray"))(name);
|
|
}
|
|
|
|
default:
|
|
return "";
|
|
}
|
|
}
|
|
}
|
|
|
|
function getFullName(tp) {
|
|
getFullName: while (true) {
|
|
switch (tp.tag) {
|
|
case 0:
|
|
return tp.data.FullName;
|
|
|
|
case 7:
|
|
return tp.data.FullName;
|
|
|
|
case 11:
|
|
tp = tp.data.Type;
|
|
continue getFullName;
|
|
|
|
case 14:
|
|
return tp.data.FileName;
|
|
|
|
default:
|
|
return getName(tp);
|
|
}
|
|
}
|
|
} |