javascript - How to extend js class from outside library in TypeScript / Using mojs in TypeScript -
i know how declare library ( example usage mojs):
declare var mojs:any;
but have problem extending it:
class myobject extends mojs.customshape { getshape () { return '..path' } };
i error:
type 'any' not constructor object type
i tried this:
declare var mojs:object{ customshape:any };
but no luck - wrong code.
so how can extend js library class in typescript?
ok, managed setting type objectconstructor
my code mojs:
declare var mojs: { customshape:objectconstructor, //here usage addshape:any, burst:any, timeline:any, shape:any, shapeswirl:any };
so objectconstructor can extend class without errors like:
class myobject extends mojs.customshape { getshape () { return '..path' } };
Comments
Post a Comment