From aa5bf0e7a2cb84f065aa5b76ee75f8d29e8f127c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Tue, 21 Apr 2020 02:50:56 +0200 Subject: [PATCH] Improve usage of HTMLCollectionOf --- .../internal/ts/transforms/LibrarySpecific.scala | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/LibrarySpecific.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/LibrarySpecific.scala index 5ded25b232..8f737c0cb7 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/LibrarySpecific.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/LibrarySpecific.scala @@ -7,6 +7,17 @@ object LibrarySpecific { val libName: TsIdentLibrary } + object std extends Named { + override val libName = TsIdentLibrarySimple("std") + + override def enterTsDecl(t: TsTreeScope)(x: TsDecl): TsDecl = + x match { + case i @ TsDeclInterface(_, _, TsIdentSimple("HTMLCollectionOf"), _, _, _, _) => + i.copy(inheritance = Empty) + case other => other + } + } + object styledComponents extends Named { override val libName = TsIdentLibrarySimple("styled-components") @@ -197,7 +208,7 @@ object LibrarySpecific { } val patches: Map[TsIdentLibrary, Named] = - IArray(atUifabricFoundation, aMap, emberPolyfills, emotion, react, semanticUiReact, styledComponents) + IArray(atUifabricFoundation, aMap, emberPolyfills, emotion, react, semanticUiReact, std, styledComponents) .map(x => x.libName -> x) .toMap