Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

ModuleDefinition support #4

Open
skyne98 opened this issue Jul 28, 2018 · 4 comments
Open

ModuleDefinition support #4

skyne98 opened this issue Jul 28, 2018 · 4 comments

Comments

@skyne98
Copy link

skyne98 commented Jul 28, 2018

Hey! Trying to compile pixi and phaser definitions I stumbled upon unimplemented ModuleDefinition.

Any plans to support it soon? Any help needed?

@kjpou1
Copy link
Contributor

kjpou1 commented Oct 26, 2018

Hello

Have been away on other priorities but can look into it. All help is greatly needed and appreciated just let me know what you would like to do and ask questions here.

Have not looked at ModuleDefinition but we can look at it together if you would like. That way we can improve the generator and target the specifics that you would like.

Thank you for the interest in the project.

@liquidboy
Copy link

liquidboy commented Dec 22, 2018

Just to add more detail to this issue ...

The offending line in the pixi.js.d.ts is below

declare module 'pixi.js' { export = PIXI; }

error from TsToCSharp:

Error: Unknown statement kind 'ModuleDeclaration'
at visitStatement (E:\Source\Github\mono\TsToCSharp\dist\TsToCSharpGenerator.js:41:19)
at node.getStatements.forEach.statement (E:\Source\Github\mono\TsToCSharp\dist\TsToCSharpGenerator.js:29:59)
at Array.forEach ()
at visitStatements (E:\Source\Github\mono\TsToCSharp\dist\TsToCSharpGenerator.js:29:26)
at Object.TsToCSharpGenerator (E:\Source\Github\mono\TsToCSharp\dist\TsToCSharpGenerator.js:14:5)
at sfs.forEach.astSourceFile (E:\Source\Github\mono\TsToCSharp\dist\TStoCSharp.js:38:60)
at Array.forEach ()
at genOptions.fileList.forEach.fileName (E:\Source\Github\mono\TsToCSharp\dist\TStoCSharp.js:37:21)
at Array.forEach ()
at Function.main (E:\Source\Github\mono\TsToCSharp\dist\TStoCSharp.js:31:33)

ref : pixijs/pixi-typescript

@liquidboy
Copy link

liquidboy commented Dec 22, 2018

What would this TS translate to in the C# world ? A singleton instance of the PIXI class ?

i see from the TS documentation

The export = syntax specifies a single object that is exported from the module. This can be a class, interface, namespace, function, or enum.

When exporting a module using export =, TypeScript-specific import module = require("module") must be used to import the module.

ref : modules export =

@liquidboy
Copy link

liquidboy commented Dec 22, 2018

Investigating a bit more i see we'll need to upgrade the package versions of

  1. ts-simple-ast
  2. typescript

Which will require fixing breaking changes ...

Once we have the latest of those supporting libs, the sast should support "Module" after which we just need to add support for Module in

  1. TsToCSharpGenerator

Then adding some tests ..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants