Skip to content
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

[TypeScript] Added some interface annotations #3178

Merged
merged 1 commit into from Sep 17, 2022
Merged

Conversation

ncave
Copy link
Collaborator

@ncave ncave commented Sep 17, 2022

  • Added some interface annotations.
  • Added attached member return type.

Need to fix Python. Fixed, thanks @dbrattli

@ncave ncave marked this pull request as draft September 17, 2022 01:19
@dbrattli dbrattli reopened this Sep 17, 2022
@dbrattli
Copy link
Collaborator

Sorry, didn't know that "Fixes #" comments could close PRs as well 😬 Anyways, Python seems to be fixed now 😄

@dbrattli
Copy link
Collaborator

@ncave Not sure it's relevant for TS or if you have already fixed it, but I had this issue in Python with interfaces where types of imported interfaces disappeared, since such interfaces are erased. Thus for code such as:

[<Import("Logger", "structlog")>]
type Logger =
    abstract msg: msg: string * [<ParamArray>] args: obj[] -> unit

type IExports =
    abstract getLogger : unit -> Logger

[<ImportAll("structlog")>]
let structlog : IExports = nativeOnly

let logger = structlog.getLogger()

Then the type Logger would end up being undefined (since it's erased). So I had to look it up again (in Fable2Python.fs) and import the imported type myself https://github.com/fable-compiler/Fable/pull/3175/files

@ncave
Copy link
Collaborator Author

ncave commented Sep 17, 2022

@dbrattli Thanks for fixing the build! I couldn't figure out what was the problem in pyproject.toml, it looked ok.

Not sure it's relevant for TS or if you have already fixed it, but I had this issue in Python with interfaces where types of imported interfaces disappeared, since such interfaces are erased

Thanks, I'll keep it in mind.

@ncave ncave marked this pull request as ready for review September 17, 2022 06:02
@ncave ncave merged commit 121722e into fable-compiler:main Sep 17, 2022
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.

None yet

2 participants