javascript - Typescript module export not work when import something -
i trying create powerbi custom visual , must use typescript that. i'm not familiar typescript. got 2 ts files under same namespace(i using vs code editor):
visual.ts
module powerbi.extensibility.visual { export class visual implements ivisual { private target: htmlelement; private updatecount: number; constructor(options: visualconstructoroptions) { console.log('visual constructor', options); this.target = options.element; this.updatecount = 0; } public update(options: visualupdateoptions) { console.log('visual update', options); console.log(testfunc()); $('#datepicker').datepicker(); this.target.innerhtml = `<p>update count: <em>${(this.updatecount++)}</em></p>`; } public destroy(): void { //todo: perform cleanup tasks here } } }
test.ts
import react=require('react'); import reactdom=require('react-dom'); module powerbi.extensibility.visual { export function testfunc():string{ return "test string"; } export class testclass{} }
problem when there no imports in test.ts can see , use exported function "testfunc()"(vs code see function) when add imports cant user function(also vs code don't recognize function)? there way have imports , use function?
Comments
Post a Comment