├── .config └── dotnet-tools.json ├── .editorconfig ├── .fantomasignore ├── .github ├── ISSUE_TEMPLATE │ └── typescript-to-f--structure-conversion.md └── workflows │ ├── publish.yml │ └── test.yml ├── .gitignore ├── .husky ├── commit-msg ├── pre-commit └── task-runner.json ├── .markdownlint.json ├── .npmrc ├── .paket └── Paket.Restore.targets ├── .vscode └── settings.json ├── CHANGELOG.md ├── Directory.Build.props ├── Directory.Packages.props ├── Glutinum.Converter.sln ├── NOTES.md ├── README.md ├── build.bat ├── build.sh ├── cli.js ├── commit-linter.json ├── global.json ├── package.json ├── pnpm-lock.yaml ├── scripts ├── await-spawn.mjs ├── release-core.mjs └── release-pnpm.mjs ├── src ├── Glutinum.Build │ ├── Commands │ │ ├── Cli.fs │ │ ├── Format.fs │ │ ├── Lint.fs │ │ ├── Publish.fs │ │ ├── Test │ │ │ └── Specs.fs │ │ └── Web.fs │ ├── Glutinum.Build.fsproj │ ├── Main.fs │ ├── Utils │ │ ├── Changelog.fs │ │ ├── Npm.fs │ │ ├── Nuget.fs │ │ ├── Path.fs │ │ └── Pnpm.fs │ ├── Workspace.fs │ └── packages.lock.json ├── Glutinum.Converter.CLI │ ├── Glutinum.Converter.CLI.fsproj │ ├── Program.fs │ └── packages.lock.json ├── Glutinum.Converter │ ├── FsharpAST.fs │ ├── Generate.fs │ ├── GlueAST.fs │ ├── Glutinum.Converter.fsproj │ ├── Log.fs │ ├── Merge.fs │ ├── Prelude.fs │ ├── Printer.fs │ ├── Read.fs │ ├── Reader │ │ ├── ClassDeclaration.fs │ │ ├── Declaration.fs │ │ ├── Documentation.fs │ │ ├── EnumDeclaration.fs │ │ ├── ExportAssignment.fs │ │ ├── FunctionDeclaration.fs │ │ ├── IndexedAccessType.fs │ │ ├── InterfaceDeclaration.fs │ │ ├── MappedTypeNode.fs │ │ ├── ModuleDeclaration.fs │ │ ├── NamedTupleMember.fs │ │ ├── Node.fs │ │ ├── Parameters.fs │ │ ├── Report.fs │ │ ├── TypeAliasDeclaration.fs │ │ ├── TypeNode.fs │ │ ├── TypeOperatorNode.fs │ │ ├── TypeParameters.fs │ │ ├── TypeQueryNode.fs │ │ ├── TypeScriptReader.fs │ │ ├── Types.fs │ │ ├── UnionTypeNode.fs │ │ ├── Utils.fs │ │ └── VariableStatement.fs │ ├── Transform.fs │ ├── TypeScript.Extensions.fs │ ├── TypeScript.fs │ ├── Utils │ │ ├── Keywords.fs │ │ ├── List.fs │ │ ├── Naming.fs │ │ └── String.fs │ ├── js │ │ └── bootstrap.js │ └── packages.lock.json ├── Glutinum.Types │ ├── CHANGELOG.md │ ├── Glutinum.Types.fsproj │ ├── TypeScript.fs │ └── packages.lock.json └── Glutinum.Web │ ├── App.fs │ ├── Components │ ├── ASTViewer.fs │ ├── ASTViewer.module.scss │ ├── Loader.fs │ ├── Loader.module.scss │ ├── RightPanelContent.fs │ └── RightPanelContent.module.scss │ ├── Extensions │ ├── Elmish.fs │ └── Feliz.fs │ ├── Global │ ├── Router.fs │ └── Types.fs │ ├── Glutinum.Web.fsproj │ ├── IssueGenerator.fs │ ├── Libs │ ├── Glutinum.Feliz.MonacoEditor.fs │ └── Glutinum.LzString.fs │ ├── Main.fs │ ├── Pages │ ├── Editors.FSharpAST.FSharpASTViewer.fs │ ├── Editors.FSharpAST.fs │ ├── Editors.FSharpCode.fs │ ├── Editors.GlueAST.GlueASTViewer.fs │ ├── Editors.GlueAST.fs │ ├── Editors.fs │ ├── Editors.module.scss │ └── bootstrap.ts │ ├── index.html │ ├── packages.lock.json │ ├── public │ └── CNAME │ ├── scss │ ├── components │ │ └── thoth-toast.scss │ ├── lib-adapters │ │ └── _all.scss │ ├── main.scss │ └── variables.scss │ └── vite.config.ts ├── start-dev.sh ├── tests └── specs │ ├── index.js │ └── references │ ├── class │ ├── classWithRecursiveUnionToItself.d.ts │ ├── classWithRecursiveUnionToItself.fsx │ ├── constructorsWithSpread.d.ts │ ├── constructorsWithSpread.fsx │ ├── disabled.emptyClassGenerateAConstructor.d.ts │ ├── emptyClassGenerateAConstructor.fsx │ ├── generics │ │ ├── memberReturnThis.d.ts │ │ ├── memberReturnThis.fsx │ │ ├── multiple.d.ts │ │ ├── multiple.fsx │ │ ├── one.d.ts │ │ ├── one.fsx │ │ ├── oneWithConstraint.d.ts │ │ └── oneWithConstraint.fsx │ ├── heritage │ │ ├── genericResolvedWithConcreteType.d.ts │ │ ├── genericResolvedWithConcreteType.fsx │ │ ├── multipleGeneric.d.ts │ │ ├── multipleGeneric.fsx │ │ ├── nestedType.d.ts │ │ ├── nestedType.fsx │ │ ├── oneGeneric.d.ts │ │ ├── oneGeneric.fsx │ │ ├── simple.d.ts │ │ └── simple.fsx │ ├── memberReturnThis.d.ts │ ├── memberReturnThis.fsx │ ├── memberWithObjectBinding.d.ts │ ├── memberWithObjectBinding.fsx │ ├── members.d.ts │ ├── members.fsx │ ├── membersWithUnkownTypeReference.d.ts │ ├── membersWithUnkownTypeReference.fsx │ ├── methodWithOptionParametersDescribedWithOptionalType.d.ts │ ├── methodWithOptionParametersDescribedWithOptionalType.fsx │ ├── propertyDeclaration │ │ ├── emitCodeShouldUseOriginalName.d.ts │ │ ├── emitCodeShouldUseOriginalName.fsx │ │ ├── getAccessor.d.ts │ │ ├── getAccessor.fsx │ │ ├── getAndSetAccessor.d.ts │ │ ├── getAndSetAccessor.fsx │ │ ├── instanceProperty.d.ts │ │ ├── instanceProperty.fsx │ │ ├── privateField.d.ts │ │ ├── privateField.fsx │ │ ├── privateStaticProperty.d.ts │ │ ├── privateStaticProperty.fsx │ │ ├── setAccessor.d.ts │ │ ├── setAccessor.fsx │ │ ├── staticProperty.d.ts │ │ ├── staticProperty.fsx │ │ ├── staticPropertyReadOnly.d.ts │ │ └── staticPropertyReadOnly.fsx │ ├── simpleConstructors.d.ts │ ├── simpleConstructors.fsx │ ├── staticMemberWithArguments.d.ts │ ├── staticMemberWithArguments.fsx │ ├── staticMemberWithNoArguments.d.ts │ ├── staticMemberWithNoArguments.fsx │ ├── staticMemberWithReturnLiteralTypeIntersectionAndMultipleProperties.d.ts │ ├── staticMemberWithReturnLiteralTypeIntersectionAndMultipleProperties.fsx │ ├── staticMemberWithReturnLiteralTypeIntersectionWithTheClass.d.ts │ └── staticMemberWithReturnLiteralTypeIntersectionWithTheClass.fsx │ ├── documentation │ ├── constructor.d.ts │ ├── constructor.fsx │ ├── defaultValue │ │ ├── noSummary.d.ts │ │ ├── noSummary.fsx │ │ ├── withSummary.d.ts │ │ └── withSummary.fsx │ ├── deprecated │ │ ├── empty.d.ts │ │ ├── empty.fsx │ │ ├── multiLine.d.ts │ │ ├── multiLine.fsx │ │ ├── singleLine.d.ts │ │ └── singleLine.fsx │ ├── example │ │ ├── codeBlockWithLang.d.ts │ │ ├── codeBlockWithLang.fsx │ │ ├── multiple.d.ts │ │ ├── multiple.fsx │ │ ├── single.d.ts │ │ └── single.fsx │ ├── link │ │ ├── dontCrashNonUrlFormat.d.ts │ │ ├── dontCrashNonUrlFormat.fsx │ │ ├── urlOnly.d.ts │ │ ├── urlOnly.fsx │ │ ├── urlWithLabel.d.ts │ │ └── urlWithLabel.fsx │ ├── mdInlineCode.d.ts │ ├── mdInlineCode.fsx │ ├── methodSignature.d.ts │ ├── methodSignature.fsx │ ├── param │ │ ├── multiLine.d.ts │ │ ├── multiLine.fsx │ │ ├── multipleParam.d.ts │ │ ├── multipleParam.fsx │ │ ├── singleLine.d.ts │ │ └── singleLine.fsx │ ├── remarks │ │ ├── multiLine.d.ts │ │ ├── multiLine.fsx │ │ ├── singleLine.d.ts │ │ └── singleLine.fsx │ ├── returns │ │ ├── multiLine.d.ts │ │ ├── multiLine.fsx │ │ ├── singleLine.d.ts │ │ └── singleLine.fsx │ ├── simple.d.ts │ ├── simple.fsx │ ├── summary │ │ ├── multiLine.d.ts │ │ ├── multiLine.fsx │ │ ├── singleLine.d.ts │ │ └── singleLine.fsx │ ├── throws │ │ ├── multiLineWithRemarks.d.ts │ │ ├── multiLineWithRemarks.fsx │ │ ├── multiLineWithoutRemarks.d.ts │ │ ├── multiLineWithoutRemarks.fsx │ │ ├── multiplesWithRemarks.d.ts │ │ ├── multiplesWithRemarks.fsx │ │ ├── multiplesWithoutRemarks.d.ts │ │ ├── multiplesWithoutRemarks.fsx │ │ ├── singleLineWithRemarks.d.ts │ │ ├── singleLineWithRemarks.fsx │ │ ├── singleLineWithoutRemarks.d.ts │ │ └── singleLineWithoutRemarks.fsx │ ├── typeAlias.d.ts │ ├── typeAlias.fsx │ ├── typeParam │ │ ├── multiLine.d.ts │ │ ├── multiLine.fsx │ │ ├── multiplesTypeParams.d.ts │ │ ├── multiplesTypeParams.fsx │ │ ├── singleLine.d.ts │ │ └── singleLine.fsx │ ├── variable.d.ts │ └── variable.fsx │ ├── enums │ ├── literalNumericEnum.d.ts │ ├── literalNumericEnum.fsx │ ├── literalNumericEnumWithInheritance.d.ts │ ├── literalNumericEnumWithInheritance.fsx │ ├── literalNumericEnumWithInheritanceAndParenthesized.d.ts │ ├── literalNumericEnumWithInheritanceAndParenthesized.fsx │ ├── literalNumericEnumWithInheritanceWorksWithDuplicates.d.ts │ ├── literalNumericEnumWithInheritanceWorksWithDuplicates.fsx │ ├── literalNumericEnumWithNestedEnums.d.ts │ ├── literalNumericEnumWithNestedEnums.fsx │ ├── literalStringEnum.d.ts │ ├── literalStringEnum.fsx │ ├── literalStringEnumStartingWithDigit.d.ts │ ├── literalStringEnumStartingWithDigit.fsx │ ├── literalStringEnumWithAtSymbol.d.ts │ ├── literalStringEnumWithAtSymbol.fsx │ ├── literalStringEnumWithDash.d.ts │ ├── literalStringEnumWithDash.fsx │ ├── literalStringEnumWithDot.d.ts │ ├── literalStringEnumWithDot.fsx │ ├── literalStringEnumWithInheritance.d.ts │ ├── literalStringEnumWithInheritance.fsx │ ├── literalStringEnumWithInheritanceAndParenthesized.d.ts │ ├── literalStringEnumWithInheritanceAndParenthesized.fsx │ ├── literalStringEnumWithInheritanceWorksWithDupicates.d.ts │ ├── literalStringEnumWithInheritanceWorksWithDupicates.fsx │ ├── literalStringEnumWithLeftAngleBracket.d.ts │ ├── literalStringEnumWithLeftAngleBracket.fsx │ ├── literalStringEnumWithRightAngleBracket.d.ts │ ├── literalStringEnumWithRightAngleBracket.fsx │ ├── literalStringEnumWithSpace.d.ts │ ├── literalStringEnumWithSpace.fsx │ ├── namedIntEnum.d.ts │ ├── namedIntEnum.fsx │ ├── namedIntEnumWithInitialRank.d.ts │ ├── namedIntEnumWithInitialRank.fsx │ ├── namedStringEnum.d.ts │ ├── namedStringEnum.fsx │ ├── unionOptimisationHappensOnReturnsTypeToo.d.ts │ └── unionOptimisationHappensOnReturnsTypeToo.fsx │ ├── exclude │ ├── literalIntEnum.d.ts │ ├── literalIntEnum.fsx │ ├── literalIntEnumSingleCaseResult.d.ts │ ├── literalIntEnumSingleCaseResult.fsx │ ├── literalStringEnum.d.ts │ ├── literalStringEnum.fsx │ ├── literalStringEnumSingleCaseResult.d.ts │ └── literalStringEnumSingleCaseResult.fsx │ ├── exportAssignment │ ├── default │ │ ├── direct │ │ │ ├── class.d.ts │ │ │ └── class.fsx │ │ └── intermediateVariable │ │ │ ├── class.d.ts │ │ │ ├── class.fsx │ │ │ ├── primitive.d.ts │ │ │ └── primitive.fsx │ ├── functionReference.d.ts │ └── functionReference.fsx │ ├── exports │ ├── class.d.ts │ ├── class.fsx │ ├── classInModule.d.ts │ ├── classInModule.fsx │ ├── classInNamespace.d.ts │ ├── classInNamespace.fsx │ ├── classWithNoConstructorExplicitlyDefined.d.ts │ ├── classWithNoConstructorExplicitlyDefined.fsx │ ├── defaultClass.d.ts │ ├── defaultClass.fsx │ ├── duplicatedModuleDeclaration.d.ts │ ├── duplicatedModuleDeclaration.fsx │ ├── exportDeclaration.d.ts │ ├── exportDeclaration.fsx │ ├── functionWithArgument.d.ts │ ├── functionWithArgument.fsx │ ├── functionWithNoArgument.d.ts │ ├── functionWithNoArgument.fsx │ ├── functionWithOptionalArgument.d.ts │ ├── functionWithOptionalArgument.fsx │ ├── functionWithSeveralArguments.d.ts │ ├── functionWithSeveralArguments.fsx │ ├── functionWithTypeReferenceInNamespace.d.ts │ ├── functionWithTypeReferenceInNamespace.fsx │ ├── severalClassesInModule.d.ts │ ├── severalClassesInModule.fsx │ ├── severalFunctions.d.ts │ ├── severalFunctions.fsx │ ├── severalFunctionsInModule.d.ts │ ├── severalFunctionsInModule.fsx │ ├── variable.d.ts │ └── variable.fsx │ ├── functionDeclaration │ ├── argumentWithGenerics.d.ts │ ├── argumentWithGenerics.fsx │ ├── argumentWithObjectBinding.d.ts │ ├── argumentWithObjectBinding.fsx │ ├── optionalArgumentWithOptionalType.d.ts │ ├── optionalArgumentWithOptionalType.fsx │ ├── simple.d.ts │ ├── simple.fsx │ ├── typeReferenceWithGenerics.d.ts │ └── typeReferenceWithGenerics.fsx │ ├── functionType │ ├── interface │ │ ├── generics │ │ │ ├── moreGenericsOnParentThanNeeded.d.ts │ │ │ ├── moreGenericsOnParentThanNeeded.fsx │ │ │ ├── one.d.ts │ │ │ ├── one.fsx │ │ │ ├── several.d.ts │ │ │ └── several.fsx │ │ ├── multipleArguments.d.ts │ │ ├── multipleArguments.fsx │ │ ├── noArgument.d.ts │ │ ├── noArgument.fsx │ │ ├── oneArgument.d.ts │ │ ├── oneArgument.fsx │ │ ├── oneOptionalArgument.d.ts │ │ ├── oneOptionalArgument.fsx │ │ ├── withOptionalArguments.d.ts │ │ └── withOptionalArguments.fsx │ ├── oneGeneric.d.ts │ ├── oneGeneric.fsx │ ├── simple.d.ts │ ├── simple.fsx │ ├── spreadArgument.d.ts │ └── spreadArgument.fsx │ ├── indexedAccessType │ ├── interfaceWithSeveralMethods.d.ts │ ├── interfaceWithSeveralMethods.fsx │ ├── interfaceWithSingleMethod.d.ts │ └── interfaceWithSingleMethod.fsx │ ├── interfaces │ ├── callSignature.d.ts │ ├── callSignature.fsx │ ├── functionType │ │ ├── simple.d.ts │ │ └── simple.fsx │ ├── generics │ │ ├── multiple.d.ts │ │ ├── multiple.fsx │ │ ├── one.d.ts │ │ └── one.fsx │ ├── heritage │ │ ├── genericResolvedWithConcreteType.d.ts │ │ ├── genericResolvedWithConcreteType.fsx │ │ ├── multiple.d.ts │ │ ├── multiple.fsx │ │ ├── multipleGeneric.d.ts │ │ ├── multipleGeneric.fsx │ │ ├── nestedType.d.ts │ │ ├── nestedType.fsx │ │ ├── oneGeneric.d.ts │ │ ├── oneGeneric.fsx │ │ ├── simple.d.ts │ │ └── simple.fsx │ ├── indexSignature │ │ ├── numberParameter.d.ts │ │ ├── numberParameter.fsx │ │ ├── stringParameter.d.ts │ │ └── stringParameter.fsx │ ├── method.d.ts │ ├── method.fsx │ ├── methodWithArguments.d.ts │ ├── methodWithArguments.fsx │ ├── methodWithCallbackAndThisAnnotated.d.ts │ ├── methodWithCallbackAndThisAnnotated.fsx │ ├── multipleDeclaration.d.ts │ ├── multipleDeclaration.fsx │ ├── nullUnionIsTranslatedAsOption.d.ts │ ├── nullUnionIsTranslatedAsOption.fsx │ ├── optionalProperty │ │ ├── simple.d.ts │ │ ├── simple.fsx │ │ ├── withNullAndUndefinedUnionType.d.ts │ │ ├── withNullAndUndefinedUnionType.fsx │ │ ├── withNullUnionType.d.ts │ │ ├── withNullUnionType.fsx │ │ ├── withUndefinedUnionType.d.ts │ │ └── withUndefinedUnionType.fsx │ ├── quotedProperty.d.ts │ ├── quotedProperty.fsx │ ├── readAndWriteProperty.d.ts │ ├── readAndWriteProperty.fsx │ ├── readonlyProperty.d.ts │ ├── readonlyProperty.fsx │ ├── undefinedUnionIsTranslatedAsOption.d.ts │ └── undefinedUnionIsTranslatedAsOption.fsx │ ├── intersectionType │ ├── insideOfTypeArguments.d.ts │ ├── insideOfTypeArguments.fsx │ ├── intermediateTypeLiteral.d.ts │ ├── intermediateTypeLiteral.fsx │ ├── mixInterfaceAndTypeLiteral.d.ts │ ├── mixInterfaceAndTypeLiteral.fsx │ ├── mixInterfaceAndUnionTypeLiteral.d.ts │ ├── mixInterfaceAndUnionTypeLiteral.fsx │ ├── mutiplesInterfacesAndTypeLiterals.d.ts │ ├── mutiplesInterfacesAndTypeLiterals.fsx │ ├── simple.d.ts │ ├── simple.fsx │ ├── usedAsReturnTypeOfFunction.d.ts │ ├── usedAsReturnTypeOfFunction.fsx │ ├── withInterfaceInNamespace.d.ts │ └── withInterfaceInNamespace.fsx │ ├── iterable │ ├── IterableIterator │ │ ├── class.d.ts │ │ ├── class.fsx │ │ ├── typeLiteral.d.ts │ │ └── typeLiteral.fsx │ ├── customIterator.d.ts │ ├── customIterator.fsx │ ├── customIteratorDefaultToAnyIfDetectionFails.d.ts │ └── customIteratorDefaultToAnyIfDetectionFails.fsx │ ├── keyof │ ├── fromInterfaceProperty.d.ts │ ├── fromInterfaceProperty.fsx │ ├── method.d.ts │ ├── method.fsx │ ├── quotedProperty.d.ts │ ├── quotedProperty.fsx │ ├── simpleObject.d.ts │ ├── simpleObject.fsx │ ├── typeof.d.ts │ ├── typeof.fsx │ ├── unknown.d.ts │ └── unknown.fsx │ ├── literalType │ ├── emptyTuple.d.ts │ ├── emptyTuple.fsx │ ├── false.d.ts │ ├── false.fsx │ ├── float.d.ts │ ├── float.fsx │ ├── integer.d.ts │ ├── integer.fsx │ ├── null.d.ts │ ├── null.fsx │ ├── string.d.ts │ ├── string.fsx │ ├── true.d.ts │ ├── true.fsx │ ├── undefined.d.ts │ └── undefined.fsx │ ├── namedTuple │ ├── simple.d.ts │ └── simple.fsx │ ├── namespace │ ├── notExported.d.ts │ └── notExported.fsx │ ├── naming │ ├── dollar.d.ts │ ├── dollar.fsx │ ├── hash.d.ts │ └── hash.fsx │ ├── omit │ ├── intersectionType.d.ts │ ├── intersectionType.fsx │ ├── mutiple.d.ts │ ├── mutiple.fsx │ ├── nonExistingProperty.d.ts │ ├── nonExistingProperty.fsx │ ├── nonExistingType.d.ts │ ├── nonExistingType.fsx │ ├── resultInEmptyInterface.d.ts │ ├── resultInEmptyInterface.fsx │ ├── simple.d.ts │ ├── simple.fsx │ ├── worksAsReturnType.d.ts │ └── worksAsReturnType.fsx │ ├── parenthesizedType │ ├── simple.d.ts │ └── simple.fsx │ ├── partial │ ├── dontCrashOnUnkownTypes.d.ts │ ├── dontCrashOnUnkownTypes.fsx │ ├── generateATypeAliasWhenUsedForTypingApi.d.ts │ ├── generateATypeAliasWhenUsedForTypingApi.fsx │ ├── inheritance │ │ ├── multipleTypeDeclaration.d.ts │ │ ├── multipleTypeDeclaration.fsx │ │ ├── nullabledUnionAreOptimised.d.ts │ │ ├── nullabledUnionAreOptimised.fsx │ │ ├── optionalPropertyAreForwardedAsIs.d.ts │ │ ├── optionalPropertyAreForwardedAsIs.fsx │ │ ├── simple.d.ts │ │ └── simple.fsx │ ├── intersectionType.d.ts │ ├── intersectionType.fsx │ ├── literalType.d.ts │ ├── literalType.fsx │ ├── simple.d.ts │ └── simple.fsx │ ├── readonly │ ├── asReturnTypeSimple.d.ts │ ├── asReturnTypeSimple.fsx │ ├── asReturnTypeUnion.d.ts │ ├── asReturnTypeUnion.fsx │ ├── class.d.ts │ ├── class.fsx │ ├── intersection.d.ts │ ├── intersection.fsx │ ├── simple.d.ts │ ├── simple.fsx │ ├── union.d.ts │ └── union.fsx │ ├── regressions │ ├── recursive-type-1.d.ts │ └── recursive-type-1.fsx │ ├── replacements │ ├── Array.d.ts │ ├── Array.fsx │ ├── Boolean.d.ts │ ├── Boolean.fsx │ ├── Error.d.ts │ ├── Error.fsx │ ├── Float32Array.d.ts │ ├── Float32Array.fsx │ ├── Float64Array.d.ts │ ├── Float64Array.fsx │ ├── Function.d.ts │ ├── Function.fsx │ ├── Int16Array.d.ts │ ├── Int16Array.fsx │ ├── Int32Array.d.ts │ ├── Int32Array.fsx │ ├── Int8Array.d.ts │ ├── Int8Array.fsx │ ├── Promise.d.ts │ ├── Promise.fsx │ ├── ReadonlyArray.d.ts │ ├── ReadonlyArray.fsx │ ├── RegExp.d.ts │ ├── RegExp.fsx │ ├── Uint16Array.d.ts │ ├── Uint16Array.fsx │ ├── Uint32Array.d.ts │ ├── Uint32Array.fsx │ ├── Uint8Array.d.ts │ ├── Uint8Array.fsx │ ├── Uint8ClampedArray.d.ts │ ├── Uint8ClampedArray.fsx │ ├── date.d.ts │ ├── date.fsx │ ├── readonly_array.d.ts │ └── readonly_array.fsx │ ├── returnType │ ├── any.d.ts │ ├── any.fsx │ ├── functionWithArgument.d.ts │ ├── functionWithArgument.fsx │ ├── functionWithNoArgument.d.ts │ ├── functionWithNoArgument.fsx │ ├── generic.d.ts │ ├── generic.fsx │ ├── genericWithExtends.d.ts │ ├── genericWithExtends.fsx │ ├── never.d.ts │ ├── never.fsx │ ├── typeOfFunctionWithLiteralType.d.ts │ └── typeOfFunctionWithLiteralType.fsx │ ├── returnedType │ ├── record.d.ts │ ├── record.fsx │ ├── templateLiteralType.d.ts │ └── templateLiteralType.fsx │ ├── templateLiteralType │ ├── simple.d.ts │ └── simple.fsx │ ├── thisParameterType │ ├── simple.d.ts │ └── simple.fsx │ ├── tupleType │ ├── inUnionType.d.ts │ ├── inUnionType.fsx │ ├── mixedArgumentsType.d.ts │ ├── mixedArgumentsType.fsx │ ├── severalArguments.d.ts │ ├── severalArguments.fsx │ ├── singleArgument.d.ts │ ├── singleArgument.fsx │ ├── withOptionalType.d.ts │ └── withOptionalType.fsx │ ├── typeAlias │ ├── conditionalType │ │ ├── defaultToCheckedType.d.ts │ │ ├── defaultToCheckedType.fsx │ │ ├── simple.d.ts │ │ └── simple.fsx │ ├── constraints │ │ ├── multiple.d.ts │ │ ├── multiple.fsx │ │ ├── single.d.ts │ │ └── single.fsx │ ├── interface.d.ts │ ├── interface.fsx │ ├── literal │ │ ├── boolean.d.ts │ │ ├── boolean.fsx │ │ ├── float.d.ts │ │ ├── float.fsx │ │ ├── int.d.ts │ │ ├── int.fsx │ │ ├── string.d.ts │ │ └── string.fsx │ ├── primitives │ │ ├── array.d.ts │ │ ├── array.fsx │ │ ├── boolean.d.ts │ │ ├── boolean.fsx │ │ ├── disabled.float.d.ts │ │ ├── disabled.float.fsx │ │ ├── float.fsx │ │ ├── number.d.ts │ │ ├── number.fsx │ │ ├── object.d.ts │ │ ├── object.fsx │ │ ├── string.d.ts │ │ ├── string.fsx │ │ ├── symbol.d.ts │ │ └── symbol.fsx │ ├── record.d.ts │ ├── record.fsx │ ├── tupleType.d.ts │ ├── tupleType.fsx │ ├── typeParameter.d.ts │ ├── typeParameter.fsx │ ├── typeReference.d.ts │ ├── typeReference.fsx │ ├── unions │ │ ├── primiteAndTypeReference.d.ts │ │ ├── primiteAndTypeReference.fsx │ │ ├── primitiveAndTypeReferenceToAnInterface.d.ts │ │ ├── primitiveAndTypeReferenceToAnInterface.fsx │ │ ├── primitives.d.ts │ │ └── primitives.fsx │ ├── unknown.d.ts │ └── unknown.fsx │ ├── typeLiteral │ ├── argumentsInMethod │ │ ├── namesAreSanitized.d.ts │ │ ├── namesAreSanitized.fsx │ │ ├── nested.d.ts │ │ ├── nested.fsx │ │ ├── simple.d.ts │ │ ├── simple.fsx │ │ ├── undefinedTypesAreConvertedToOptionalArguments.d.ts │ │ └── undefinedTypesAreConvertedToOptionalArguments.fsx │ ├── constructSignature.d.ts │ ├── constructSignature.fsx │ ├── constructorType │ │ ├── simple.d.ts │ │ ├── simple.fsx │ │ ├── withOneGenerics.d.ts │ │ └── withOneGenerics.fsx │ ├── functionType │ │ ├── generics.d.ts │ │ └── generics.fsx │ ├── indexSignature │ │ ├── mixed.d.ts │ │ ├── mixed.fsx │ │ ├── readonly.d.ts │ │ ├── readonly.fsx │ │ ├── simple.d.ts │ │ └── simple.fsx │ ├── returnType │ │ ├── classMethod.d.ts │ │ ├── classMethod.fsx │ │ ├── function.d.ts │ │ ├── function.fsx │ │ ├── typeAliasMethod.d.ts │ │ └── typeAliasMethod.fsx │ ├── typeAlias │ │ ├── arguments.d.ts │ │ ├── arguments.fsx │ │ ├── nested.d.ts │ │ ├── nested.fsx │ │ ├── readonlyProperty.d.ts │ │ ├── readonlyProperty.fsx │ │ ├── simple.d.ts │ │ └── simple.fsx │ ├── variableExport.d.ts │ └── variableExport.fsx │ ├── typeOperator │ ├── readonly.d.ts │ └── readonly.fsx │ ├── typePredicate │ ├── convertedToBool.d.ts │ └── convertedToBool.fsx │ ├── typeQuery │ ├── class.d.ts │ ├── class.fsx │ ├── functionType.d.ts │ ├── functionType.fsx │ ├── namespace.d.ts │ ├── namespace.fsx │ └── primitive │ │ ├── boolean.d.ts │ │ ├── boolean.fsx │ │ ├── null.d.ts │ │ ├── null.fsx │ │ ├── number.d.ts │ │ ├── number.fsx │ │ ├── string.d.ts │ │ ├── string.fsx │ │ ├── undefined.d.ts │ │ ├── undefined.fsx │ │ ├── unit.d.ts │ │ └── unit.fsx │ ├── typeof │ ├── typeofStrings.d.ts │ └── typeofStrings.fsx │ ├── unionType │ ├── singleUnionResolved.d.ts │ ├── singleUnionResolved.fsx │ ├── typeLiteral.d.ts │ ├── typeLiteral.fsx │ ├── withArray.d.ts │ ├── withArray.fsx │ ├── withRecord.d.ts │ ├── withRecord.fsx │ ├── withTypeAliasDeclaration.d.ts │ ├── withTypeAliasDeclaration.fsx │ ├── withTypeParameter.d.ts │ └── withTypeParameter.fsx │ └── unknown │ ├── simple.d.ts │ └── simple.fsx └── vitest.workspace.ts /.fantomasignore: -------------------------------------------------------------------------------- 1 | tests/specs/ 2 | src/Glutinum.Converter/TypeScript.fs 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/typescript-to-f--structure-conversion.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: TypeScript to F# structure conversion 3 | about: Use this template to ask supporting a new TypeScript to F# conversion 4 | title: '' 5 | labels: "Syntax support,area:converter" 6 | assignees: '' 7 | 8 | --- 9 | 10 | TypeScript documentation: 11 | 12 | ```ts 13 | 14 | ``` 15 | 16 | translates into 17 | 18 | ```fs 19 | 20 | ``` 21 | 22 | Example of npm package using this features: 23 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "MD024": false, 3 | "MD007": { 4 | "indent": 4 5 | }, 6 | "MD038": false, 7 | "MD013": false, 8 | "MD033": false, 9 | "MD036": false, 10 | "MD046": false 11 | } 12 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | engine-strict=true 2 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "explorer.fileNesting.patterns": { 3 | "*.d.ts": "${capture}.fsx" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | dotnet tool restore 4 | dotnet run --project src/Glutinum.Build/Glutinum.Build.fsproj -- %* 5 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -x 2 | 3 | dotnet tool restore 4 | dotnet run --project src/Glutinum.Build/Glutinum.Build.fsproj -- $@ 5 | -------------------------------------------------------------------------------- /cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import './dist/Program.js' 3 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "8.0.100", 4 | "rollForward": "latestMinor" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/Glutinum.Build/Commands/Format.fs: -------------------------------------------------------------------------------- 1 | module Build.Commands.Format 2 | 3 | open SimpleExec 4 | open Spectre.Console.Cli 5 | 6 | type FormatSettings() = 7 | inherit CommandSettings() 8 | 9 | type FormatCommand() = 10 | inherit Command() 11 | 12 | override _.Execute(context, settings) = 13 | Command.Run("dotnet", "fantomas src tests") 14 | 15 | 0 16 | -------------------------------------------------------------------------------- /src/Glutinum.Build/Commands/Lint.fs: -------------------------------------------------------------------------------- 1 | module Build.Commands.Lint 2 | 3 | open SimpleExec 4 | open Spectre.Console.Cli 5 | 6 | type LintSettings() = 7 | inherit CommandSettings() 8 | 9 | type LintCommand() = 10 | inherit Command() 11 | 12 | override _.Execute(context, settings) = 13 | Command.Run("dotnet", "fantomas --check src tests") 14 | 15 | 0 16 | -------------------------------------------------------------------------------- /src/Glutinum.Build/Workspace.fs: -------------------------------------------------------------------------------- 1 | module Build.Workspace 2 | 3 | open EasyBuild.FileSystemProvider 4 | 5 | [] 6 | let root = __SOURCE_DIRECTORY__ + "/../../" 7 | 8 | type Workspace = RelativeFileSystem 9 | 10 | type VirtualWorkspace = 11 | VirtualFileSystem< 12 | root, 13 | """ 14 | dist 15 | fable_modules 16 | .gitignore 17 | """ 18 | > 19 | -------------------------------------------------------------------------------- /src/Glutinum.Converter.CLI/Glutinum.Converter.CLI.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0.1.0-alpha-001 5 | netstandard2.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Glutinum.Converter/Log.fs: -------------------------------------------------------------------------------- 1 | module Glutinum.Converter.Log 2 | 3 | open Glutinum.Chalk 4 | open Fable.Core 5 | 6 | let success (text: string) = 7 | JS.console.error (chalk.greenBright.Invoke text) 8 | 9 | let log (text: string) = JS.console.error text 10 | 11 | let info (text: string) = 12 | JS.console.error (chalk.blueBright.Invoke text) 13 | 14 | let warn (text: string) = 15 | JS.console.error (chalk.yellowBright.Invoke text) 16 | 17 | let error (text: string) = 18 | JS.console.error (chalk.redBright.Invoke text) 19 | 20 | let debug (text: string) = 21 | JS.console.error (chalk.gray.Invoke text) 22 | -------------------------------------------------------------------------------- /src/Glutinum.Converter/Prelude.fs: -------------------------------------------------------------------------------- 1 | module Glutinum.Converter.Prelude 2 | 3 | [] 4 | let VERSION = "0.12.0" 5 | -------------------------------------------------------------------------------- /src/Glutinum.Converter/Read.fs: -------------------------------------------------------------------------------- 1 | module rec Glutinum.Converter.Read 2 | 3 | open TypeScript 4 | open Glutinum.Converter.Reader.Types 5 | open Glutinum.Converter.Reader.TypeScriptReader 6 | 7 | let readSourceFile (checker: Ts.TypeChecker) (sourceFile: option) = 8 | let reader: ITypeScriptReader = TypeScriptReader(checker) 9 | 10 | {| 11 | GlueAST = sourceFile.Value.statements |> List.ofSeq |> List.map reader.ReadNode 12 | Warnings = reader.Warnings 13 | TypeMemory = reader.TypeMemory |> List.ofSeq 14 | |} 15 | -------------------------------------------------------------------------------- /src/Glutinum.Converter/Reader/NamedTupleMember.fs: -------------------------------------------------------------------------------- 1 | module Glutinum.Converter.Reader.NamedTupleMember 2 | 3 | open Glutinum.Converter.GlueAST 4 | open Glutinum.Converter.Reader.Types 5 | open TypeScript 6 | 7 | let readNamedTupleMember (reader: ITypeScriptReader) (declaration: Ts.NamedTupleMember) : GlueType = 8 | 9 | ({ 10 | Name = declaration.name.getText () 11 | Type = reader.ReadTypeNode declaration.``type`` 12 | } 13 | : NamedTupleType) 14 | |> GlueType.NamedTupleType 15 | -------------------------------------------------------------------------------- /src/Glutinum.Converter/Utils/List.fs: -------------------------------------------------------------------------------- 1 | [] 2 | module List 3 | 4 | open System 5 | 6 | let removeConsecutiveEmptyLines list = 7 | let rec loop acc = 8 | function 9 | | [] -> List.rev acc 10 | | "" :: "" :: rest -> loop acc rest 11 | | x :: rest -> loop (x :: acc) rest 12 | 13 | loop [] list 14 | 15 | let trimEmptyLines list = 16 | list 17 | |> List.skipWhile String.IsNullOrEmpty 18 | |> List.rev 19 | |> List.skipWhile String.IsNullOrEmpty 20 | |> List.rev 21 | -------------------------------------------------------------------------------- /src/Glutinum.Converter/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | import { createProjectSync } from "@ts-morph/bootstrap"; 2 | 3 | /** 4 | * 5 | * @param {string} filePath 6 | * @param {string} source 7 | * @returns 8 | */ 9 | export default function createProgramForCLI(filePath, source) { 10 | 11 | const project = createProjectSync({}) 12 | 13 | project.createSourceFile(filePath, source) 14 | 15 | return project.createProgram() 16 | } 17 | -------------------------------------------------------------------------------- /src/Glutinum.Types/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 | 7 | 8 | 9 | 10 | 11 | ## 0.1.0 12 | 13 | ### 🚀 Features 14 | 15 | * Create Glutinum.Types NuGet to host native API bindings ([ec0dd14](https://github.com/glutinum-org/cli/commit/ec0dd1482f036ff87affaddbcfc22216e2caf239)) 16 | 17 | ## 0.0.0 18 | -------------------------------------------------------------------------------- /src/Glutinum.Web/Components/Loader.fs: -------------------------------------------------------------------------------- 1 | module Glutinum.Web.Components.Loader 2 | 3 | open Fable.Core 4 | open Feliz 5 | 6 | [] 7 | let private classes: CssModules.Components.Loader = nativeOnly 8 | 9 | [] 10 | type Loader = 11 | static member Loader() = 12 | Html.div [ 13 | prop.className classes.container 14 | prop.children [ Html.span [ prop.className classes.loader ] ] 15 | ] 16 | -------------------------------------------------------------------------------- /src/Glutinum.Web/Extensions/Feliz.fs: -------------------------------------------------------------------------------- 1 | namespace Feliz 2 | 3 | open Feliz 4 | open Elmish 5 | 6 | [] 7 | module Extensions = 8 | 9 | type prop with 10 | 11 | static member inline onClick<'Msg>(dispatch: Dispatch<'Msg>, msg: 'Msg) = 12 | prop.onClick (fun _ -> dispatch msg) 13 | -------------------------------------------------------------------------------- /src/Glutinum.Web/Global/Types.fs: -------------------------------------------------------------------------------- 1 | module Glutinum.Web.Global.Types 2 | 3 | [] 4 | type CompilationResult = 5 | | Success of fsharpCode: string * warnings: string list * errors: string list 6 | | Error of string 7 | -------------------------------------------------------------------------------- /src/Glutinum.Web/Pages/bootstrap.ts: -------------------------------------------------------------------------------- 1 | import { createProjectSync } from "@ts-morph/bootstrap"; 2 | 3 | export default function createProgram(source : string) { 4 | 5 | const project = createProjectSync({ 6 | useInMemoryFileSystem: true, 7 | }) 8 | 9 | project.createSourceFile('index.d.ts', source) 10 | 11 | return project.createProgram() 12 | } 13 | -------------------------------------------------------------------------------- /src/Glutinum.Web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Glutinum - Web 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Glutinum.Web/public/CNAME: -------------------------------------------------------------------------------- 1 | glutinum.net 2 | -------------------------------------------------------------------------------- /src/Glutinum.Web/scss/lib-adapters/_all.scss: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | -------------------------------------------------------------------------------- /src/Glutinum.Web/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig((env) => { 6 | const isDevelpoment = env.mode === 'development'; 7 | 8 | return { 9 | css: { 10 | devSourcemap: isDevelpoment 11 | }, 12 | plugins: [react()], 13 | server: { 14 | watch: { 15 | ignored: [ 16 | "**/*.fs" 17 | ] 18 | } 19 | }, 20 | clearScreen: false 21 | } 22 | }) 23 | -------------------------------------------------------------------------------- /tests/specs/references/class/classWithRecursiveUnionToItself.d.ts: -------------------------------------------------------------------------------- 1 | export declare class MyClass { 2 | contains(otherBoundsOrLatLng: MyUnion | string): boolean; 3 | } 4 | 5 | export type MyUnion = MyClass | string; 6 | -------------------------------------------------------------------------------- /tests/specs/references/class/classWithRecursiveUnionToItself.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member MyClass () : MyClass = nativeOnly 12 | 13 | [] 14 | [] 15 | type MyClass = 16 | abstract member contains: otherBoundsOrLatLng: U2 -> bool 17 | 18 | type MyUnion = 19 | U2 20 | 21 | (***) 22 | #r "nuget: Fable.Core" 23 | #r "nuget: Glutinum.Types" 24 | (***) 25 | -------------------------------------------------------------------------------- /tests/specs/references/class/constructorsWithSpread.d.ts: -------------------------------------------------------------------------------- 1 | export class Logger { 2 | constructor() 3 | 4 | constructor(...args: string[]) 5 | } 6 | -------------------------------------------------------------------------------- /tests/specs/references/class/disabled.emptyClassGenerateAConstructor.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glutinum-org/cli/ba3301a4b67a95adb0438a6106bead64894cf395/tests/specs/references/class/disabled.emptyClassGenerateAConstructor.d.ts -------------------------------------------------------------------------------- /tests/specs/references/class/emptyClassGenerateAConstructor.fsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glutinum-org/cli/ba3301a4b67a95adb0438a6106bead64894cf395/tests/specs/references/class/emptyClassGenerateAConstructor.fsx -------------------------------------------------------------------------------- /tests/specs/references/class/generics/memberReturnThis.d.ts: -------------------------------------------------------------------------------- 1 | export interface MyObject { 2 | instance: () => this; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/class/generics/memberReturnThis.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type MyObject<'T> = 10 | abstract member instance: (unit -> MyObject<'T>) with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/class/generics/multiple.d.ts: -------------------------------------------------------------------------------- 1 | class User {} 2 | -------------------------------------------------------------------------------- /tests/specs/references/class/generics/multiple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member User<'A, 'B> () : User<'A, 'B> = nativeOnly 12 | 13 | [] 14 | [] 15 | type User<'A, 'B> = 16 | interface end 17 | 18 | (***) 19 | #r "nuget: Fable.Core" 20 | #r "nuget: Glutinum.Types" 21 | (***) 22 | -------------------------------------------------------------------------------- /tests/specs/references/class/generics/one.d.ts: -------------------------------------------------------------------------------- 1 | class User {} 2 | -------------------------------------------------------------------------------- /tests/specs/references/class/generics/one.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member User<'A> () : User<'A> = nativeOnly 12 | 13 | [] 14 | [] 15 | type User<'A> = 16 | interface end 17 | 18 | (***) 19 | #r "nuget: Fable.Core" 20 | #r "nuget: Glutinum.Types" 21 | (***) 22 | -------------------------------------------------------------------------------- /tests/specs/references/class/generics/oneWithConstraint.d.ts: -------------------------------------------------------------------------------- 1 | class A {} 2 | 3 | class User {} 4 | -------------------------------------------------------------------------------- /tests/specs/references/class/heritage/genericResolvedWithConcreteType.d.ts: -------------------------------------------------------------------------------- 1 | declare class User { 2 | a: A; 3 | b: B; 4 | } 5 | 6 | class IUser extends User {} 7 | -------------------------------------------------------------------------------- /tests/specs/references/class/heritage/multipleGeneric.d.ts: -------------------------------------------------------------------------------- 1 | declare class User { 2 | a: A; 3 | b: B; 4 | } 5 | -------------------------------------------------------------------------------- /tests/specs/references/class/heritage/multipleGeneric.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member User<'A, 'B> () : User<'A, 'B> = nativeOnly 12 | 13 | [] 14 | [] 15 | type User<'A, 'B> = 16 | abstract member a: 'A with get, set 17 | abstract member b: 'B with get, set 18 | 19 | (***) 20 | #r "nuget: Fable.Core" 21 | #r "nuget: Glutinum.Types" 22 | (***) 23 | -------------------------------------------------------------------------------- /tests/specs/references/class/heritage/nestedType.d.ts: -------------------------------------------------------------------------------- 1 | class IAge { 2 | years: A; 3 | } 4 | 5 | declare class User { 6 | bag: Bag; 7 | age: IAge; 8 | } 9 | 10 | class IUser extends User {} 11 | -------------------------------------------------------------------------------- /tests/specs/references/class/heritage/oneGeneric.d.ts: -------------------------------------------------------------------------------- 1 | declare class User { 2 | bag: Bag; 3 | } 4 | 5 | class IUser extends User {} 6 | -------------------------------------------------------------------------------- /tests/specs/references/class/heritage/simple.d.ts: -------------------------------------------------------------------------------- 1 | class CoreTableState {} 2 | 3 | class TableState extends CoreTableState { 4 | } 5 | -------------------------------------------------------------------------------- /tests/specs/references/class/memberReturnThis.d.ts: -------------------------------------------------------------------------------- 1 | export interface MyObject { 2 | instance: () => this; 3 | 4 | instance1: (a : Boolean) => this; 5 | 6 | instance2: (a : Boolean, b : number) => this; 7 | } 8 | -------------------------------------------------------------------------------- /tests/specs/references/class/memberReturnThis.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type MyObject = 10 | abstract member instance: (unit -> MyObject) with get, set 11 | abstract member instance1: (bool -> MyObject) with get, set 12 | abstract member instance2: MyObject.instance2 with get, set 13 | 14 | module MyObject = 15 | 16 | type instance2 = 17 | delegate of a: bool * b: float -> MyObject 18 | 19 | (***) 20 | #r "nuget: Fable.Core" 21 | #r "nuget: Glutinum.Types" 22 | (***) 23 | -------------------------------------------------------------------------------- /tests/specs/references/class/memberWithObjectBinding.d.ts: -------------------------------------------------------------------------------- 1 | export interface LogOptions { 2 | prefix: string; 3 | } 4 | 5 | export interface Context { 6 | indentationLevel: number; 7 | } 8 | 9 | declare class Signature { 10 | toText({ indentationLevel }: Context, data : string, {prefix }?: LogOptions): string; 11 | } 12 | -------------------------------------------------------------------------------- /tests/specs/references/class/members.d.ts: -------------------------------------------------------------------------------- 1 | export class Dayjs { 2 | constructor(); 3 | 4 | clone(): Dayjs; 5 | 6 | isValid(): boolean; 7 | 8 | locale(): string; 9 | } 10 | -------------------------------------------------------------------------------- /tests/specs/references/class/members.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member Dayjs () : Dayjs = nativeOnly 12 | 13 | [] 14 | [] 15 | type Dayjs = 16 | abstract member clone: unit -> Dayjs 17 | abstract member isValid: unit -> bool 18 | abstract member locale: unit -> string 19 | 20 | (***) 21 | #r "nuget: Fable.Core" 22 | #r "nuget: Glutinum.Types" 23 | (***) 24 | -------------------------------------------------------------------------------- /tests/specs/references/class/membersWithUnkownTypeReference.d.ts: -------------------------------------------------------------------------------- 1 | export class Dayjs { 2 | constructor(); 3 | 4 | locale(preset: string | ILocale): Dayjs; 5 | } 6 | -------------------------------------------------------------------------------- /tests/specs/references/class/membersWithUnkownTypeReference.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member Dayjs () : Dayjs = nativeOnly 12 | 13 | [] 14 | [] 15 | type Dayjs = 16 | abstract member locale: preset: U2 -> Dayjs 17 | 18 | (***) 19 | #r "nuget: Fable.Core" 20 | #r "nuget: Glutinum.Types" 21 | (***) 22 | -------------------------------------------------------------------------------- /tests/specs/references/class/methodWithOptionParametersDescribedWithOptionalType.d.ts: -------------------------------------------------------------------------------- 1 | interface PromiseLike { 2 | a(onfulfilled?: string | undefined | null); 3 | b(onfulfilled?: string | undefined); 4 | c(onfulfilled?: string | null); 5 | } 6 | -------------------------------------------------------------------------------- /tests/specs/references/class/methodWithOptionParametersDescribedWithOptionalType.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type PromiseLike<'T> = 10 | abstract member a: ?onfulfilled: string -> unit 11 | abstract member b: ?onfulfilled: string -> unit 12 | abstract member c: ?onfulfilled: string -> unit 13 | 14 | (***) 15 | #r "nuget: Fable.Core" 16 | #r "nuget: Glutinum.Types" 17 | (***) 18 | -------------------------------------------------------------------------------- /tests/specs/references/class/propertyDeclaration/emitCodeShouldUseOriginalName.d.ts: -------------------------------------------------------------------------------- 1 | export declare class Fuse { 2 | // member is a reserved word in F# and should emit as ``member`` for the F# code 3 | // but as `member` for the emitted JS code 4 | static member: string 5 | } 6 | -------------------------------------------------------------------------------- /tests/specs/references/class/propertyDeclaration/getAccessor.d.ts: -------------------------------------------------------------------------------- 1 | export class Foo { 2 | get id(): string; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/class/propertyDeclaration/getAccessor.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member Foo () : Foo = nativeOnly 12 | 13 | [] 14 | [] 15 | type Foo = 16 | abstract member id: string with get 17 | 18 | (***) 19 | #r "nuget: Fable.Core" 20 | #r "nuget: Glutinum.Types" 21 | (***) 22 | -------------------------------------------------------------------------------- /tests/specs/references/class/propertyDeclaration/getAndSetAccessor.d.ts: -------------------------------------------------------------------------------- 1 | export class Foo { 2 | get id(): string; 3 | set id(value: string); 4 | } 5 | -------------------------------------------------------------------------------- /tests/specs/references/class/propertyDeclaration/getAndSetAccessor.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member Foo () : Foo = nativeOnly 12 | 13 | [] 14 | [] 15 | type Foo = 16 | abstract member id: string with get, set 17 | 18 | (***) 19 | #r "nuget: Fable.Core" 20 | #r "nuget: Glutinum.Types" 21 | (***) 22 | -------------------------------------------------------------------------------- /tests/specs/references/class/propertyDeclaration/instanceProperty.d.ts: -------------------------------------------------------------------------------- 1 | export declare class Fuse { 2 | public version: string 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/class/propertyDeclaration/instanceProperty.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member Fuse () : Fuse = nativeOnly 12 | 13 | [] 14 | [] 15 | type Fuse = 16 | abstract member version: string with get, set 17 | 18 | (***) 19 | #r "nuget: Fable.Core" 20 | #r "nuget: Glutinum.Types" 21 | (***) 22 | -------------------------------------------------------------------------------- /tests/specs/references/class/propertyDeclaration/privateField.d.ts: -------------------------------------------------------------------------------- 1 | export declare class SettingsContainer { 2 | #privateField; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/class/propertyDeclaration/privateField.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member SettingsContainer () : SettingsContainer = nativeOnly 12 | 13 | [] 14 | [] 15 | type SettingsContainer = 16 | interface end 17 | 18 | (***) 19 | #r "nuget: Fable.Core" 20 | #r "nuget: Glutinum.Types" 21 | (***) 22 | -------------------------------------------------------------------------------- /tests/specs/references/class/propertyDeclaration/privateStaticProperty.d.ts: -------------------------------------------------------------------------------- 1 | export declare class SettingsContainer { 2 | static #privateField; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/class/propertyDeclaration/setAccessor.d.ts: -------------------------------------------------------------------------------- 1 | export class Foo { 2 | set id(value: string); 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/class/propertyDeclaration/setAccessor.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member Foo () : Foo = nativeOnly 12 | 13 | [] 14 | [] 15 | type Foo = 16 | abstract member id: string with set 17 | 18 | (***) 19 | #r "nuget: Fable.Core" 20 | #r "nuget: Glutinum.Types" 21 | (***) 22 | -------------------------------------------------------------------------------- /tests/specs/references/class/propertyDeclaration/staticProperty.d.ts: -------------------------------------------------------------------------------- 1 | export declare class Fuse { 2 | static version: string 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/class/propertyDeclaration/staticPropertyReadOnly.d.ts: -------------------------------------------------------------------------------- 1 | declare class Fuse { 2 | public static readonly version: string 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/class/simpleConstructors.d.ts: -------------------------------------------------------------------------------- 1 | export class Logger { 2 | constructor() 3 | 4 | constructor(prefix: string) 5 | } 6 | -------------------------------------------------------------------------------- /tests/specs/references/class/staticMemberWithArguments.d.ts: -------------------------------------------------------------------------------- 1 | export class Hello { 2 | static SayHelloTo (name: string): void; 3 | static SayHelloTo2Persons (name1: string, name2: string): void; 4 | static SayHelloTo3Persons (name1: string, name2: string, name3: string): void; 5 | } 6 | -------------------------------------------------------------------------------- /tests/specs/references/class/staticMemberWithNoArguments.d.ts: -------------------------------------------------------------------------------- 1 | export class Hello { 2 | static SayHello (): void; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/class/staticMemberWithReturnLiteralTypeIntersectionWithTheClass.d.ts: -------------------------------------------------------------------------------- 1 | // Test that we don't end up in an infinite loop when handling `typeof Class` 2 | export class Class { 3 | static extend(props: any): { new (...args: any[]): any } & typeof Class; 4 | } 5 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/constructor.d.ts: -------------------------------------------------------------------------------- 1 | export class Logger { 2 | /** 3 | * Create an instance of Logger. 4 | */ 5 | constructor() 6 | } 7 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/constructor.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | /// 11 | /// Create an instance of Logger. 12 | /// 13 | [] 14 | static member Logger () : Logger = nativeOnly 15 | 16 | [] 17 | [] 18 | type Logger = 19 | interface end 20 | 21 | (***) 22 | #r "nuget: Fable.Core" 23 | #r "nuget: Glutinum.Types" 24 | (***) 25 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/defaultValue/noSummary.d.ts: -------------------------------------------------------------------------------- 1 | interface Logger { 2 | /** 3 | * @defaultValue `[timestamp]` 4 | */ 5 | prefix?: string; 6 | } 7 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/defaultValue/noSummary.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Logger = 10 | /// 11 | /// [timestamp] 12 | /// 13 | abstract member prefix: string option with get, set 14 | 15 | (***) 16 | #r "nuget: Fable.Core" 17 | #r "nuget: Glutinum.Types" 18 | (***) 19 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/defaultValue/withSummary.d.ts: -------------------------------------------------------------------------------- 1 | interface Logger { 2 | /** 3 | * The prefix of the log message. 4 | * 5 | * @defaultValue `[timestamp]` 6 | */ 7 | prefix?: string; 8 | } 9 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/defaultValue/withSummary.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Logger = 10 | /// 11 | /// The prefix of the log message. 12 | /// 13 | /// [timestamp] 14 | /// 15 | abstract member prefix: string option with get, set 16 | 17 | (***) 18 | #r "nuget: Fable.Core" 19 | #r "nuget: Glutinum.Types" 20 | (***) 21 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/deprecated/empty.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @deprecated 3 | */ 4 | declare function isInlineTag(tagName: string): boolean; 5 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/deprecated/empty.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member isInlineTag (tagName: string) : bool = nativeOnly 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/deprecated/singleLine.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @deprecated Use the new base class instead. 3 | */ 4 | declare function isInlineTag(tagName: string): boolean; 5 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/deprecated/singleLine.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member isInlineTag (tagName: string) : bool = nativeOnly 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/example/codeBlockWithLang.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @example 3 | * Here's an example with negative numbers: 4 | * ```js 5 | * // Prints "0": 6 | * console.log(add(1,-1)); 7 | * ``` 8 | */ 9 | declare function isInlineTag(tagName: string): boolean; 10 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/example/multiple.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Adds two numbers together. 3 | * @example 4 | * Here's a simple example: 5 | * ``` 6 | * // Prints "2": 7 | * console.log(add(1,1)); 8 | * ``` 9 | * @example 10 | * Here's an example with negative numbers: 11 | * ``` 12 | * // Prints "0": 13 | * console.log(add(1,-1)); 14 | * ``` 15 | */ 16 | declare function add(a: number, b: number): number; 17 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/example/single.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @example 3 | * Here's an example with negative numbers: 4 | * ``` 5 | * // Prints "0": 6 | * console.log(add(1,-1)); 7 | * ``` 8 | */ 9 | declare function isInlineTag(tagName: string): boolean; 10 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/example/single.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | /// 11 | /// Here's an example with negative numbers: 12 | /// 13 | /// // Prints "0": 14 | /// console.log(add(1,-1)); 15 | /// 16 | /// 17 | [] 18 | static member isInlineTag (tagName: string) : bool = nativeOnly 19 | 20 | (***) 21 | #r "nuget: Fable.Core" 22 | #r "nuget: Glutinum.Types" 23 | (***) 24 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/link/dontCrashNonUrlFormat.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Links can point to a URL: 3 | * 4 | * {@link my-control-library#Button } 5 | * {@link my-control-library#Button | the Button class} 6 | * {@link @microsoft/my-control-library/lib/Button#Button | the Button class} 7 | */ 8 | declare function isInlineTag(tagName: string): boolean; 9 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/link/urlOnly.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Links can point to a URL: 3 | * 4 | * {@link https://github.com/microsoft/tsdoc} 5 | * {@link https://github.com/microsoft/tsdoc } 6 | */ 7 | declare function isInlineTag(tagName: string): boolean; 8 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/link/urlWithLabel.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Links can point to a URL: 3 | * 4 | * {@link https://github.com/microsoft/tsdoc | TSDoc} 5 | * {@link https://github.com/microsoft/tsdoc | TSDoc } 6 | */ 7 | declare function isInlineTag(tagName: string): boolean; 8 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/mdInlineCode.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * foo `{` bar 3 | * and `}` characters. 4 | */ 5 | declare function isInlineTag(tagName: string): boolean; 6 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/mdInlineCode.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | /// 11 | /// foo { bar 12 | /// and } characters. 13 | /// 14 | [] 15 | static member isInlineTag (tagName: string) : bool = nativeOnly 16 | 17 | (***) 18 | #r "nuget: Fable.Core" 19 | #r "nuget: Glutinum.Types" 20 | (***) 21 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/methodSignature.d.ts: -------------------------------------------------------------------------------- 1 | export interface Logger { 2 | /** 3 | * Emits a warning message. 4 | * @param message - The warning message to be logged 5 | */ 6 | warning(message: string): void; 7 | } 8 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/methodSignature.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Logger = 10 | /// 11 | /// Emits a warning message. 12 | /// 13 | /// 14 | /// The warning message to be logged 15 | /// 16 | abstract member warning: message: string -> unit 17 | 18 | (***) 19 | #r "nuget: Fable.Core" 20 | #r "nuget: Glutinum.Types" 21 | (***) 22 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/param/multiLine.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @param tagName - The name of the tag. 3 | * Second line of the description. 4 | */ 5 | declare function isInlineTag(tagName: string): boolean; 6 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/param/multiLine.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | /// 11 | /// The name of the tag. 12 | /// Second line of the description. 13 | /// 14 | [] 15 | static member isInlineTag (tagName: string) : bool = nativeOnly 16 | 17 | (***) 18 | #r "nuget: Fable.Core" 19 | #r "nuget: Glutinum.Types" 20 | (***) 21 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/param/multipleParam.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @param arg1 - The name of the tag. 3 | * @param arg2 - The number of the tag. 4 | */ 5 | declare function isInlineTag(arg1 : string, arg2 : number): boolean; 6 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/param/multipleParam.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | /// 11 | /// The name of the tag. 12 | /// 13 | /// 14 | /// The number of the tag. 15 | /// 16 | [] 17 | static member isInlineTag (arg1: string, arg2: float) : bool = nativeOnly 18 | 19 | (***) 20 | #r "nuget: Fable.Core" 21 | #r "nuget: Glutinum.Types" 22 | (***) 23 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/param/singleLine.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @param tagName - The name of the tag. 3 | */ 4 | declare function isInlineTag(tagName: string): boolean; 5 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/param/singleLine.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | /// 11 | /// The name of the tag. 12 | /// 13 | [] 14 | static member isInlineTag (tagName: string) : bool = nativeOnly 15 | 16 | (***) 17 | #r "nuget: Fable.Core" 18 | #r "nuget: Glutinum.Types" 19 | (***) 20 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/remarks/multiLine.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @remarks 3 | * This line is part of the remarks. 4 | * This line is also part of the remarks. 5 | */ 6 | declare function isInlineTag(tagName: string): boolean; 7 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/remarks/multiLine.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | /// 11 | /// This line is part of the remarks. 12 | /// This line is also part of the remarks. 13 | /// 14 | [] 15 | static member isInlineTag (tagName: string) : bool = nativeOnly 16 | 17 | (***) 18 | #r "nuget: Fable.Core" 19 | #r "nuget: Glutinum.Types" 20 | (***) 21 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/remarks/singleLine.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @remarks 3 | * This line is part of the remarks. 4 | */ 5 | declare function isInlineTag(tagName: string): boolean; 6 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/remarks/singleLine.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | /// 11 | /// This line is part of the remarks. 12 | /// 13 | [] 14 | static member isInlineTag (tagName: string) : bool = nativeOnly 15 | 16 | (***) 17 | #r "nuget: Fable.Core" 18 | #r "nuget: Glutinum.Types" 19 | (***) 20 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/returns/multiLine.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @returns Returns true if the specified 3 | * else false. 4 | * 5 | * This is the return value of the documentation. 6 | */ 7 | declare function isInlineTag(tagName: string): boolean; 8 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/returns/multiLine.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | /// 11 | /// Returns true if the specified 12 | /// else false. 13 | /// 14 | /// This is the return value of the documentation. 15 | /// 16 | [] 17 | static member isInlineTag (tagName: string) : bool = nativeOnly 18 | 19 | (***) 20 | #r "nuget: Fable.Core" 21 | #r "nuget: Glutinum.Types" 22 | (***) 23 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/returns/singleLine.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @returns This is the return value of the documentation. 3 | */ 4 | declare function isInlineTag(tagName: string): boolean; 5 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/returns/singleLine.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | /// 11 | /// This is the return value of the documentation. 12 | /// 13 | [] 14 | static member isInlineTag (tagName: string) : bool = nativeOnly 15 | 16 | (***) 17 | #r "nuget: Fable.Core" 18 | #r "nuget: Glutinum.Types" 19 | (***) 20 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/simple.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This is the summary of the documentation. 3 | * 4 | * @returns true if the specified tag is surrounded with `{` 5 | * and `}` characters. 6 | */ 7 | declare function isInlineTag(tagName: string): boolean; 8 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/summary/multiLine.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * First line of the summary. 3 | * Second line of the summary. 4 | * 5 | * Another paragraph in the summary. 6 | * 7 | * And a third paragraph, 8 | * with a line break. 9 | */ 10 | declare function isInlineTag(tagName: string): boolean; 11 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/summary/singleLine.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This is the summary of the documentation. 3 | */ 4 | declare function isInlineTag(tagName: string): boolean; 5 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/summary/singleLine.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | /// 11 | /// This is the summary of the documentation. 12 | /// 13 | [] 14 | static member isInlineTag (tagName: string) : bool = nativeOnly 15 | 16 | (***) 17 | #r "nuget: Fable.Core" 18 | #r "nuget: Glutinum.Types" 19 | (***) 20 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/throws/multiLineWithRemarks.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @remarks 3 | * 4 | * This is a remarks section. 5 | * 6 | * @throws This is line 1 7 | * Thrown if the ISBN number is valid, but no such book exists in the catalog. 8 | */ 9 | declare function fetchBookByIsbn(); 10 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/throws/multiLineWithoutRemarks.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @throws This is line 1 3 | * Thrown if the ISBN number is valid, but no such book exists in the catalog. 4 | */ 5 | declare function fetchBookByIsbn(); 6 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/throws/multiplesWithRemarks.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @remarks 3 | * 4 | * This is a remarks section. 5 | * 6 | * @throws 7 | * Thrown if the ISBN number is valid, but no such book exists in the catalog. 8 | * 9 | * @throws 10 | * Thrown if the network is down. 11 | */ 12 | declare function fetchBookByIsbn(); 13 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/throws/multiplesWithoutRemarks.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @throws 3 | * Thrown if the ISBN number is valid, but no such book exists in the catalog. 4 | * 5 | * @throws 6 | * Thrown if the network is down. 7 | */ 8 | declare function fetchBookByIsbn(); 9 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/throws/singleLineWithRemarks.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @remarks 3 | * 4 | * This is a remarks section. 5 | * 6 | * @throws Thrown if the ISBN number is valid, but no such book exists in the catalog. 7 | */ 8 | declare function fetchBookByIsbn(); 9 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/throws/singleLineWithoutRemarks.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @throws Thrown if the ISBN number is valid, but no such book exists in the catalog. 3 | */ 4 | declare function fetchBookByIsbn(); 5 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/throws/singleLineWithoutRemarks.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | /// 11 | /// Throws: 12 | /// ------- 13 | /// 14 | /// Thrown if the ISBN number is valid, but no such book exists in the catalog. 15 | /// 16 | [] 17 | static member fetchBookByIsbn () : unit = nativeOnly 18 | 19 | (***) 20 | #r "nuget: Fable.Core" 21 | #r "nuget: Glutinum.Types" 22 | (***) 23 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/typeAlias.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Defines a type for plugin functions. 3 | * 4 | * @typeParam T - The type of the `option` parameter 5 | */ 6 | export type PluginFunc = T; 7 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/typeAlias.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | /// 8 | /// Defines a type for plugin functions. 9 | /// 10 | /// 11 | /// The type of the option parameter 12 | /// 13 | type PluginFunc<'T> = 14 | 'T 15 | 16 | (***) 17 | #r "nuget: Fable.Core" 18 | #r "nuget: Glutinum.Types" 19 | (***) 20 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/typeParam/multiLine.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @typeParam T - Type T 3 | * Second line of the description of T 4 | */ 5 | declare function isInlineTag(): boolean; 6 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/typeParam/multiLine.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | /// 11 | /// Type T 12 | /// Second line of the description of T 13 | /// 14 | [] 15 | static member isInlineTag<'T> () : bool = nativeOnly 16 | 17 | (***) 18 | #r "nuget: Fable.Core" 19 | #r "nuget: Glutinum.Types" 20 | (***) 21 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/typeParam/multiplesTypeParams.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @typeParam A - Type A 3 | * @typeParam B - Type B 4 | * @typeParam C - Type C 5 | */ 6 | declare function isInlineTag(): boolean; 7 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/typeParam/singleLine.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @typeParam Value - Return value type 3 | */ 4 | declare function isInlineTag(): boolean; 5 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/typeParam/singleLine.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | /// 11 | /// Return value type 12 | /// 13 | [] 14 | static member isInlineTag<'Value> () : bool = nativeOnly 15 | 16 | (***) 17 | #r "nuget: Fable.Core" 18 | #r "nuget: Glutinum.Types" 19 | (***) 20 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/variable.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * The version of the library. 3 | */ 4 | export const version : string 5 | -------------------------------------------------------------------------------- /tests/specs/references/documentation/variable.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | /// 11 | /// The version of the library. 12 | /// 13 | [] 14 | static member inline version: string = nativeOnly 15 | 16 | (***) 17 | #r "nuget: Fable.Core" 18 | #r "nuget: Glutinum.Types" 19 | (***) 20 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalNumericEnum.d.ts: -------------------------------------------------------------------------------- 1 | export type PossibleValues = 2 | | 1 3 | | 2 4 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalNumericEnum.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | type PossibleValues = 9 | | ``1`` = 1 10 | | ``2`` = 2 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalNumericEnumWithInheritance.d.ts: -------------------------------------------------------------------------------- 1 | export type NumberA = 2 | | 1 3 | 4 | export type NumberB = 5 | | 2 6 | 7 | export type NumberC = NumberA | NumberB; 8 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalNumericEnumWithInheritance.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | type NumberA = 9 | | ``1`` = 1 10 | 11 | [] 12 | type NumberB = 13 | | ``2`` = 2 14 | 15 | [] 16 | type NumberC = 17 | | ``1`` = 1 18 | | ``2`` = 2 19 | 20 | (***) 21 | #r "nuget: Fable.Core" 22 | #r "nuget: Glutinum.Types" 23 | (***) 24 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalNumericEnumWithInheritanceAndParenthesized.d.ts: -------------------------------------------------------------------------------- 1 | export type NumberA = 2 | | 1 3 | 4 | export type NumberB = 5 | | 2 6 | 7 | export type NumberC = 8 | | 3 9 | 10 | export type NumberD = NumberA | (NumberB | NumberC); 11 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalNumericEnumWithInheritanceAndParenthesized.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | type NumberA = 9 | | ``1`` = 1 10 | 11 | [] 12 | type NumberB = 13 | | ``2`` = 2 14 | 15 | [] 16 | type NumberC = 17 | | ``3`` = 3 18 | 19 | [] 20 | type NumberD = 21 | | ``1`` = 1 22 | | ``2`` = 2 23 | | ``3`` = 3 24 | 25 | (***) 26 | #r "nuget: Fable.Core" 27 | #r "nuget: Glutinum.Types" 28 | (***) 29 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalNumericEnumWithInheritanceWorksWithDuplicates.d.ts: -------------------------------------------------------------------------------- 1 | export type NumberA = 2 | | 1 3 | | 2 4 | 5 | export type NumberB = 6 | | 2 7 | | 3 8 | 9 | export type NumberC = NumberA | NumberB; 10 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalNumericEnumWithInheritanceWorksWithDuplicates.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | type NumberA = 9 | | ``1`` = 1 10 | | ``2`` = 2 11 | 12 | [] 13 | type NumberB = 14 | | ``2`` = 2 15 | | ``3`` = 3 16 | 17 | [] 18 | type NumberC = 19 | | ``1`` = 1 20 | | ``2`` = 2 21 | | ``3`` = 3 22 | 23 | (***) 24 | #r "nuget: Fable.Core" 25 | #r "nuget: Glutinum.Types" 26 | (***) 27 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalNumericEnumWithNestedEnums.d.ts: -------------------------------------------------------------------------------- 1 | export type NumberA = 2 | | 1 3 | 4 | export type NumberB = 5 | | 2 6 | 7 | export type NumberC = NumberA | NumberB; 8 | 9 | export type NumberD = 10 | | 3 11 | 12 | export type NumberE = NumberC | NumberD; 13 | 14 | export type NumberF = 15 | | 4 16 | 17 | export type NumberG = NumberE | NumberF; 18 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalStringEnum.d.ts: -------------------------------------------------------------------------------- 1 | export type ForegroundColor = 2 | | 'black' 3 | | 'red' 4 | | 'Red' 5 | | 'm' 6 | | 'M' 7 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalStringEnum.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type ForegroundColor = 10 | | black 11 | | red 12 | | Red 13 | | m 14 | | M 15 | 16 | (***) 17 | #r "nuget: Fable.Core" 18 | #r "nuget: Glutinum.Types" 19 | (***) 20 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalStringEnumStartingWithDigit.d.ts: -------------------------------------------------------------------------------- 1 | export type GPUTextureViewDimension = 2 | | "1d" 3 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalStringEnumStartingWithDigit.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type GPUTextureViewDimension = 10 | | ``1d`` 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalStringEnumWithAtSymbol.d.ts: -------------------------------------------------------------------------------- 1 | export type Name = 2 | | 'an@nymous>'; 3 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalStringEnumWithAtSymbol.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Name = 10 | | [")>] ``an_AT_nymous>`` 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalStringEnumWithDash.d.ts: -------------------------------------------------------------------------------- 1 | export type GPUTextureViewDimension = 2 | | "cube-array" 3 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalStringEnumWithDash.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type GPUTextureViewDimension = 10 | | ``cube-array`` 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalStringEnumWithDot.d.ts: -------------------------------------------------------------------------------- 1 | export type FirebaseSignInProvider = 2 | | 'apple.com'; 3 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalStringEnumWithDot.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type FirebaseSignInProvider = 10 | | [] apple_com 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalStringEnumWithInheritance.d.ts: -------------------------------------------------------------------------------- 1 | export type ColorA = 2 | | 'black' 3 | 4 | export type ColorB = 5 | | 'bgBlack' 6 | 7 | export type Color = ColorA | ColorB; 8 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalStringEnumWithInheritance.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type ColorA = 10 | | black 11 | 12 | [] 13 | [] 14 | type ColorB = 15 | | bgBlack 16 | 17 | [] 18 | [] 19 | type Color = 20 | | black 21 | | bgBlack 22 | 23 | (***) 24 | #r "nuget: Fable.Core" 25 | #r "nuget: Glutinum.Types" 26 | (***) 27 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalStringEnumWithInheritanceAndParenthesized.d.ts: -------------------------------------------------------------------------------- 1 | export type ColorA = 2 | | 'black' 3 | 4 | export type ColorB = 5 | | 'bgBlack' 6 | 7 | export type ColorC = 8 | | 'red' 9 | 10 | export type Color = ColorA | (ColorB | ColorC); 11 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalStringEnumWithInheritanceWorksWithDupicates.d.ts: -------------------------------------------------------------------------------- 1 | export type ColorA = 2 | | 'black' 3 | | 'bgRed' 4 | 5 | export type ColorB = 6 | | 'bgBlack' 7 | | 'black' 8 | 9 | export type Color = ColorA | ColorB; 10 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalStringEnumWithLeftAngleBracket.d.ts: -------------------------------------------------------------------------------- 1 | export type Name = 2 | | '] 8 | [] 9 | type Name = 10 | | ``'; 3 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalStringEnumWithRightAngleBracket.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Name = 10 | | ``anonymous>`` 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalStringEnumWithSpace.d.ts: -------------------------------------------------------------------------------- 1 | export type Name = 2 | | 'anony mous'; 3 | -------------------------------------------------------------------------------- /tests/specs/references/enums/literalStringEnumWithSpace.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Name = 10 | | ``anony mous`` 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/enums/namedIntEnum.d.ts: -------------------------------------------------------------------------------- 1 | export enum Direction { 2 | Up, 3 | Down, 4 | Left, 5 | Right, 6 | } 7 | -------------------------------------------------------------------------------- /tests/specs/references/enums/namedIntEnum.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | type Direction = 9 | | Up = 0 10 | | Down = 1 11 | | Left = 2 12 | | Right = 3 13 | 14 | (***) 15 | #r "nuget: Fable.Core" 16 | #r "nuget: Glutinum.Types" 17 | (***) 18 | -------------------------------------------------------------------------------- /tests/specs/references/enums/namedIntEnumWithInitialRank.d.ts: -------------------------------------------------------------------------------- 1 | export enum Direction { 2 | Up = 2, 3 | Down, 4 | Left, 5 | Right, 6 | } 7 | -------------------------------------------------------------------------------- /tests/specs/references/enums/namedIntEnumWithInitialRank.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | type Direction = 9 | | Up = 2 10 | | Down = 3 11 | | Left = 4 12 | | Right = 5 13 | 14 | (***) 15 | #r "nuget: Fable.Core" 16 | #r "nuget: Glutinum.Types" 17 | (***) 18 | -------------------------------------------------------------------------------- /tests/specs/references/enums/namedStringEnum.d.ts: -------------------------------------------------------------------------------- 1 | export enum Direction { 2 | Up = "UP", 3 | Down = "DOWN", 4 | Left = "LEFT", 5 | Right = "RIGHT", 6 | } 7 | -------------------------------------------------------------------------------- /tests/specs/references/enums/namedStringEnum.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Direction = 10 | | [] Up 11 | | [] Down 12 | | [] Left 13 | | [] Right 14 | 15 | (***) 16 | #r "nuget: Fable.Core" 17 | #r "nuget: Glutinum.Types" 18 | (***) 19 | -------------------------------------------------------------------------------- /tests/specs/references/enums/unionOptimisationHappensOnReturnsTypeToo.d.ts: -------------------------------------------------------------------------------- 1 | interface UnsetInline { 2 | unset?: "destroy" | "keep" | undefined; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/enums/unionOptimisationHappensOnReturnsTypeToo.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type UnsetInline = 10 | abstract member unset: UnsetInline.unset option with get, set 11 | 12 | module UnsetInline = 13 | 14 | [] 15 | [] 16 | type unset = 17 | | destroy 18 | | keep 19 | 20 | (***) 21 | #r "nuget: Fable.Core" 22 | #r "nuget: Glutinum.Types" 23 | (***) 24 | -------------------------------------------------------------------------------- /tests/specs/references/exclude/literalIntEnum.d.ts: -------------------------------------------------------------------------------- 1 | export type NumberA = 2 | | 1 3 | | 2 4 | | 3 5 | 6 | export type NumberB = Exclude; 7 | -------------------------------------------------------------------------------- /tests/specs/references/exclude/literalIntEnum.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | type NumberA = 9 | | ``1`` = 1 10 | | ``2`` = 2 11 | | ``3`` = 3 12 | 13 | [] 14 | type NumberB = 15 | | ``1`` = 1 16 | | ``2`` = 2 17 | 18 | (***) 19 | #r "nuget: Fable.Core" 20 | #r "nuget: Glutinum.Types" 21 | (***) 22 | -------------------------------------------------------------------------------- /tests/specs/references/exclude/literalIntEnumSingleCaseResult.d.ts: -------------------------------------------------------------------------------- 1 | export type NumberA = 2 | | 1 3 | | 2 4 | 5 | export type NumberB = Exclude; 6 | -------------------------------------------------------------------------------- /tests/specs/references/exclude/literalIntEnumSingleCaseResult.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | type NumberA = 9 | | ``1`` = 1 10 | | ``2`` = 2 11 | 12 | [] 13 | type NumberB = 14 | | ``1`` = 1 15 | 16 | (***) 17 | #r "nuget: Fable.Core" 18 | #r "nuget: Glutinum.Types" 19 | (***) 20 | -------------------------------------------------------------------------------- /tests/specs/references/exclude/literalStringEnum.d.ts: -------------------------------------------------------------------------------- 1 | export type ForegroundColor = 2 | | 'black' 3 | | 'red' 4 | | 'green' 5 | 6 | export type NoBlack = Exclude 7 | -------------------------------------------------------------------------------- /tests/specs/references/exclude/literalStringEnum.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type ForegroundColor = 10 | | black 11 | | red 12 | | green 13 | 14 | [] 15 | [] 16 | type NoBlack = 17 | | red 18 | | green 19 | 20 | (***) 21 | #r "nuget: Fable.Core" 22 | #r "nuget: Glutinum.Types" 23 | (***) 24 | -------------------------------------------------------------------------------- /tests/specs/references/exclude/literalStringEnumSingleCaseResult.d.ts: -------------------------------------------------------------------------------- 1 | type PrimitiveResult = Exclude<"a" | "b", "a">; 2 | -------------------------------------------------------------------------------- /tests/specs/references/exclude/literalStringEnumSingleCaseResult.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type PrimitiveResult = 10 | | b 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/exportAssignment/default/direct/class.d.ts: -------------------------------------------------------------------------------- 1 | export default class ChalkInstance {} 2 | -------------------------------------------------------------------------------- /tests/specs/references/exportAssignment/default/direct/class.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member ChalkInstance () : ChalkInstance = nativeOnly 12 | 13 | [] 14 | [] 15 | type ChalkInstance = 16 | interface end 17 | 18 | (***) 19 | #r "nuget: Fable.Core" 20 | #r "nuget: Glutinum.Types" 21 | (***) 22 | -------------------------------------------------------------------------------- /tests/specs/references/exportAssignment/default/intermediateVariable/class.d.ts: -------------------------------------------------------------------------------- 1 | declare const chalk: ChalkInstance; 2 | 3 | export declare class ChalkInstance {} 4 | 5 | export default chalk; 6 | -------------------------------------------------------------------------------- /tests/specs/references/exportAssignment/default/intermediateVariable/primitive.d.ts: -------------------------------------------------------------------------------- 1 | declare const version : string 2 | export default version; 3 | -------------------------------------------------------------------------------- /tests/specs/references/exportAssignment/default/intermediateVariable/primitive.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member inline version: string = nativeOnly 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/exportAssignment/functionReference.d.ts: -------------------------------------------------------------------------------- 1 | export = hello; 2 | 3 | declare function hello(): string; 4 | -------------------------------------------------------------------------------- /tests/specs/references/exportAssignment/functionReference.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member hello () : string = nativeOnly 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/exports/class.d.ts: -------------------------------------------------------------------------------- 1 | export class Logger { 2 | constructor() 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/exports/class.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member Logger () : Logger = nativeOnly 12 | 13 | [] 14 | [] 15 | type Logger = 16 | interface end 17 | 18 | (***) 19 | #r "nuget: Fable.Core" 20 | #r "nuget: Glutinum.Types" 21 | (***) 22 | -------------------------------------------------------------------------------- /tests/specs/references/exports/classInModule.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'vscode' { 2 | export class LanguageModelError { 3 | } 4 | } 5 | -------------------------------------------------------------------------------- /tests/specs/references/exports/classInNamespace.d.ts: -------------------------------------------------------------------------------- 1 | export = lib; 2 | 3 | namespace lib { 4 | class Logger { 5 | constructor(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/specs/references/exports/classWithNoConstructorExplicitlyDefined.d.ts: -------------------------------------------------------------------------------- 1 | export class Logger { 2 | } 3 | -------------------------------------------------------------------------------- /tests/specs/references/exports/classWithNoConstructorExplicitlyDefined.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member Logger () : Logger = nativeOnly 12 | 13 | [] 14 | [] 15 | type Logger = 16 | interface end 17 | 18 | (***) 19 | #r "nuget: Fable.Core" 20 | #r "nuget: Glutinum.Types" 21 | (***) 22 | -------------------------------------------------------------------------------- /tests/specs/references/exports/defaultClass.d.ts: -------------------------------------------------------------------------------- 1 | export default class SignaturePad { 2 | constructor(canvas: string) {} 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/exports/defaultClass.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member SignaturePad (canvas: string) : SignaturePad = nativeOnly 12 | 13 | [] 14 | [] 15 | type SignaturePad = 16 | interface end 17 | 18 | (***) 19 | #r "nuget: Fable.Core" 20 | #r "nuget: Glutinum.Types" 21 | (***) 22 | -------------------------------------------------------------------------------- /tests/specs/references/exports/duplicatedModuleDeclaration.d.ts: -------------------------------------------------------------------------------- 1 | export module Log { 2 | 3 | export interface Options { 4 | prefix: string 5 | } 6 | 7 | export interface Options { 8 | suffix: string 9 | } 10 | } 11 | 12 | export module Log { 13 | 14 | export function log() : void; 15 | 16 | export interface Options { 17 | level: number 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/specs/references/exports/exportDeclaration.d.ts: -------------------------------------------------------------------------------- 1 | export { 2 | colorNames 3 | } from './vendor/ansi-styles/index.js'; 4 | -------------------------------------------------------------------------------- /tests/specs/references/exports/exportDeclaration.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | (***) 8 | #r "nuget: Fable.Core" 9 | #r "nuget: Glutinum.Types" 10 | (***) 11 | -------------------------------------------------------------------------------- /tests/specs/references/exports/functionWithArgument.d.ts: -------------------------------------------------------------------------------- 1 | declare function hello (name : string): void 2 | -------------------------------------------------------------------------------- /tests/specs/references/exports/functionWithArgument.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member hello (name: string) : unit = nativeOnly 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/exports/functionWithNoArgument.d.ts: -------------------------------------------------------------------------------- 1 | declare function hello (): void 2 | -------------------------------------------------------------------------------- /tests/specs/references/exports/functionWithNoArgument.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member hello () : unit = nativeOnly 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/exports/functionWithOptionalArgument.d.ts: -------------------------------------------------------------------------------- 1 | declare function hello (name? : string): void 2 | -------------------------------------------------------------------------------- /tests/specs/references/exports/functionWithOptionalArgument.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member hello (?name: string) : unit = nativeOnly 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/exports/functionWithSeveralArguments.d.ts: -------------------------------------------------------------------------------- 1 | declare function hello( 2 | name: string, 3 | count: number, 4 | punctuation?: boolean 5 | ): void; 6 | -------------------------------------------------------------------------------- /tests/specs/references/exports/functionWithSeveralArguments.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member hello (name: string, count: float, ?punctuation: bool) : unit = nativeOnly 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/exports/functionWithTypeReferenceInNamespace.d.ts: -------------------------------------------------------------------------------- 1 | declare function dayjs (): dayjs.Dayjs 2 | 3 | declare namespace dayjs { 4 | class Dayjs { 5 | constructor () 6 | } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /tests/specs/references/exports/severalClassesInModule.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'vscode' { 2 | export class LanguageModelError {} 3 | export class Logger {} 4 | } 5 | -------------------------------------------------------------------------------- /tests/specs/references/exports/severalFunctions.d.ts: -------------------------------------------------------------------------------- 1 | declare function hello (name : string): void 2 | 3 | declare function add (a : number, b : number): number 4 | -------------------------------------------------------------------------------- /tests/specs/references/exports/severalFunctions.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member hello (name: string) : unit = nativeOnly 12 | [] 13 | static member add (a: float, b: float) : float = nativeOnly 14 | 15 | (***) 16 | #r "nuget: Fable.Core" 17 | #r "nuget: Glutinum.Types" 18 | (***) 19 | -------------------------------------------------------------------------------- /tests/specs/references/exports/severalFunctionsInModule.d.ts: -------------------------------------------------------------------------------- 1 | module Lib { 2 | declare function hello (name : string): void 3 | 4 | declare function add (a : number, b : number): number 5 | } 6 | -------------------------------------------------------------------------------- /tests/specs/references/exports/variable.d.ts: -------------------------------------------------------------------------------- 1 | export const version : string 2 | -------------------------------------------------------------------------------- /tests/specs/references/exports/variable.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member inline version: string = nativeOnly 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/functionDeclaration/argumentWithGenerics.d.ts: -------------------------------------------------------------------------------- 1 | export function extend(options : T): void 2 | -------------------------------------------------------------------------------- /tests/specs/references/functionDeclaration/argumentWithGenerics.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member extend<'T> (options: 'T) : unit = nativeOnly 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/functionDeclaration/argumentWithObjectBinding.d.ts: -------------------------------------------------------------------------------- 1 | export interface LogOptions { 2 | prefix: string; 3 | } 4 | 5 | export interface Context { 6 | indentationLevel: number; 7 | } 8 | 9 | declare function toText({ indentationLevel }: Context, data : string, {prefix }?: LogOptions): string; 10 | -------------------------------------------------------------------------------- /tests/specs/references/functionDeclaration/optionalArgumentWithOptionalType.d.ts: -------------------------------------------------------------------------------- 1 | declare function a(onfulfilled?: string | undefined | null); 2 | declare function b(onfulfilled?: string | undefined); 3 | declare function c(onfulfilled?: string | null); 4 | -------------------------------------------------------------------------------- /tests/specs/references/functionDeclaration/simple.d.ts: -------------------------------------------------------------------------------- 1 | export function hello(name: string): void 2 | -------------------------------------------------------------------------------- /tests/specs/references/functionDeclaration/simple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member hello (name: string) : unit = nativeOnly 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/functionDeclaration/typeReferenceWithGenerics.d.ts: -------------------------------------------------------------------------------- 1 | export type PluginFunc = () => void 2 | 3 | export function extend(plugin: PluginFunc): void 4 | -------------------------------------------------------------------------------- /tests/specs/references/functionDeclaration/typeReferenceWithGenerics.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member extend<'T> (plugin: PluginFunc<'T>) : unit = nativeOnly 12 | 13 | [] 14 | [] 15 | type PluginFunc<'T> = 16 | [] 17 | abstract member Invoke: unit -> unit 18 | 19 | (***) 20 | #r "nuget: Fable.Core" 21 | #r "nuget: Glutinum.Types" 22 | (***) 23 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/interface/generics/moreGenericsOnParentThanNeeded.d.ts: -------------------------------------------------------------------------------- 1 | export interface MyObject { 2 | foo: (min: A, max: B) => B; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/interface/generics/moreGenericsOnParentThanNeeded.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type MyObject<'A, 'B, 'NotNeeded> = 10 | abstract member foo: MyObject.foo<'A, 'B> with get, set 11 | 12 | module MyObject = 13 | 14 | type foo<'A, 'B> = 15 | delegate of min: 'A * max: 'B -> 'B 16 | 17 | (***) 18 | #r "nuget: Fable.Core" 19 | #r "nuget: Glutinum.Types" 20 | (***) 21 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/interface/generics/one.d.ts: -------------------------------------------------------------------------------- 1 | export interface MyObject { 2 | upper: (s: string | undefined) => T; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/interface/generics/one.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type MyObject<'T> = 10 | abstract member upper: (string option -> 'T) with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/interface/generics/several.d.ts: -------------------------------------------------------------------------------- 1 | export interface MyObject2 { 2 | foo: (min: A, max: B) => B; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/interface/generics/several.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type MyObject2<'A, 'B> = 10 | abstract member foo: MyObject2.foo<'A, 'B> with get, set 11 | 12 | module MyObject2 = 13 | 14 | type foo<'A, 'B> = 15 | delegate of min: 'A * max: 'B -> 'B 16 | 17 | (***) 18 | #r "nuget: Fable.Core" 19 | #r "nuget: Glutinum.Types" 20 | (***) 21 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/interface/multipleArguments.d.ts: -------------------------------------------------------------------------------- 1 | export interface MyObject { 2 | random: (min: number, max: number) => number; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/interface/multipleArguments.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type MyObject = 10 | abstract member random: MyObject.random with get, set 11 | 12 | module MyObject = 13 | 14 | type random = 15 | delegate of min: float * max: float -> float 16 | 17 | (***) 18 | #r "nuget: Fable.Core" 19 | #r "nuget: Glutinum.Types" 20 | (***) 21 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/interface/noArgument.d.ts: -------------------------------------------------------------------------------- 1 | export interface MyObject { 2 | random: () => number; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/interface/noArgument.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type MyObject = 10 | abstract member random: (unit -> float) with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/interface/oneArgument.d.ts: -------------------------------------------------------------------------------- 1 | export interface MyObject { 2 | upper: (s: string) => string; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/interface/oneArgument.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type MyObject = 10 | abstract member upper: (string -> string) with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/interface/oneOptionalArgument.d.ts: -------------------------------------------------------------------------------- 1 | export interface MyObject { 2 | upper: (s: string | undefined) => string; 3 | lower: (s?: string) => string; 4 | } 5 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/interface/oneOptionalArgument.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type MyObject = 10 | abstract member upper: (string option -> string) with get, set 11 | abstract member lower: (string option -> string) with get, set 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/interface/withOptionalArguments.d.ts: -------------------------------------------------------------------------------- 1 | export interface MyObject { 2 | random: (min: number, max?: number) => number; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/interface/withOptionalArguments.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type MyObject = 10 | abstract member random: MyObject.random with get, set 11 | 12 | module MyObject = 13 | 14 | type random = 15 | delegate of min: float * ?max: float -> float 16 | 17 | (***) 18 | #r "nuget: Fable.Core" 19 | #r "nuget: Glutinum.Types" 20 | (***) 21 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/oneGeneric.d.ts: -------------------------------------------------------------------------------- 1 | export type PluginFunc = (option: T, c: string) => void 2 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/oneGeneric.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type PluginFunc<'T> = 10 | [] 11 | abstract member Invoke: option: 'T * c: string -> unit 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/simple.d.ts: -------------------------------------------------------------------------------- 1 | type GreetFunction = (a: string) => void; 2 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/simple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type GreetFunction = 10 | [] 11 | abstract member Invoke: a: string -> unit 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/spreadArgument.d.ts: -------------------------------------------------------------------------------- 1 | type Log = (prefix : string, ...args: any[]) => any 2 | -------------------------------------------------------------------------------- /tests/specs/references/functionType/spreadArgument.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Log = 10 | [] 11 | abstract member Invoke: prefix: string * [] args: obj [] -> obj 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/indexedAccessType/interfaceWithSeveralMethods.d.ts: -------------------------------------------------------------------------------- 1 | interface ConfigTypeMap { 2 | methodA: string | number; 3 | methodB: boolean; 4 | methodC: boolean; 5 | } 6 | 7 | export type ConfigType = ConfigTypeMap[keyof ConfigTypeMap]; 8 | -------------------------------------------------------------------------------- /tests/specs/references/indexedAccessType/interfaceWithSeveralMethods.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type ConfigTypeMap = 10 | abstract member methodA: U2 with get, set 11 | abstract member methodB: bool with get, set 12 | abstract member methodC: bool with get, set 13 | 14 | type ConfigType = 15 | U3 16 | 17 | (***) 18 | #r "nuget: Fable.Core" 19 | #r "nuget: Glutinum.Types" 20 | (***) 21 | -------------------------------------------------------------------------------- /tests/specs/references/indexedAccessType/interfaceWithSingleMethod.d.ts: -------------------------------------------------------------------------------- 1 | interface ConfigTypeMap { 2 | default: string | number; 3 | } 4 | 5 | export type ConfigType = ConfigTypeMap[keyof ConfigTypeMap]; 6 | -------------------------------------------------------------------------------- /tests/specs/references/indexedAccessType/interfaceWithSingleMethod.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type ConfigTypeMap = 10 | abstract member ``default``: U2 with get, set 11 | 12 | type ConfigType = 13 | U2 14 | 15 | (***) 16 | #r "nuget: Fable.Core" 17 | #r "nuget: Glutinum.Types" 18 | (***) 19 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/callSignature.d.ts: -------------------------------------------------------------------------------- 1 | export interface MyObject { 2 | (name: string) : void; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/callSignature.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type MyObject = 10 | [] 11 | abstract member Invoke: name: string -> unit 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/functionType/simple.d.ts: -------------------------------------------------------------------------------- 1 | interface AlertStatic { 2 | alert: ( 3 | title: string, 4 | message?: string 5 | ) => void; 6 | } 7 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/functionType/simple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type AlertStatic = 10 | abstract member alert: AlertStatic.alert with get, set 11 | 12 | module AlertStatic = 13 | 14 | type alert = 15 | delegate of title: string * ?message: string -> unit 16 | 17 | (***) 18 | #r "nuget: Fable.Core" 19 | #r "nuget: Glutinum.Types" 20 | (***) 21 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/generics/multiple.d.ts: -------------------------------------------------------------------------------- 1 | interface IUser {} 2 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/generics/multiple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type IUser<'A, 'B> = 10 | interface end 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/generics/one.d.ts: -------------------------------------------------------------------------------- 1 | interface IUser {} 2 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/generics/one.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type IUser<'Bag> = 10 | interface end 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/heritage/genericResolvedWithConcreteType.d.ts: -------------------------------------------------------------------------------- 1 | declare class User { 2 | a: A; 3 | b: B; 4 | } 5 | 6 | interface IUser extends User {} 7 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/heritage/multiple.d.ts: -------------------------------------------------------------------------------- 1 | interface Shape { 2 | color: string; 3 | } 4 | 5 | interface PenStroke { 6 | penWidth: number; 7 | } 8 | 9 | interface Square extends Shape, PenStroke { 10 | sideLength: number; 11 | } 12 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/heritage/multipleGeneric.d.ts: -------------------------------------------------------------------------------- 1 | declare class User { 2 | a: A; 3 | b: B; 4 | } 5 | 6 | interface IUser extends User {} 7 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/heritage/nestedType.d.ts: -------------------------------------------------------------------------------- 1 | interface IAge { 2 | years: A; 3 | } 4 | 5 | declare class User { 6 | bag: Bag; 7 | age: IAge; 8 | } 9 | 10 | interface IUser extends User {} 11 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/heritage/oneGeneric.d.ts: -------------------------------------------------------------------------------- 1 | declare class User { 2 | bag: Bag; 3 | } 4 | 5 | interface IUser extends User {} 6 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/heritage/simple.d.ts: -------------------------------------------------------------------------------- 1 | export interface CoreTableState {} 2 | 3 | export interface TableState extends CoreTableState { 4 | } 5 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/heritage/simple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type CoreTableState = 10 | interface end 11 | 12 | [] 13 | [] 14 | type TableState = 15 | inherit CoreTableState 16 | 17 | (***) 18 | #r "nuget: Fable.Core" 19 | #r "nuget: Glutinum.Types" 20 | (***) 21 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/indexSignature/numberParameter.d.ts: -------------------------------------------------------------------------------- 1 | export interface StringArray { 2 | [index: number]: string; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/indexSignature/numberParameter.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type StringArray = 10 | [] 11 | abstract member Item: index: float -> string with get, set 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/indexSignature/stringParameter.d.ts: -------------------------------------------------------------------------------- 1 | export interface BooleanMap { 2 | [index: string]: boolean; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/indexSignature/stringParameter.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type BooleanMap = 10 | [] 11 | abstract member Item: index: string -> bool with get, set 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/method.d.ts: -------------------------------------------------------------------------------- 1 | interface Locale { 2 | hello(): string; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/method.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Locale = 10 | abstract member hello: unit -> string 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/methodWithArguments.d.ts: -------------------------------------------------------------------------------- 1 | interface Locale { 2 | hello(name: string, prefix?: boolean): string; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/methodWithArguments.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Locale = 10 | abstract member hello: name: string * ?prefix: bool -> string 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/methodWithCallbackAndThisAnnotated.d.ts: -------------------------------------------------------------------------------- 1 | interface Database { 2 | run(sql: string, callback?: (this: string, err: Error | null) => void): this; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/methodWithCallbackAndThisAnnotated.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Database = 10 | abstract member run: sql: string * ?callback: (Exception option -> unit) -> Database 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/multipleDeclaration.d.ts: -------------------------------------------------------------------------------- 1 | export interface PointGroupOptions { 2 | size: number; 3 | } 4 | 5 | export interface PointGroupOptions { 6 | label: string; 7 | } 8 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/multipleDeclaration.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type PointGroupOptions = 10 | abstract member size: float with get, set 11 | abstract member label: string with get, set 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/nullUnionIsTranslatedAsOption.d.ts: -------------------------------------------------------------------------------- 1 | interface ConfigTypeMap { 2 | default: string | null; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/nullUnionIsTranslatedAsOption.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type ConfigTypeMap = 10 | abstract member ``default``: string option with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/optionalProperty/simple.d.ts: -------------------------------------------------------------------------------- 1 | interface ErrorHandling { 2 | error?: string; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/optionalProperty/simple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type ErrorHandling = 10 | abstract member error: string option with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/optionalProperty/withNullAndUndefinedUnionType.d.ts: -------------------------------------------------------------------------------- 1 | interface ErrorHandling { 2 | error?: string | undefined | null; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/optionalProperty/withNullAndUndefinedUnionType.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type ErrorHandling = 10 | abstract member error: string option with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/optionalProperty/withNullUnionType.d.ts: -------------------------------------------------------------------------------- 1 | interface ErrorHandling { 2 | error?: string | undefined; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/optionalProperty/withNullUnionType.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type ErrorHandling = 10 | abstract member error: string option with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/optionalProperty/withUndefinedUnionType.d.ts: -------------------------------------------------------------------------------- 1 | interface ErrorHandling { 2 | error?: string | null; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/optionalProperty/withUndefinedUnionType.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type ErrorHandling = 10 | abstract member error: string option with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/quotedProperty.d.ts: -------------------------------------------------------------------------------- 1 | interface IntrinsicElements { 2 | "var": string 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/quotedProperty.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type IntrinsicElements = 10 | abstract member var: string with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/readAndWriteProperty.d.ts: -------------------------------------------------------------------------------- 1 | export interface Options { 2 | level: number; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/readAndWriteProperty.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Options = 10 | abstract member level: float with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/readonlyProperty.d.ts: -------------------------------------------------------------------------------- 1 | export interface Options { 2 | readonly level: number; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/readonlyProperty.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Options = 10 | abstract member level: float with get 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/undefinedUnionIsTranslatedAsOption.d.ts: -------------------------------------------------------------------------------- 1 | interface ConfigTypeMap { 2 | default: string | null; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/interfaces/undefinedUnionIsTranslatedAsOption.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type ConfigTypeMap = 10 | abstract member ``default``: string option with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/intersectionType/insideOfTypeArguments.d.ts: -------------------------------------------------------------------------------- 1 | export type RecordEntryObject = { 2 | v: string 3 | n: number 4 | } 5 | 6 | export type RecordEntryArrayItem = ReadonlyArray< 7 | RecordEntryObject & { i: number } 8 | > 9 | -------------------------------------------------------------------------------- /tests/specs/references/intersectionType/intermediateTypeLiteral.d.ts: -------------------------------------------------------------------------------- 1 | interface ErrorHandling { 2 | success: boolean; 3 | error?: string; 4 | } 5 | 6 | interface ArtworksData { 7 | artworks: string[]; 8 | } 9 | 10 | interface Pagination { 11 | page: number; 12 | pageSize: number; 13 | } 14 | 15 | type ArtworksResponse = ArtworksData & ErrorHandling; 16 | type PaginationArtworksResponse = ArtworksResponse & Pagination; 17 | -------------------------------------------------------------------------------- /tests/specs/references/intersectionType/mixInterfaceAndTypeLiteral.d.ts: -------------------------------------------------------------------------------- 1 | interface CreateArtistBioBase { 2 | artistID: string; 3 | thirdParty?: boolean; 4 | } 5 | 6 | type CreateArtistBioRequest = CreateArtistBioBase & { html: string }; 7 | -------------------------------------------------------------------------------- /tests/specs/references/intersectionType/mixInterfaceAndUnionTypeLiteral.d.ts: -------------------------------------------------------------------------------- 1 | interface CreateArtistBioBase { 2 | artistID: string; 3 | thirdParty?: boolean; 4 | } 5 | 6 | type CreateArtistBioRequest = CreateArtistBioBase & ({ html: string } | { markdown: string }); 7 | -------------------------------------------------------------------------------- /tests/specs/references/intersectionType/mutiplesInterfacesAndTypeLiterals.d.ts: -------------------------------------------------------------------------------- 1 | interface CreateArtistBioBase { 2 | artistID: string; 3 | thirdParty?: boolean; 4 | } 5 | 6 | interface Pagination { 7 | page: number; 8 | pageSize: number; 9 | } 10 | 11 | type CreateArtistBioRequest = 12 | CreateArtistBioBase 13 | & { html: string } 14 | & { markdown: string } 15 | & Pagination; 16 | -------------------------------------------------------------------------------- /tests/specs/references/intersectionType/simple.d.ts: -------------------------------------------------------------------------------- 1 | interface ErrorHandling { 2 | success: boolean; 3 | error?: string; 4 | } 5 | 6 | interface ArtworksData { 7 | artworks: string[]; 8 | } 9 | 10 | type ArtworksResponse = ArtworksData & ErrorHandling; 11 | -------------------------------------------------------------------------------- /tests/specs/references/intersectionType/usedAsReturnTypeOfFunction.d.ts: -------------------------------------------------------------------------------- 1 | export interface WebviewOptions { 2 | readonly enableScripts?: boolean; 3 | } 4 | 5 | export interface WebviewPanelOptions { 6 | readonly enableFindWidget?: boolean; 7 | } 8 | 9 | declare function createWebviewPanel(options?: WebviewPanelOptions & WebviewOptions); 10 | -------------------------------------------------------------------------------- /tests/specs/references/intersectionType/withInterfaceInNamespace.d.ts: -------------------------------------------------------------------------------- 1 | interface ArtworksData { 2 | artworks: string[]; 3 | } 4 | 5 | export namespace Error { 6 | export interface ErrorHandling { 7 | success: boolean; 8 | error?: string; 9 | } 10 | } 11 | 12 | export type ArtworksResponse = ArtworksData & Error.ErrorHandling; 13 | -------------------------------------------------------------------------------- /tests/specs/references/iterable/IterableIterator/class.d.ts: -------------------------------------------------------------------------------- 1 | export declare class DataTransfer implements Iterable { 2 | [Symbol.iterator](): IterableIterator 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/iterable/IterableIterator/class.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type Iterable<'T> = Collections.Generic.IEnumerable<'T> 8 | 9 | [] 10 | [] 11 | type Exports = 12 | [] 13 | static member DataTransfer () : DataTransfer = nativeOnly 14 | 15 | [] 16 | [] 17 | type DataTransfer = 18 | inherit Iterable 19 | 20 | (***) 21 | #r "nuget: Fable.Core" 22 | #r "nuget: Glutinum.Types" 23 | (***) 24 | -------------------------------------------------------------------------------- /tests/specs/references/iterable/IterableIterator/typeLiteral.d.ts: -------------------------------------------------------------------------------- 1 | type MyIterable = { 2 | [Symbol.iterator](): IterableIterator; 3 | }; 4 | -------------------------------------------------------------------------------- /tests/specs/references/iterable/IterableIterator/typeLiteral.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type Iterable<'T> = Collections.Generic.IEnumerable<'T> 8 | 9 | [] 10 | [] 11 | type MyIterable = 12 | inherit Iterable 13 | 14 | (***) 15 | #r "nuget: Fable.Core" 16 | #r "nuget: Glutinum.Types" 17 | (***) 18 | -------------------------------------------------------------------------------- /tests/specs/references/iterable/customIterator.d.ts: -------------------------------------------------------------------------------- 1 | export type MyIterable = { 2 | [Symbol.iterator](): { 3 | next(): { 4 | done: boolean; 5 | value: number; 6 | }; 7 | return(): { 8 | done: boolean; 9 | }; 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /tests/specs/references/iterable/customIterator.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type Iterable<'T> = Collections.Generic.IEnumerable<'T> 8 | 9 | [] 10 | [] 11 | type MyIterable = 12 | inherit Iterable 13 | 14 | (***) 15 | #r "nuget: Fable.Core" 16 | #r "nuget: Glutinum.Types" 17 | (***) 18 | -------------------------------------------------------------------------------- /tests/specs/references/iterable/customIteratorDefaultToAnyIfDetectionFails.d.ts: -------------------------------------------------------------------------------- 1 | export type MyIterable = { 2 | [Symbol.iterator](): { 3 | next(): { 4 | done: boolean; 5 | // Commented on purpose to make type detection fail 6 | // value: number; 7 | }; 8 | return(): { 9 | done: boolean; 10 | }; 11 | }; 12 | }; 13 | -------------------------------------------------------------------------------- /tests/specs/references/iterable/customIteratorDefaultToAnyIfDetectionFails.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type Iterable<'T> = Collections.Generic.IEnumerable<'T> 8 | 9 | [] 10 | [] 11 | type MyIterable = 12 | inherit Iterable 13 | 14 | (***) 15 | #r "nuget: Fable.Core" 16 | #r "nuget: Glutinum.Types" 17 | (***) 18 | -------------------------------------------------------------------------------- /tests/specs/references/keyof/fromInterfaceProperty.d.ts: -------------------------------------------------------------------------------- 1 | export interface RowData { 2 | test : string 3 | } 4 | 5 | export interface AccessorKeyColumnDefBase { 6 | accessorKey: keyof RowData; 7 | } 8 | -------------------------------------------------------------------------------- /tests/specs/references/keyof/method.d.ts: -------------------------------------------------------------------------------- 1 | export interface Logger { 2 | hello() : string; 3 | } 4 | 5 | type L = keyof Logger; 6 | -------------------------------------------------------------------------------- /tests/specs/references/keyof/method.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Logger = 10 | abstract member hello: unit -> string 11 | 12 | [] 13 | [] 14 | type L = 15 | | hello 16 | 17 | (***) 18 | #r "nuget: Fable.Core" 19 | #r "nuget: Glutinum.Types" 20 | (***) 21 | -------------------------------------------------------------------------------- /tests/specs/references/keyof/quotedProperty.d.ts: -------------------------------------------------------------------------------- 1 | interface IntrinsicElements { 2 | "var": string 3 | } 4 | 5 | type Keys = keyof IntrinsicElements 6 | -------------------------------------------------------------------------------- /tests/specs/references/keyof/quotedProperty.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type IntrinsicElements = 10 | abstract member var: string with get, set 11 | 12 | [] 13 | [] 14 | type Keys = 15 | | var 16 | 17 | (***) 18 | #r "nuget: Fable.Core" 19 | #r "nuget: Glutinum.Types" 20 | (***) 21 | -------------------------------------------------------------------------------- /tests/specs/references/keyof/simpleObject.d.ts: -------------------------------------------------------------------------------- 1 | export interface Point { 2 | x: number; 3 | y: number; 4 | } 5 | 6 | type P = keyof Point; 7 | -------------------------------------------------------------------------------- /tests/specs/references/keyof/simpleObject.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Point = 10 | abstract member x: float with get, set 11 | abstract member y: float with get, set 12 | 13 | [] 14 | [] 15 | type P = 16 | | x 17 | | y 18 | 19 | (***) 20 | #r "nuget: Fable.Core" 21 | #r "nuget: Glutinum.Types" 22 | (***) 23 | -------------------------------------------------------------------------------- /tests/specs/references/keyof/typeof.d.ts: -------------------------------------------------------------------------------- 1 | export enum ColorsEnum { 2 | white = '#ffffff', 3 | black = '#000000', 4 | } 5 | 6 | export type Colors = keyof typeof ColorsEnum; 7 | -------------------------------------------------------------------------------- /tests/specs/references/keyof/typeof.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type ColorsEnum = 10 | | [] white 11 | | [] black 12 | 13 | [] 14 | [] 15 | type Colors = 16 | | white 17 | | black 18 | 19 | (***) 20 | #r "nuget: Fable.Core" 21 | #r "nuget: Glutinum.Types" 22 | (***) 23 | -------------------------------------------------------------------------------- /tests/specs/references/keyof/unknown.d.ts: -------------------------------------------------------------------------------- 1 | export type RowData = unknown; 2 | 3 | export interface AccessorKeyColumnDefBase { 4 | id?: string; 5 | accessorKey: keyof RowData; 6 | } 7 | -------------------------------------------------------------------------------- /tests/specs/references/keyof/unknown.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type RowData = 8 | obj 9 | 10 | [] 11 | [] 12 | type AccessorKeyColumnDefBase = 13 | abstract member id: string option with get, set 14 | abstract member accessorKey: obj with get, set 15 | 16 | (***) 17 | #r "nuget: Fable.Core" 18 | #r "nuget: Glutinum.Types" 19 | (***) 20 | -------------------------------------------------------------------------------- /tests/specs/references/literalType/emptyTuple.d.ts: -------------------------------------------------------------------------------- 1 | type MyType = [] 2 | -------------------------------------------------------------------------------- /tests/specs/references/literalType/emptyTuple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type MyType = 8 | obj 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/literalType/false.d.ts: -------------------------------------------------------------------------------- 1 | export type T = { log: false } 2 | -------------------------------------------------------------------------------- /tests/specs/references/literalType/false.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type T = 10 | abstract member log: bool with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/literalType/float.d.ts: -------------------------------------------------------------------------------- 1 | export type T = { log: 10.0 } 2 | -------------------------------------------------------------------------------- /tests/specs/references/literalType/float.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type T = 10 | abstract member log: float with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/literalType/integer.d.ts: -------------------------------------------------------------------------------- 1 | export type T = { log: 10 } 2 | -------------------------------------------------------------------------------- /tests/specs/references/literalType/integer.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type T = 10 | abstract member log: int with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/literalType/null.d.ts: -------------------------------------------------------------------------------- 1 | export type T = { log: null } 2 | -------------------------------------------------------------------------------- /tests/specs/references/literalType/null.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type T = 10 | abstract member log: obj with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/literalType/string.d.ts: -------------------------------------------------------------------------------- 1 | export type T = { log: "name" } 2 | -------------------------------------------------------------------------------- /tests/specs/references/literalType/string.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type T = 10 | abstract member log: string with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/literalType/true.d.ts: -------------------------------------------------------------------------------- 1 | export type T = { log: true } 2 | -------------------------------------------------------------------------------- /tests/specs/references/literalType/true.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type T = 10 | abstract member log: bool with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/literalType/undefined.d.ts: -------------------------------------------------------------------------------- 1 | export type T = { log: undefined } 2 | -------------------------------------------------------------------------------- /tests/specs/references/literalType/undefined.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type T = 10 | abstract member log: obj with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/namedTuple/simple.d.ts: -------------------------------------------------------------------------------- 1 | export interface ConvertColor { 2 | hexToRgb(hex: string): [red: number, green: number, blue: number]; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/namedTuple/simple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type ConvertColor = 10 | abstract member hexToRgb: hex: string -> float * float * float 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/namespace/notExported.d.ts: -------------------------------------------------------------------------------- 1 | namespace dayjs { 2 | export type UnitTypeShort = 's' | 'ms'; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/namespace/notExported.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | module dayjs = 8 | 9 | [] 10 | [] 11 | type UnitTypeShort = 12 | | s 13 | | ms 14 | 15 | (***) 16 | #r "nuget: Fable.Core" 17 | #r "nuget: Glutinum.Types" 18 | (***) 19 | -------------------------------------------------------------------------------- /tests/specs/references/naming/dollar.d.ts: -------------------------------------------------------------------------------- 1 | export type FuseSortFunctionItem = { 2 | $: string, 3 | a$: string, 4 | a$b: string 5 | } 6 | -------------------------------------------------------------------------------- /tests/specs/references/naming/dollar.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type FuseSortFunctionItem = 10 | abstract member ``$``: string with get, set 11 | abstract member ``a$``: string with get, set 12 | abstract member ``a$b``: string with get, set 13 | 14 | (***) 15 | #r "nuget: Fable.Core" 16 | #r "nuget: Glutinum.Types" 17 | (***) 18 | -------------------------------------------------------------------------------- /tests/specs/references/naming/hash.d.ts: -------------------------------------------------------------------------------- 1 | export type FuseSortFunctionItem = { #dd: string } 2 | -------------------------------------------------------------------------------- /tests/specs/references/naming/hash.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type FuseSortFunctionItem = 10 | abstract member ``#dd``: string with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/omit/intersectionType.d.ts: -------------------------------------------------------------------------------- 1 | interface Todo { 2 | title: string; 3 | description: string; 4 | } 5 | 6 | interface TodoExtra { 7 | completed: boolean; 8 | createdAt: number; 9 | } 10 | 11 | type TodoPreview = Omit; 12 | -------------------------------------------------------------------------------- /tests/specs/references/omit/mutiple.d.ts: -------------------------------------------------------------------------------- 1 | export interface Todo { 2 | title: string; 3 | description: string; 4 | completed: boolean; 5 | createdAt: number; 6 | } 7 | 8 | export type TodoInfo = Omit; 9 | -------------------------------------------------------------------------------- /tests/specs/references/omit/nonExistingProperty.d.ts: -------------------------------------------------------------------------------- 1 | export interface Todo { 2 | completed: boolean; 3 | createdAt: number; 4 | } 5 | 6 | export type TodoInfo = Omit; 7 | -------------------------------------------------------------------------------- /tests/specs/references/omit/nonExistingProperty.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Todo = 10 | abstract member completed: bool with get, set 11 | abstract member createdAt: float with get, set 12 | 13 | [] 14 | [] 15 | type TodoInfo = 16 | abstract member createdAt: float with get, set 17 | 18 | (***) 19 | #r "nuget: Fable.Core" 20 | #r "nuget: Glutinum.Types" 21 | (***) 22 | -------------------------------------------------------------------------------- /tests/specs/references/omit/nonExistingType.d.ts: -------------------------------------------------------------------------------- 1 | export type MapboxOverlayProps = Omit 2 | -------------------------------------------------------------------------------- /tests/specs/references/omit/nonExistingType.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type MapboxOverlayProps = 10 | interface end 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/omit/resultInEmptyInterface.d.ts: -------------------------------------------------------------------------------- 1 | export interface Todo { 2 | completed: boolean; 3 | createdAt: number; 4 | } 5 | 6 | export type TodoInfo = Omit; 7 | -------------------------------------------------------------------------------- /tests/specs/references/omit/resultInEmptyInterface.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Todo = 10 | abstract member completed: bool with get, set 11 | abstract member createdAt: float with get, set 12 | 13 | [] 14 | [] 15 | type TodoInfo = 16 | interface end 17 | 18 | (***) 19 | #r "nuget: Fable.Core" 20 | #r "nuget: Glutinum.Types" 21 | (***) 22 | -------------------------------------------------------------------------------- /tests/specs/references/omit/simple.d.ts: -------------------------------------------------------------------------------- 1 | export interface Todo { 2 | title: string; 3 | description: string; 4 | completed: boolean; 5 | createdAt: number; 6 | } 7 | 8 | export type TodoPreview = Omit; 9 | -------------------------------------------------------------------------------- /tests/specs/references/omit/worksAsReturnType.d.ts: -------------------------------------------------------------------------------- 1 | interface Todo { 2 | title: string; 3 | description: string; 4 | } 5 | 6 | declare function foo() : Omit; 7 | -------------------------------------------------------------------------------- /tests/specs/references/parenthesizedType/simple.d.ts: -------------------------------------------------------------------------------- 1 | export type Foo = (string | number) 2 | -------------------------------------------------------------------------------- /tests/specs/references/parenthesizedType/simple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type Foo = 8 | U2 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/partial/dontCrashOnUnkownTypes.d.ts: -------------------------------------------------------------------------------- 1 | type TodoPartial = Partial; 2 | -------------------------------------------------------------------------------- /tests/specs/references/partial/dontCrashOnUnkownTypes.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type TodoPartial = 10 | interface end 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/partial/generateATypeAliasWhenUsedForTypingApi.d.ts: -------------------------------------------------------------------------------- 1 | interface Todo { 2 | title: string; 3 | description: string; 4 | } 5 | 6 | declare function UpdateTodo(todo: Partial) : any; 7 | -------------------------------------------------------------------------------- /tests/specs/references/partial/inheritance/multipleTypeDeclaration.d.ts: -------------------------------------------------------------------------------- 1 | export interface PointGroupOptions { 2 | dotSize: number; 3 | } 4 | 5 | export interface PointGroupOptions { 6 | size: number; 7 | } 8 | 9 | export interface Options extends Partial { 10 | minDistance?: number; 11 | } 12 | -------------------------------------------------------------------------------- /tests/specs/references/partial/inheritance/nullabledUnionAreOptimised.d.ts: -------------------------------------------------------------------------------- 1 | export interface PointGroupOptions { 2 | size?: number | undefined; 3 | size2?: number | null; 4 | size3: number | null; 5 | size4: number | undefined; 6 | } 7 | 8 | export interface Options extends Partial { 9 | minDistance?: number; 10 | } 11 | -------------------------------------------------------------------------------- /tests/specs/references/partial/inheritance/optionalPropertyAreForwardedAsIs.d.ts: -------------------------------------------------------------------------------- 1 | export interface PointGroupOptions { 2 | dotSize?: number; 3 | count: number; 4 | } 5 | 6 | export interface Options extends Partial { 7 | minDistance?: number; 8 | } 9 | -------------------------------------------------------------------------------- /tests/specs/references/partial/inheritance/simple.d.ts: -------------------------------------------------------------------------------- 1 | export interface PointGroupOptions { 2 | dotSize: number; 3 | } 4 | 5 | export interface Options extends Partial { 6 | minDistance?: number; 7 | } 8 | -------------------------------------------------------------------------------- /tests/specs/references/partial/inheritance/simple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type PointGroupOptions = 10 | abstract member dotSize: float with get, set 11 | 12 | [] 13 | [] 14 | type Options = 15 | abstract member minDistance: float option with get, set 16 | abstract member dotSize: float option with get, set 17 | 18 | (***) 19 | #r "nuget: Fable.Core" 20 | #r "nuget: Glutinum.Types" 21 | (***) 22 | -------------------------------------------------------------------------------- /tests/specs/references/partial/intersectionType.d.ts: -------------------------------------------------------------------------------- 1 | interface Todo { 2 | title: string; 3 | description: string; 4 | } 5 | 6 | interface TodoExtra { 7 | author: string; 8 | date: Date 9 | } 10 | 11 | export type TodoPreview = Partial; 12 | -------------------------------------------------------------------------------- /tests/specs/references/partial/literalType.d.ts: -------------------------------------------------------------------------------- 1 | export type TodoPreview = Partial<{ 2 | title: string; 3 | description: string; 4 | }>; 5 | -------------------------------------------------------------------------------- /tests/specs/references/partial/literalType.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type TodoPreview = 10 | abstract member title: string option with get, set 11 | abstract member description: string option with get, set 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/partial/simple.d.ts: -------------------------------------------------------------------------------- 1 | interface Todo { 2 | title: string; 3 | description: string; 4 | } 5 | 6 | type TodoPartial = Partial; 7 | -------------------------------------------------------------------------------- /tests/specs/references/partial/simple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Todo = 10 | abstract member title: string with get, set 11 | abstract member description: string with get, set 12 | 13 | [] 14 | [] 15 | type TodoPartial = 16 | abstract member title: string option with get, set 17 | abstract member description: string option with get, set 18 | 19 | (***) 20 | #r "nuget: Fable.Core" 21 | #r "nuget: Glutinum.Types" 22 | (***) 23 | -------------------------------------------------------------------------------- /tests/specs/references/readonly/asReturnTypeSimple.d.ts: -------------------------------------------------------------------------------- 1 | export interface TerminalOptions { 2 | prefix: string 3 | } 4 | 5 | export interface Foo { 6 | terminal: Readonly 7 | } 8 | -------------------------------------------------------------------------------- /tests/specs/references/readonly/asReturnTypeUnion.d.ts: -------------------------------------------------------------------------------- 1 | export interface TerminalOptions { 2 | prefix: string 3 | } 4 | 5 | export interface ExtersionTerminalOptions { 6 | suffix: string 7 | } 8 | 9 | 10 | export interface Foo { 11 | terminal: Readonly 12 | } 13 | -------------------------------------------------------------------------------- /tests/specs/references/readonly/class.d.ts: -------------------------------------------------------------------------------- 1 | export class Foo { 2 | constructor() 3 | bar: string; 4 | foo() 5 | } 6 | 7 | export type ReadonlyFoo = Readonly; 8 | -------------------------------------------------------------------------------- /tests/specs/references/readonly/intersection.d.ts: -------------------------------------------------------------------------------- 1 | export interface TerminalOptions { 2 | prefix: string 3 | } 4 | 5 | export interface ExtensionTerminalOptions { 6 | suffix: string 7 | } 8 | 9 | export type Test = Readonly 10 | -------------------------------------------------------------------------------- /tests/specs/references/readonly/simple.d.ts: -------------------------------------------------------------------------------- 1 | export interface TerminalOptions { 2 | prefix: string 3 | } 4 | 5 | export type ReadonlyTerminalOptions = Readonly 6 | -------------------------------------------------------------------------------- /tests/specs/references/readonly/simple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type TerminalOptions = 10 | abstract member prefix: string with get, set 11 | 12 | [] 13 | [] 14 | type ReadonlyTerminalOptions = 15 | abstract member prefix: string with get 16 | 17 | (***) 18 | #r "nuget: Fable.Core" 19 | #r "nuget: Glutinum.Types" 20 | (***) 21 | -------------------------------------------------------------------------------- /tests/specs/references/readonly/union.d.ts: -------------------------------------------------------------------------------- 1 | export interface TerminalOptions { 2 | prefix: string 3 | } 4 | 5 | export interface ExtensionTerminalOptions { 6 | suffix: string 7 | } 8 | 9 | export type Foo = Readonly; 10 | -------------------------------------------------------------------------------- /tests/specs/references/regressions/recursive-type-1.d.ts: -------------------------------------------------------------------------------- 1 | export interface DiagnosticCollection { 2 | forEach(callback: (collection: DiagnosticCollection) => any): void; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/regressions/recursive-type-1.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type DiagnosticCollection = 10 | abstract member forEach: callback: (DiagnosticCollection -> obj) -> unit 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Array.d.ts: -------------------------------------------------------------------------------- 1 | export type T = Array 2 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Array.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type T = 8 | ResizeArray 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Boolean.d.ts: -------------------------------------------------------------------------------- 1 | export type T = Boolean 2 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Boolean.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type T = 8 | bool 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Error.d.ts: -------------------------------------------------------------------------------- 1 | export type T = Error 2 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Error.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type T = 8 | Exception 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Float32Array.d.ts: -------------------------------------------------------------------------------- 1 | export type T = Float32Array; 2 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Float32Array.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type T = 8 | JS.Float32Array 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Float64Array.d.ts: -------------------------------------------------------------------------------- 1 | export type T = Float64Array; 2 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Float64Array.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type T = 8 | JS.Float64Array 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Function.d.ts: -------------------------------------------------------------------------------- 1 | export interface sharedEvents { 2 | getEventState: Function 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Function.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type sharedEvents = 10 | abstract member getEventState: Action with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Int16Array.d.ts: -------------------------------------------------------------------------------- 1 | export type T = Int16Array; 2 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Int16Array.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type T = 8 | JS.Int16Array 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Int32Array.d.ts: -------------------------------------------------------------------------------- 1 | export type T = Int32Array; 2 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Int32Array.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type T = 8 | JS.Int32Array 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Int8Array.d.ts: -------------------------------------------------------------------------------- 1 | export type T = Int8Array; 2 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Int8Array.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type T = 8 | JS.Int8Array 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Promise.d.ts: -------------------------------------------------------------------------------- 1 | export function hello () : Promise -------------------------------------------------------------------------------- /tests/specs/references/replacements/Promise.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member hello () : JS.Promise = nativeOnly 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/ReadonlyArray.d.ts: -------------------------------------------------------------------------------- 1 | export type T = ReadonlyArray 2 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/ReadonlyArray.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | // You need to add Glutinum.Types NuGet package to your project 8 | open Glutinum.Types.TypeScript 9 | 10 | type T = 11 | ReadonlyArray 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/RegExp.d.ts: -------------------------------------------------------------------------------- 1 | export type T = RegExp 2 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/RegExp.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type RegExp = Text.RegularExpressions.Regex 8 | 9 | type T = 10 | RegExp 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Uint16Array.d.ts: -------------------------------------------------------------------------------- 1 | export type T = Uint16Array; 2 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Uint16Array.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type T = 8 | JS.Uint16Array 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Uint32Array.d.ts: -------------------------------------------------------------------------------- 1 | export type T = Uint32Array; 2 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Uint32Array.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type T = 8 | JS.Uint32Array 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Uint8Array.d.ts: -------------------------------------------------------------------------------- 1 | export type T = Uint8Array 2 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Uint8Array.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type T = 8 | JS.Uint8Array 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Uint8ClampedArray.d.ts: -------------------------------------------------------------------------------- 1 | export type T = Uint8ClampedArray; 2 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/Uint8ClampedArray.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type T = 8 | JS.Uint8ClampedArray 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/date.d.ts: -------------------------------------------------------------------------------- 1 | export const date: Date; 2 | 3 | export class MyDate { 4 | toDate(): Date 5 | } 6 | 7 | export type MyDateUnion = string | Date 8 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/readonly_array.d.ts: -------------------------------------------------------------------------------- 1 | export type T = readonly number[]; 2 | -------------------------------------------------------------------------------- /tests/specs/references/replacements/readonly_array.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | // You need to add Glutinum.Types NuGet package to your project 8 | open Glutinum.Types.TypeScript 9 | 10 | type T = 11 | ReadonlyArray 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/returnType/any.d.ts: -------------------------------------------------------------------------------- 1 | export type T5 = ReturnType; 2 | -------------------------------------------------------------------------------- /tests/specs/references/returnType/any.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type T5 = 8 | obj 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/returnType/functionWithArgument.d.ts: -------------------------------------------------------------------------------- 1 | export type T1 = ReturnType<(s: string) => void>; 2 | -------------------------------------------------------------------------------- /tests/specs/references/returnType/functionWithArgument.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type T1 = 8 | unit 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/returnType/functionWithNoArgument.d.ts: -------------------------------------------------------------------------------- 1 | export type T0 = ReturnType<() => string>; 2 | -------------------------------------------------------------------------------- /tests/specs/references/returnType/functionWithNoArgument.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type T0 = 8 | string 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/returnType/generic.d.ts: -------------------------------------------------------------------------------- 1 | export type T2 = ReturnType<() => T>; 2 | -------------------------------------------------------------------------------- /tests/specs/references/returnType/generic.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type T2 = 8 | obj 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/returnType/genericWithExtends.d.ts: -------------------------------------------------------------------------------- 1 | export type T3 = ReturnType<() => T>; 2 | -------------------------------------------------------------------------------- /tests/specs/references/returnType/genericWithExtends.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type T3 = 8 | ResizeArray 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/returnType/never.d.ts: -------------------------------------------------------------------------------- 1 | export type T6 = ReturnType; 2 | -------------------------------------------------------------------------------- /tests/specs/references/returnType/never.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type T6 = 8 | obj 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/returnType/typeOfFunctionWithLiteralType.d.ts: -------------------------------------------------------------------------------- 1 | declare function f1(): { a: number; b: string }; 2 | 3 | export type T4 = ReturnType; 4 | -------------------------------------------------------------------------------- /tests/specs/references/returnedType/record.d.ts: -------------------------------------------------------------------------------- 1 | export function t(args: Record); 2 | -------------------------------------------------------------------------------- /tests/specs/references/returnedType/templateLiteralType.d.ts: -------------------------------------------------------------------------------- 1 | declare function log () : `section-${string}`; 2 | -------------------------------------------------------------------------------- /tests/specs/references/returnedType/templateLiteralType.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member log () : string = nativeOnly 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/templateLiteralType/simple.d.ts: -------------------------------------------------------------------------------- 1 | type AutoFillSection = `section-${string}`; 2 | -------------------------------------------------------------------------------- /tests/specs/references/templateLiteralType/simple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type AutoFillSection = 8 | string 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/thisParameterType/simple.d.ts: -------------------------------------------------------------------------------- 1 | declare function toHex(this: number): string; 2 | declare function numberToString(n: ThisParameterType): string; 3 | -------------------------------------------------------------------------------- /tests/specs/references/thisParameterType/simple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member toHex (this: float) : string = nativeOnly 12 | [] 13 | static member numberToString (n: float) : string = nativeOnly 14 | 15 | (***) 16 | #r "nuget: Fable.Core" 17 | #r "nuget: Glutinum.Types" 18 | (***) 19 | -------------------------------------------------------------------------------- /tests/specs/references/tupleType/inUnionType.d.ts: -------------------------------------------------------------------------------- 1 | export type LatLngTuple = [number, number, number?]; 2 | 3 | export type LatLngExpression = string | LatLngTuple; 4 | -------------------------------------------------------------------------------- /tests/specs/references/tupleType/inUnionType.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type LatLngTuple = 8 | float * float * float option 9 | 10 | type LatLngExpression = 11 | U2 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/tupleType/mixedArgumentsType.d.ts: -------------------------------------------------------------------------------- 1 | export function t(a: [number, string, boolean, string | undefined, string | boolean]): void; 2 | -------------------------------------------------------------------------------- /tests/specs/references/tupleType/mixedArgumentsType.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member t (a: float * string * bool * string option * U2) : unit = nativeOnly 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/tupleType/severalArguments.d.ts: -------------------------------------------------------------------------------- 1 | export function t2(a: [number, number]): void; 2 | export function t3(a: [number, number, number]): void; 3 | -------------------------------------------------------------------------------- /tests/specs/references/tupleType/severalArguments.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member t2 (a: float * float) : unit = nativeOnly 12 | [] 13 | static member t3 (a: float * float * float) : unit = nativeOnly 14 | 15 | (***) 16 | #r "nuget: Fable.Core" 17 | #r "nuget: Glutinum.Types" 18 | (***) 19 | -------------------------------------------------------------------------------- /tests/specs/references/tupleType/singleArgument.d.ts: -------------------------------------------------------------------------------- 1 | export function transformation(coefficients: [number]): void; 2 | -------------------------------------------------------------------------------- /tests/specs/references/tupleType/singleArgument.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member transformation (coefficients: float) : unit = nativeOnly 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/tupleType/withOptionalType.d.ts: -------------------------------------------------------------------------------- 1 | export type LatLngTuple = [number, number, number?]; 2 | -------------------------------------------------------------------------------- /tests/specs/references/tupleType/withOptionalType.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type LatLngTuple = 8 | float * float * float option 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/conditionalType/defaultToCheckedType.d.ts: -------------------------------------------------------------------------------- 1 | export class Foo {} 2 | export class Bar {} 3 | 4 | // Works with concrete types 5 | export type ReturnType = Foo extends(...args:any)=>infer R?R:any; 6 | export type ReturnType1 = Bar extends(...args:any)=>infer R?R:any; 7 | 8 | // Works with generic types 9 | export type ReturnType2any>=T extends(...args:any)=>infer R?R:any; 10 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/conditionalType/simple.d.ts: -------------------------------------------------------------------------------- 1 | interface Animal { 2 | live(): void; 3 | } 4 | 5 | interface Dog extends Animal { 6 | woof(): void; 7 | } 8 | 9 | export type Example1 = Dog extends Animal ? number : string; 10 | 11 | export type Example2 = RegExp extends Animal ? number : string; 12 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/conditionalType/simple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Animal = 10 | abstract member live: unit -> unit 11 | 12 | [] 13 | [] 14 | type Dog = 15 | inherit Animal 16 | abstract member woof: unit -> unit 17 | 18 | type Example1 = 19 | float 20 | 21 | type Example2 = 22 | string 23 | 24 | (***) 25 | #r "nuget: Fable.Core" 26 | #r "nuget: Glutinum.Types" 27 | (***) 28 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/constraints/multiple.d.ts: -------------------------------------------------------------------------------- 1 | export class Foo { } 2 | 3 | type ReturnType, B extends Foo> = [A, T, B] 4 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/constraints/multiple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member Foo<'A> () : Foo<'A> = nativeOnly 12 | 13 | [] 14 | [] 15 | type Foo<'A> = 16 | interface end 17 | 18 | type ReturnType<'A, 'T, 'B when 'T :> Foo<'A> and 'B :> Foo<'A>> = 19 | 'A * 'T * 'B 20 | 21 | (***) 22 | #r "nuget: Fable.Core" 23 | #r "nuget: Glutinum.Types" 24 | (***) 25 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/constraints/single.d.ts: -------------------------------------------------------------------------------- 1 | export class Foo { } 2 | 3 | type ReturnType> = T 4 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/constraints/single.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member Foo<'A> () : Foo<'A> = nativeOnly 12 | 13 | [] 14 | [] 15 | type Foo<'A> = 16 | interface end 17 | 18 | type ReturnType<'A, 'T when 'T :> Foo<'A>> = 19 | 'T 20 | 21 | (***) 22 | #r "nuget: Fable.Core" 23 | #r "nuget: Glutinum.Types" 24 | (***) 25 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/interface.d.ts: -------------------------------------------------------------------------------- 1 | export interface FormatObject { 2 | locale?: string; 3 | format?: string; 4 | utc?: boolean; 5 | } 6 | 7 | export type OptionType = FormatObject; 8 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/interface.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type FormatObject = 10 | abstract member locale: string option with get, set 11 | abstract member format: string option with get, set 12 | abstract member utc: bool option with get, set 13 | 14 | type OptionType = 15 | FormatObject 16 | 17 | (***) 18 | #r "nuget: Fable.Core" 19 | #r "nuget: Glutinum.Types" 20 | (***) 21 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/literal/boolean.d.ts: -------------------------------------------------------------------------------- 1 | type Test2 = true; 2 | 3 | type Test3 = false; 4 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/literal/boolean.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type Test2 = 8 | bool 9 | 10 | type Test3 = 11 | bool 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/literal/float.d.ts: -------------------------------------------------------------------------------- 1 | type Test1 = 1.12 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/literal/float.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type Test1 = 8 | float 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/literal/int.d.ts: -------------------------------------------------------------------------------- 1 | type Test = 0 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/literal/int.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type Test = 8 | int 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/literal/string.d.ts: -------------------------------------------------------------------------------- 1 | type GPUAutoLayoutMode = 2 | "auto"; 3 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/literal/string.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type GPUAutoLayoutMode = 10 | | auto 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/primitives/array.d.ts: -------------------------------------------------------------------------------- 1 | type MyStringArray = string[]; 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/primitives/array.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type MyStringArray = 8 | ResizeArray 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/primitives/boolean.d.ts: -------------------------------------------------------------------------------- 1 | type MyBoolean = boolean; 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/primitives/boolean.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type MyBoolean = 8 | bool 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/primitives/disabled.float.d.ts: -------------------------------------------------------------------------------- 1 | type MyFloat = float; 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/primitives/disabled.float.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open System 5 | 6 | type MyFloat = 7 | float 8 | 9 | (***) 10 | #r "nuget: Fable.Core" 11 | #r "nuget: Glutinum.Types" 12 | (***) 13 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/primitives/float.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | (***) 4 | #r "nuget: Fable.Core" 5 | #r "nuget: Glutinum.Types" 6 | (***) 7 | 8 | open Fable.Core 9 | open System 10 | 11 | type MyFloat = 12 | float 13 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/primitives/number.d.ts: -------------------------------------------------------------------------------- 1 | type MyNumber = number; 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/primitives/number.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type MyNumber = 8 | float 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/primitives/object.d.ts: -------------------------------------------------------------------------------- 1 | export type MyType = object 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/primitives/object.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type MyType = 8 | obj 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/primitives/string.d.ts: -------------------------------------------------------------------------------- 1 | type MyString = string; 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/primitives/string.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type MyString = 8 | string 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/primitives/symbol.d.ts: -------------------------------------------------------------------------------- 1 | type SymbolAlias = symbol 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/primitives/symbol.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type SymbolAlias = 8 | obj 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/record.d.ts: -------------------------------------------------------------------------------- 1 | export type MyType = Record 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/record.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type MyType = 10 | [] 11 | abstract member Item: key: string -> float with get, set 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/tupleType.d.ts: -------------------------------------------------------------------------------- 1 | type LatLng = [number, number] 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/tupleType.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type LatLng = 8 | float * float 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/typeParameter.d.ts: -------------------------------------------------------------------------------- 1 | export type PluginFunc = T; 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/typeParameter.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type PluginFunc<'T> = 8 | 'T 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/typeReference.d.ts: -------------------------------------------------------------------------------- 1 | type StringArray = Array 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/typeReference.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type StringArray = 8 | ResizeArray 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/unions/primiteAndTypeReference.d.ts: -------------------------------------------------------------------------------- 1 | export type OptionType = number | string 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/unions/primiteAndTypeReference.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type OptionType = 8 | U2 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/unions/primitiveAndTypeReferenceToAnInterface.d.ts: -------------------------------------------------------------------------------- 1 | export interface FormatObject { locale?: string, format?: string, utc?: boolean } 2 | 3 | export type OptionType = FormatObject | string | string[] 4 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/unions/primitiveAndTypeReferenceToAnInterface.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type FormatObject = 10 | abstract member locale: string option with get, set 11 | abstract member format: string option with get, set 12 | abstract member utc: bool option with get, set 13 | 14 | type OptionType = 15 | U3> 16 | 17 | (***) 18 | #r "nuget: Fable.Core" 19 | #r "nuget: Glutinum.Types" 20 | (***) 21 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/unions/primitives.d.ts: -------------------------------------------------------------------------------- 1 | export type OptionType = number | string 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/unions/primitives.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type OptionType = 8 | U2 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/unknown.d.ts: -------------------------------------------------------------------------------- 1 | export type MyType = unknown 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeAlias/unknown.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type MyType = 8 | obj 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/argumentsInMethod/namesAreSanitized.d.ts: -------------------------------------------------------------------------------- 1 | export interface Test { 2 | callback: ((params: { 3 | table: string; 4 | }) => void) 5 | } 6 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/argumentsInMethod/nested.d.ts: -------------------------------------------------------------------------------- 1 | interface Locale { 2 | hello(config: { 3 | verbose: { 4 | verbose: Boolean 5 | } 6 | }): string; 7 | } 8 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/argumentsInMethod/simple.d.ts: -------------------------------------------------------------------------------- 1 | interface Locale { 2 | hello(config: { 3 | verbose: Boolean 4 | }): string; 5 | } 6 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/argumentsInMethod/undefinedTypesAreConvertedToOptionalArguments.d.ts: -------------------------------------------------------------------------------- 1 | interface Locale { 2 | hello(config: { 3 | prefix: string | undefined 4 | suffix?: string 5 | verbose: Boolean 6 | }): string; 7 | } 8 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/constructSignature.d.ts: -------------------------------------------------------------------------------- 1 | type Test = { new (...args: any[]): any; } 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/constructSignature.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Test = 10 | [] 11 | abstract member Create: [] args: obj [] -> obj 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/constructorType/simple.d.ts: -------------------------------------------------------------------------------- 1 | type ClientLikeCtr = new(config?: string) => number; 2 | 3 | declare class Pool { 4 | Client: ClientLikeCtr; 5 | } 6 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/constructorType/simple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member Pool () : Pool = nativeOnly 12 | 13 | type ClientLikeCtr = 14 | obj 15 | 16 | [] 17 | [] 18 | type Pool = 19 | abstract member Client: ClientLikeCtr with get, set 20 | 21 | (***) 22 | #r "nuget: Fable.Core" 23 | #r "nuget: Glutinum.Types" 24 | (***) 25 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/constructorType/withOneGenerics.d.ts: -------------------------------------------------------------------------------- 1 | type ClientLikeCtr = new(config?: string) => T; 2 | 3 | declare class Pool { 4 | Client: ClientLikeCtr; 5 | } 6 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/functionType/generics.d.ts: -------------------------------------------------------------------------------- 1 | export type Callback = (event: { 2 | type: 'CREATE' | 'REMOVE'; 3 | param: Param; 4 | atom: AtomType; 5 | }) => void; 6 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/indexSignature/mixed.d.ts: -------------------------------------------------------------------------------- 1 | export interface OptionsInline { 2 | users: { 3 | country: string 4 | [key: string]: string 5 | } 6 | firstName: string 7 | } 8 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/indexSignature/readonly.d.ts: -------------------------------------------------------------------------------- 1 | export interface MyType { 2 | readonly [n: number]: string; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/indexSignature/readonly.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type MyType = 10 | [] 11 | abstract member Item: n: float -> string with get 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/indexSignature/simple.d.ts: -------------------------------------------------------------------------------- 1 | interface OptionsInline { 2 | users: { [key: string]: string } 3 | } 4 | 5 | // 1. If only index signature generate an EmitIndexer 6 | // 2. If no index signature generate a ParamObject 7 | // 3. If both, generate a normal Interface with EmitIndexer and standard properties for usage with jsOptions, etc. 8 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/indexSignature/simple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type OptionsInline = 10 | abstract member users: OptionsInline.users with get, set 11 | 12 | module OptionsInline = 13 | 14 | [] 15 | [] 16 | type users = 17 | [] 18 | abstract member Item: key: string -> string with get, set 19 | 20 | (***) 21 | #r "nuget: Fable.Core" 22 | #r "nuget: Glutinum.Types" 23 | (***) 24 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/returnType/classMethod.d.ts: -------------------------------------------------------------------------------- 1 | export class Test { 2 | now(): { day: number, month: number, year: number } 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/returnType/function.d.ts: -------------------------------------------------------------------------------- 1 | export function Test(): { a: string, b: number } 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/returnType/typeAliasMethod.d.ts: -------------------------------------------------------------------------------- 1 | export type Test = { 2 | now(): { day: number, month: number, year: number } 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/typeAlias/arguments.d.ts: -------------------------------------------------------------------------------- 1 | export class Test { 2 | date(config: { day: number, month: number, year: number }): string 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/typeAlias/nested.d.ts: -------------------------------------------------------------------------------- 1 | export type Animal = { 2 | name: { 3 | text : string 4 | }; 5 | } 6 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/typeAlias/nested.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Animal = 10 | abstract member name: Animal.name with get, set 11 | 12 | module Animal = 13 | 14 | [] 15 | [] 16 | type name 17 | [] 18 | ( 19 | text: string 20 | ) = 21 | 22 | member val text : string = nativeOnly with get, set 23 | 24 | (***) 25 | #r "nuget: Fable.Core" 26 | #r "nuget: Glutinum.Types" 27 | (***) 28 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/typeAlias/readonlyProperty.d.ts: -------------------------------------------------------------------------------- 1 | export declare const settings: { 2 | readonly enable: boolean; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/typeAlias/simple.d.ts: -------------------------------------------------------------------------------- 1 | export type Animal = { 2 | name: string 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/typeAlias/simple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Animal = 10 | abstract member name: string with get, set 11 | 12 | (***) 13 | #r "nuget: Fable.Core" 14 | #r "nuget: Glutinum.Types" 15 | (***) 16 | -------------------------------------------------------------------------------- /tests/specs/references/typeLiteral/variableExport.d.ts: -------------------------------------------------------------------------------- 1 | declare const supportsColor: { 2 | stdout: ColorInfo; 3 | stderr: ColorInfo; 4 | }; 5 | 6 | type ColorInfo = string; 7 | 8 | export default supportsColor; 9 | -------------------------------------------------------------------------------- /tests/specs/references/typeOperator/readonly.d.ts: -------------------------------------------------------------------------------- 1 | declare function test(array: readonly string[]) 2 | -------------------------------------------------------------------------------- /tests/specs/references/typeOperator/readonly.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | // You need to add Glutinum.Types NuGet package to your project 8 | open Glutinum.Types.TypeScript 9 | 10 | [] 11 | [] 12 | type Exports = 13 | [] 14 | static member test (array: ReadonlyArray) : unit = nativeOnly 15 | 16 | (***) 17 | #r "nuget: Fable.Core" 18 | #r "nuget: Glutinum.Types" 19 | (***) 20 | -------------------------------------------------------------------------------- /tests/specs/references/typePredicate/convertedToBool.d.ts: -------------------------------------------------------------------------------- 1 | export function isDayjs(d: any): d is Dayjs 2 | -------------------------------------------------------------------------------- /tests/specs/references/typePredicate/convertedToBool.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member isDayjs (d: obj) : bool = nativeOnly 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/typeQuery/class.d.ts: -------------------------------------------------------------------------------- 1 | export class DayJs { 2 | constructor() 3 | } 4 | 5 | export type PluginFunc = (c: typeof DayJs) => void 6 | -------------------------------------------------------------------------------- /tests/specs/references/typeQuery/functionType.d.ts: -------------------------------------------------------------------------------- 1 | // Should default to obj if the type query is not of a supported type 2 | declare function log (): void 3 | 4 | export type PluginFunc = (c: typeof log) => void 5 | -------------------------------------------------------------------------------- /tests/specs/references/typeQuery/functionType.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member log () : unit = nativeOnly 12 | 13 | [] 14 | [] 15 | type PluginFunc = 16 | [] 17 | abstract member Invoke: c: (unit -> unit) -> unit 18 | 19 | (***) 20 | #r "nuget: Fable.Core" 21 | #r "nuget: Glutinum.Types" 22 | (***) 23 | -------------------------------------------------------------------------------- /tests/specs/references/typeQuery/namespace.d.ts: -------------------------------------------------------------------------------- 1 | export namespace DomEvent { 2 | export function stop(): typeof DomEvent; 3 | } 4 | -------------------------------------------------------------------------------- /tests/specs/references/typeQuery/primitive/boolean.d.ts: -------------------------------------------------------------------------------- 1 | export const version : boolean; 2 | export function isVersion(text : typeof version): void; 3 | -------------------------------------------------------------------------------- /tests/specs/references/typeQuery/primitive/boolean.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member inline version: bool = nativeOnly 12 | [] 13 | static member isVersion (text: bool) : unit = nativeOnly 14 | 15 | (***) 16 | #r "nuget: Fable.Core" 17 | #r "nuget: Glutinum.Types" 18 | (***) 19 | -------------------------------------------------------------------------------- /tests/specs/references/typeQuery/primitive/null.d.ts: -------------------------------------------------------------------------------- 1 | export const version : null; 2 | export function toVersion(text : typeof version): void; 3 | -------------------------------------------------------------------------------- /tests/specs/references/typeQuery/primitive/null.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member inline version: obj = nativeOnly 12 | [] 13 | static member toVersion (text: obj) : unit = nativeOnly 14 | 15 | (***) 16 | #r "nuget: Fable.Core" 17 | #r "nuget: Glutinum.Types" 18 | (***) 19 | -------------------------------------------------------------------------------- /tests/specs/references/typeQuery/primitive/number.d.ts: -------------------------------------------------------------------------------- 1 | export const version : number; 2 | export function toVersion(text : typeof version): void; 3 | -------------------------------------------------------------------------------- /tests/specs/references/typeQuery/primitive/number.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member inline version: float = nativeOnly 12 | [] 13 | static member toVersion (text: float) : unit = nativeOnly 14 | 15 | (***) 16 | #r "nuget: Fable.Core" 17 | #r "nuget: Glutinum.Types" 18 | (***) 19 | -------------------------------------------------------------------------------- /tests/specs/references/typeQuery/primitive/string.d.ts: -------------------------------------------------------------------------------- 1 | export const version : string; 2 | export function toVersion(text : typeof version): void; 3 | -------------------------------------------------------------------------------- /tests/specs/references/typeQuery/primitive/string.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member inline version: string = nativeOnly 12 | [] 13 | static member toVersion (text: string) : unit = nativeOnly 14 | 15 | (***) 16 | #r "nuget: Fable.Core" 17 | #r "nuget: Glutinum.Types" 18 | (***) 19 | -------------------------------------------------------------------------------- /tests/specs/references/typeQuery/primitive/undefined.d.ts: -------------------------------------------------------------------------------- 1 | export const version : undefined; 2 | export function toVersion(text : typeof version): void; 3 | -------------------------------------------------------------------------------- /tests/specs/references/typeQuery/primitive/undefined.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member inline version: obj = nativeOnly 12 | [] 13 | static member toVersion (text: obj) : unit = nativeOnly 14 | 15 | (***) 16 | #r "nuget: Fable.Core" 17 | #r "nuget: Glutinum.Types" 18 | (***) 19 | -------------------------------------------------------------------------------- /tests/specs/references/typeQuery/primitive/unit.d.ts: -------------------------------------------------------------------------------- 1 | export const version : void; 2 | export function toVersion(text : typeof version): void; 3 | -------------------------------------------------------------------------------- /tests/specs/references/typeQuery/primitive/unit.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member inline version: unit = nativeOnly 12 | [] 13 | static member toVersion (text: unit) : unit = nativeOnly 14 | 15 | (***) 16 | #r "nuget: Fable.Core" 17 | #r "nuget: Glutinum.Types" 18 | (***) 19 | -------------------------------------------------------------------------------- /tests/specs/references/typeof/typeofStrings.d.ts: -------------------------------------------------------------------------------- 1 | declare const NODES: readonly ["a", "button"]; 2 | type Primitives = { 3 | [E in (typeof NODES)[number]]: boolean; 4 | }; 5 | -------------------------------------------------------------------------------- /tests/specs/references/typeof/typeofStrings.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | 8 | [] 9 | [] 10 | type Primitives = 11 | abstract member a: bool with get, set 12 | abstract member button: bool with get, set 13 | 14 | (***) 15 | #r "nuget: Fable.Core" 16 | #r "nuget: Glutinum.Types" 17 | (***) 18 | -------------------------------------------------------------------------------- /tests/specs/references/unionType/singleUnionResolved.d.ts: -------------------------------------------------------------------------------- 1 | export type ColorInfo = number | false; 2 | -------------------------------------------------------------------------------- /tests/specs/references/unionType/singleUnionResolved.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type ColorInfo = 8 | float 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/unionType/typeLiteral.d.ts: -------------------------------------------------------------------------------- 1 | type Content = { html: string } | { markdown: string } 2 | -------------------------------------------------------------------------------- /tests/specs/references/unionType/typeLiteral.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Content = 10 | abstract member html: string with get, set 11 | abstract member markdown: string with get, set 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/unionType/withArray.d.ts: -------------------------------------------------------------------------------- 1 | export type NumberOrNumberArray = number | Array 2 | -------------------------------------------------------------------------------- /tests/specs/references/unionType/withArray.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type NumberOrNumberArray = 8 | U2> 9 | 10 | (***) 11 | #r "nuget: Fable.Core" 12 | #r "nuget: Glutinum.Types" 13 | (***) 14 | -------------------------------------------------------------------------------- /tests/specs/references/unionType/withRecord.d.ts: -------------------------------------------------------------------------------- 1 | export type MyType = string | Record 2 | -------------------------------------------------------------------------------- /tests/specs/references/unionType/withRecord.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type MyType = 8 | U2 9 | 10 | module MyType = 11 | 12 | module U2 = 13 | 14 | [] 15 | [] 16 | type Case2 = 17 | [] 18 | abstract member Item: key: string -> float with get, set 19 | 20 | (***) 21 | #r "nuget: Fable.Core" 22 | #r "nuget: Glutinum.Types" 23 | (***) 24 | -------------------------------------------------------------------------------- /tests/specs/references/unionType/withTypeAliasDeclaration.d.ts: -------------------------------------------------------------------------------- 1 | export type ConfigurationScope = string 2 | 3 | export type MyType = ConfigurationScope | null 4 | -------------------------------------------------------------------------------- /tests/specs/references/unionType/withTypeAliasDeclaration.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | type ConfigurationScope = 8 | string 9 | 10 | type MyType = 11 | ConfigurationScope option 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /tests/specs/references/unionType/withTypeParameter.d.ts: -------------------------------------------------------------------------------- 1 | class MyType { 2 | a : TResult1 3 | } 4 | 5 | type T = TResult1 | MyType 6 | -------------------------------------------------------------------------------- /tests/specs/references/unknown/simple.d.ts: -------------------------------------------------------------------------------- 1 | export const version : unknown; 2 | -------------------------------------------------------------------------------- /tests/specs/references/unknown/simple.fsx: -------------------------------------------------------------------------------- 1 | module rec Glutinum 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open System 6 | 7 | [] 8 | [] 9 | type Exports = 10 | [] 11 | static member inline version: obj = nativeOnly 12 | 13 | (***) 14 | #r "nuget: Fable.Core" 15 | #r "nuget: Glutinum.Types" 16 | (***) 17 | -------------------------------------------------------------------------------- /vitest.workspace.ts: -------------------------------------------------------------------------------- 1 | export default [ 2 | 'tests/specs/generated/' 3 | ] 4 | --------------------------------------------------------------------------------