@@ -31,8 +31,8 @@ declare class TextNode {
3131 toString ( ) : string ;
3232}
3333export declare class XMLNode {
34- nodeName : string ;
35- children : XMLNode [ ] ;
34+ readonly nodeName : string ;
35+ readonly children : XMLNode [ ] ;
3636 nodeValue : string ;
3737 attributes : {
3838 [ key : string ] : any ;
@@ -83,21 +83,27 @@ export declare class TwoCellAnchor {
8383 toXML ( xmlDoc : XMLDOM , content : any ) : XMLNode ;
8484}
8585export interface AnchorOption {
86- /** X offset in EMU's */
86+ /** X offset in EMUs (English Metric Units) */
8787 x : number ;
88- /** Y offset in EMU's */
88+ /** Y offset in EMUs (English Metric Units) */
8989 y : number ;
90+ /** Optional: X offset as boolean (for cell anchoring) */
9091 xOff ?: boolean ;
92+ /** Optional: Y offset as boolean (for cell anchoring) */
9193 yOff ?: boolean ;
92- /** Width in EMU's */
93- height : number ;
94- /** Height in EMU's */
95- width : number ;
94+ /** Width in EMUs */
95+ width ?: number ;
96+ /** Height in EMUs */
97+ height ?: number ;
98+ /** Reference to parent Drawing instance */
9699 drawing ?: Drawing ;
97100}
98101export interface DualAnchorOption {
102+ /** Ending anchor position (AnchorOption) */
99103 to : AnchorOption ;
104+ /** Starting anchor position (AnchorOption) */
100105 from : AnchorOption ;
106+ /** Reference to parent Drawing instance */
101107 drawing ?: Drawing ;
102108}
103109/**
@@ -114,7 +120,7 @@ export declare class Drawing {
114120 * @param {Object } config Shorthand - pass the created anchor coords that can normally be used to construct it.
115121 * @returns {Anchor }
116122 */
117- createAnchor ( type : "absoluteAnchor" | "oneCellAnchor" | "twoCellAnchor" , config : any ) : AbsoluteAnchor | OneCellAnchor | TwoCellAnchor ;
123+ createAnchor ( type : "absoluteAnchor" | "oneCellAnchor" | "twoCellAnchor" , config : Partial < AnchorOption | DualAnchorOption > ) : AbsoluteAnchor | OneCellAnchor | TwoCellAnchor ;
118124}
119125/**
120126 *
@@ -157,6 +163,24 @@ export declare class AbsoluteAnchor {
157163export type ExcelColorStyle = string | {
158164 theme : number ;
159165} ;
166+ export type BorderStyle = {
167+ style ?: string ;
168+ color ?: string | {
169+ theme : number ;
170+ [ key : string ] : any ;
171+ } ;
172+ } ;
173+ export interface BorderInstruction {
174+ top ?: BorderStyle ;
175+ left ?: BorderStyle ;
176+ right ?: BorderStyle ;
177+ bottom ?: BorderStyle ;
178+ diagonal ?: BorderStyle ;
179+ outline ?: boolean ;
180+ diagonalUp ?: boolean ;
181+ diagonalDown ?: boolean ;
182+ id ?: number ;
183+ }
160184export interface ExcelAlignmentStyle {
161185 /** Horizontal alignment of cell content */
162186 horizontal ?: "center" | "fill" | "general" | "justify" | "left" | "right" ;
@@ -561,7 +585,12 @@ export type Relation = {
561585 [ id : string ] : {
562586 id : string ;
563587 schema : string ;
564- object : any ;
588+ object : {
589+ id : string ;
590+ target ?: string | null ;
591+ targetMode ?: string ;
592+ [ key : string ] : any ;
593+ } ;
565594 data ?: {
566595 id : number ;
567596 schema : string ;
@@ -586,9 +615,13 @@ export declare class RelationshipManager {
586615 } ;
587616 addRelation ( object : {
588617 id : string ;
618+ target ?: string | null ;
619+ targetMode ?: string ;
589620 } , type : keyof typeof Util . schemas ) : string ;
590621 getRelationshipId ( object : {
591622 id : string ;
623+ target ?: string | null ;
624+ targetMode ?: string ;
592625 } ) : string | null ;
593626 toXML ( ) : XMLDOM ;
594627}
@@ -675,40 +708,16 @@ declare class StyleSheet$1 {
675708 */
676709 createTableStyle ( instructions : any ) : void ;
677710 /**
678- * All params optional
679- * Expects: {
680- * top: {},
681- * left: {},
682- * right: {},
683- * bottom: {},
684- * diagonal: {},
685- * outline: boolean,
686- * diagonalUp: boolean,
687- * diagonalDown: boolean
688- * }
689- * Each border should follow:
711+ * All params optional. each border should follow:
690712 * {
691713 * style: styleString, http://www.schemacentral.com/sc/ooxml/t-ssml_ST_BorderStyle.html
692714 * color: ARBG color (requires the A, so for example FF006666)
693715 * }
694716 * @param {Object } border
695717 */
696- createBorderFormatter ( border : any ) : any ;
718+ createBorderFormatter ( border : BorderInstruction ) : BorderInstruction ;
697719 /**
698- * Supported font styles:
699- * bold
700- * italic
701- * underline (single, double, singleAccounting, doubleAccounting)
702- * size
703- * color
704- * fontName
705- * strike (strikethrough)
706- * outline (does this actually do anything?)
707- * shadow (does this actually do anything?)
708- * superscript
709- * subscript
710- *
711- * Color is a future goal - at the moment it's looking a bit complicated
720+ * Font styles, color is a future goal - at the moment it's looking a bit complicated
712721 * @param {Object } instructions
713722 */
714723 createFontStyle ( instructions : ExcelFontStyle ) : any ;
@@ -752,24 +761,36 @@ export declare class Table {
752761 id : string ;
753762 tableId : string ;
754763 displayName : string ;
755- dataCellStyle : any ;
764+ dataCellStyle : string | null ;
756765 dataDfxId : number | null ;
757766 headerRowBorderDxfId : number | null ;
758- headerRowCellStyle : any ;
767+ headerRowCellStyle : string | null ;
759768 headerRowCount : number ;
760769 headerRowDxfId : number | null ;
761770 insertRow : boolean ;
762771 insertRowShift : boolean ;
763- ref : any ;
772+ ref : [
773+ number [ ] ,
774+ number [ ]
775+ ] | null ;
764776 tableBorderDxfId : number | null ;
765777 totalsRowBorderDxfId : number | null ;
766- totalsRowCellStyle : any ;
778+ totalsRowCellStyle : string | null ;
767779 totalsRowCount : number ;
768780 totalsRowDxfId : number | null ;
769- tableColumns : any ;
770- autoFilter : any ;
771- sortState : any ;
772- styleInfo : any ;
781+ tableColumns : ExcelTableColumn [ ] ;
782+ autoFilter : [
783+ number [ ] ,
784+ number [ ]
785+ ] | null ;
786+ sortState : ExcelSortState | null ;
787+ styleInfo : {
788+ themeStyle ?: string ;
789+ showFirstColumn ?: boolean ;
790+ showLastColumn ?: boolean ;
791+ showColumnStripes ?: boolean ;
792+ showRowStripes ?: boolean ;
793+ } ;
773794 constructor ( config ?: any ) ;
774795 initialize ( config : any ) : void ;
775796 setReferenceRange ( start : number [ ] , end : number [ ] ) : void ;
@@ -881,21 +902,23 @@ export declare class Worksheet {
881902 name : string ;
882903 id : string ;
883904 _timezoneOffset : number ;
884- relations : any ;
905+ relations : RelationshipManager | null ;
885906 columnFormats : ExcelColumn [ ] ;
886907 data : ( number | string | boolean | Date | null | ExcelColumnMetadata ) [ ] [ ] ;
887908 mergedCells : string [ ] [ ] ;
888909 columns : ExcelColumn [ ] ;
889- sheetProtection : any ;
910+ sheetProtection : {
911+ exportXML : ( doc : XMLDOM ) => XMLNode ;
912+ } | false ;
890913 _headers : [
891- left ?: any ,
892- center ?: any ,
893- right ?: any
914+ left ?: string | CharType | any [ ] ,
915+ center ?: string | CharType | any [ ] ,
916+ right ?: string | CharType | any [ ]
894917 ] ;
895918 _footers : [
896- left ?: any ,
897- center ?: any ,
898- right ?: any
919+ left ?: string | CharType | any [ ] ,
920+ center ?: string | CharType | any [ ] ,
921+ right ?: string | CharType | any [ ]
899922 ] ;
900923 _tables : Table [ ] ;
901924 _drawings : Array < Table | Drawings > ;
@@ -923,20 +946,39 @@ export declare class Worksheet {
923946 * @returns {Object }
924947 */
925948 exportData ( ) : {
926- relations : any ;
949+ relations : {
950+ relations : {
951+ [ id : string ] : {
952+ id : string ;
953+ schema : string ;
954+ object : {
955+ id : string ;
956+ target ?: string | null ;
957+ targetMode ?: string ;
958+ [ key : string ] : any ;
959+ } ;
960+ data ?: {
961+ id : number ;
962+ schema : string ;
963+ object : any ;
964+ } ;
965+ } ;
966+ } ;
967+ lastId : number ;
968+ } | undefined ;
927969 columnFormats : ExcelColumn [ ] ;
928970 data : ( string | number | boolean | Date | ExcelColumnMetadata | null ) [ ] [ ] ;
929971 columns : ExcelColumn [ ] ;
930972 mergedCells : string [ ] [ ] ;
931973 _headers : [
932- left ?: any ,
933- center ?: any ,
934- right ?: any
974+ left ?: string | any [ ] | CharType | undefined ,
975+ center ?: string | any [ ] | CharType | undefined ,
976+ right ?: string | any [ ] | CharType | undefined
935977 ] ;
936978 _footers : [
937- left ?: any ,
938- center ?: any ,
939- right ?: any
979+ left ?: string | any [ ] | CharType | undefined ,
980+ center ?: string | any [ ] | CharType | undefined ,
981+ right ?: string | any [ ] | CharType | undefined
940982 ] ;
941983 _tables : Table [ ] ;
942984 _rowInstructions : any ;
@@ -1154,7 +1196,10 @@ export declare class Workbook {
11541196 media : {
11551197 [ filename : string ] : MediaMeta ;
11561198 } ;
1157- printTitles : any ;
1199+ printTitles ?: Record < string , {
1200+ top ?: number ;
1201+ left ?: string ;
1202+ } > ;
11581203 constructor ( ) ;
11591204 initialize ( ) : void ;
11601205 createWorksheet ( config ?: any ) : Worksheet ;
0 commit comments