Skip to content

dart: Cannot type DOM accesses #2770

@alexeagle

Description

@alexeagle

I'm adding return types as a first pass of adding a linter for better API completeness.

Many methods in the DOM interfaces, eg. *_dom_strategy.ts, dom_adapter.ts, cannot be typed because the dart_analyzer is configured to know that neither parse5 nor a browser might be present at runtime. However, leaving all these typed as any weakens our ability to use these APIs and get typical benefits of typing.

I'll leave the proper types commented out with a reference to this issue.

Related: @mprobst has a proposal to fix this (IIUC) with "DOM abstraction layer for Angular" https://docs.google.com/document/d/1VO8L2ZyVKTCGsO_JGZYwii3Owu5Lz0qwG35ApPL-TcY/edit#heading=h.66i8qgknkokg
Martin, please close as a dupe if there is already an issue tracking that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions