Skip to content

Commit

Permalink
Merge pull request #64 from armanbilge/pr/href
Browse files Browse the repository at this point in the history
Add `HtmlAnchorElement#href`
  • Loading branch information
armanbilge authored Feb 18, 2023
2 parents 580aea0 + 8a34d2c commit 604b786
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dom/src/main/scala-3/fs2/dom/Dom.scala
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,15 @@ opaque type HtmlDocument[F[_]] <: Document[F] = dom.HTMLDocument

opaque type Element[F[_]] <: Node[F] = dom.Element
opaque type HtmlElement[F[_]] <: Element[F] = dom.HTMLElement

opaque type HtmlAnchorElement[F[_]] <: HtmlElement[F] = dom.HTMLAnchorElement
object HtmlAnchorElement {
extension [F[_]](anchor: HtmlAnchorElement[F]) {
def href(using Dom[F]): Ref[F, String] =
new WrappedRef(() => anchor.href, anchor.href = _)
}
}

opaque type HtmlAreaElement[F[_]] <: HtmlElement[F] = dom.HTMLAreaElement
opaque type HtmlAudioElement[F[_]] <: HtmlElement[F] = dom.HTMLAudioElement
opaque type HtmlBaseElement[F[_]] <: HtmlElement[F] = dom.HTMLBaseElement
Expand Down

0 comments on commit 604b786

Please sign in to comment.