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

Support modules #10

Closed
Bartvds opened this issue Feb 1, 2014 · 2 comments
Closed

Support modules #10

Bartvds opened this issue Feb 1, 2014 · 2 comments
Assignees

Comments

@Bartvds
Copy link
Contributor

Bartvds commented Feb 1, 2014

I have most code in modules (like a namespace)

module git {
    export interface TreeElem {
        sha:string;
        path:string;
        // ..
    }
}

// other file
var elem:git.TreeElem  = ....

I believe TypeScript does it too.

module TypeScript {
    export class LanguageWidget {
        // ..
    }
}

// other file
var instance = new TypeScript.LanguageWidget();

I would like to export these somehow. They can even be levels deeper nested (like packages in Java or AS3), sometimes they are used with export keyword.

// Export simply as dot seperated name (like in the code)?
{
   "$ref" = "#/definitions/TypeScript.LanguageWidget"
}
// Or maybe forward slashes (unsafe maybe)?
{
   "$ref" = "#/definitions/TypeScript/LanguageWidget"
}
@Bartvds
Copy link
Contributor Author

Bartvds commented Feb 1, 2014

Nice, looks very promising.

I see a few issues: I left a disabled unit test with my PR #12

If you enable it and run grunt you'll see the id's are not absolute, this could create collisions if you'd have difference modules with same members.

Core types should be simplified I guess (number).

@lbovet
Copy link
Owner

lbovet commented Feb 2, 2014

I fixed both issues, all tests are uncommented (included the class-single one, to support class declarations). We've had a productive week-end!

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

No branches or pull requests

2 participants