I’ve been playing around with exporting typescript...
# javascript
s
I’ve been playing around with exporting typescript definitions for a JS library using 1.4-M2. I handed the generated typescript definition over to someone on my JS team, but he told me it wouldn’t work because the typescript definition doesn’t have any export statements in the typescript definition. This would be a fairly major bug in typescript definition generation, so it seems unlikely and that my team is missing something, but other typescript definitions I look at all export what’s usable. Can anyone confirm if this is a bug? @Svyatoslav Kuzmich [JB] ^^
Here’s my generated definition:
Copy code
declare namespace lib_communities_shared {
    type Nullable<T> = T | null | undefined
    namespace com.rallyhealth.feature.community {
        class DataClassTest {
            constructor(a: string, b: Nullable<number>)
            static DataClassTest_init_$Create$(a: string, b: Nullable<number>, $mask0: number, $marker: Nullable<any /*Class kotlin.js.DefaultConstructorMarker with kind: OBJECT*/>): com.rallyhealth.feature.community.DataClassTest
            readonly a: string;
            readonly b: Nullable<number>;
            component1(): string
            component2(): Nullable<number>
            copy(a: string, b: Nullable<number>): com.rallyhealth.feature.community.DataClassTest
            toString(): string
            hashCode(): number
            equals(other: Nullable<any>): boolean
        }
        function copy(_this_: com.rallyhealth.feature.community.DataClassTest, obj: com.rallyhealth.feature.community.DataClassTestCopy): com.rallyhealth.feature.community.DataClassTest
    }
}
s
Yes, TS export for CommonJS and UMD modules is not implemented yet. TS export currently generates d.ts for plain IIFE-like module kind.