Skip to content

Add support and create Dart representation for primitive JS types not currently supported in Dart #380

@nikeokoronkwo

Description

@nikeokoronkwo

This issue is for adding support for generating certain declarations for types found in the global scope for JS code, but not supported directly in dart:js_interop at the moment. These declarations may also be followed by helpers to help convert them to similar Dart types where possible.

Some of these types are native to JS and some are supported by TS. For those supported by JS natively, we will need to create respective external calls, while those supported by TS will need to have representations that match the compilation result in JS:

  • Iterable and Iterator: See dart-lang/sdk#60457
  • Generator: This can be converted to/from an Iterable
  • AsyncGenerator: This can be converted to/from a Stream and be used with await for
  • Record: TS Native, also mapped with Mapped Type
  • Map
  • Set
  • The Object singleton
  • Error: There are not may instances of this standalone
  • URL: This can be converted to/from a Dart Uri
  • Regex: We should support literal regexes, and be able to convert to/from dart Regex
  • Interop Gen: Support Tuples #433
  • WeakMap
  • WeakSet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions