如:扩展LayaAir的Vector3,加入一个say方法
LayaAirExtensions.d.ts
declare module Laya{
interface Vector3 {
say(msg:string):void;
}
}
//或
/*declare module laya.d3.math{
interface Vector3{
say(msg:string):void;
}
}*/
let v3=new Laya.Vector3();
v3.say("hello");//不报错