Skip to content

Add object type support #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 3, 2017
Merged

Add object type support #58

merged 1 commit into from
Dec 3, 2017

Conversation

mzp
Copy link
Contributor

@mzp mzp commented Dec 3, 2017

Some type definition of major library(e.g. lodash, jQuery) use extends object.

at<T extends object>(
            object: T | null | undefined,
            ...props: Array<Many<keyof T>>
        ): Array<T[keyof T]>;

Because current scala-js-ts-importer converts object to object, converted file is not compilable.

📝 Example

Source

declare interface LoDashStatic {
  at<T extends object>();
};

Current

trait LoDashStatic extends js.Object {
  def at[T <: `object`](): js.Dynamic = js.native
}

After merging this pull request

trait LoDashStatic extends js.Object {
  def at[T <: js.Object](): js.Dynamic = js.native
}

@sjrd sjrd merged commit c2a5499 into sjrd:master Dec 3, 2017
@mzp mzp deleted the object branch December 4, 2017 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants