Skip to content

Export function with public signature not allowed #341

@mwisnicki

Description

@mwisnicki

This is my sub-case of https://typescript.codeplex.com/workitem/1312.

Consider trivial export of function:

module foo {
    function bar() {}
    export var pub = bar;
}

Compiler will complain about exporting private type bar. I could type it explicitly as ()=>void but it doesn't scale to real world usage like wrapping functions with potentially complex, generic signatures:

module foo {
    function wrap<T extends Function>(f: T): T {
        /* complex wrapping */
        return f;
    }

    /* complex generic signature */
    function _bar<T>() {}

    export var bar = wrap(_bar);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions