11import Util = require( "../Util" ) ;
2+ import XmlDom = require( "../XmlDom" ) ;
23import Drawing = require( "./Drawing" ) ;
4+ import Drawings = require( "../Drawings" ) ;
35
46class Picture {
57 static Cctor = ( function ( ) {
68 var thisProto = Picture . prototype ;
7- Picture . prototype = < any > new Drawing ( ) ;
9+ Picture . prototype = new ( < any > Drawing ) ( ) ;
810 Object . assign ( Picture . prototype , thisProto ) ;
911 } ( ) ) ;
1012
11- anchor : any ;
13+ anchor : Drawing . AnchorLike ;
1214 description : string ;
1315 fill : any ;
1416 id : string ;
1517 media : any ;
16- mediaData : { rId : string ; fileName : string ; } ;
18+ mediaData : { rId ?: string ; id : string ; fileName : string ; } ;
1719 pictureId : number ;
1820
1921
@@ -26,7 +28,7 @@ class Picture {
2628 }
2729
2830
29- public setMedia ( mediaRef : { rId : string ; fileName : string ; [ id : string ] : any } ) {
31+ public setMedia ( mediaRef : { rId ?: string ; id : string ; fileName : string ; [ id : string ] : any } ) {
3032 this . mediaData = mediaRef ;
3133 }
3234
@@ -51,7 +53,7 @@ class Picture {
5153 }
5254
5355
54- public getMediaData ( ) {
56+ public getMediaData ( ) : { id : string ; schema ?: string ; } {
5557 return this . mediaData ;
5658 }
5759
@@ -61,7 +63,7 @@ class Picture {
6163 }
6264
6365
64- public toXML ( xmlDoc : XMLDocument ) {
66+ public toXML ( xmlDoc : XmlDom ) : XmlDom . NodeBase {
6567 var pictureNode = Util . createElement ( xmlDoc , "xdr:pic" ) ;
6668
6769 var nonVisibleProperties = Util . createElement ( xmlDoc , "xdr:nvPicPr" ) ;
@@ -128,4 +130,5 @@ class Picture {
128130
129131}
130132
131- export = < { new ( ) : Picture & Drawing } > < any > Picture ;
133+ interface PictureDrawing extends Picture , Drawing , Drawings . Drawing { }
134+ export = < { new ( ) : PictureDrawing } > < any > Picture ;
0 commit comments