Skip to content

Commit

Permalink
updated ts defs to resolve TS1122 error (Issue #672)
Browse files Browse the repository at this point in the history
  • Loading branch information
gitbrent committed Feb 13, 2020
1 parent bbe566b commit e114b75
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/gen-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function createSlideObject(slideDef: ISlideMasterOptions, target: ISlideL
* ]
* }
*/
export function addChartDefinition(target: ISlide, type: CHART_NAME | IChartMulti[], data: [], opt: IChartOpts): object {
export function addChartDefinition(target: ISlide, type: CHART_NAME | IChartMulti[], data: any[], opt: IChartOpts): object {
function correctGridLineOptions(glOpts: OptsChartGridLine) {
if (!glOpts || glOpts.style === 'none') return
if (glOpts.size !== undefined && (isNaN(Number(glOpts.size)) || glOpts.size <= 0)) {
Expand Down
2 changes: 1 addition & 1 deletion src/slide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default class Slide {
* @param {IChartOpts} options - chart options
* @return {Slide} this Slide
*/
addChart(type: CHART_NAME | IChartMulti[], data: [], options?: IChartOpts): Slide {
addChart(type: CHART_NAME | IChartMulti[], data: any[], options?: IChartOpts): Slide {
// TODO: TODO-VERSION-4: Remove first arg - only take data and opts, with "type" required on opts
// Set `_type` on IChartOpts as its what is used as object is passed around
let optionsWithType: IChartOpts = options || {}
Expand Down
8 changes: 4 additions & 4 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ declare namespace PptxGenJS {
}
export interface IChartMulti {
type: CHART_NAME
data: []
data: any[]
options: {}
}
export interface ITableToSlidesOpts extends ITableOptions {
Expand All @@ -1057,7 +1057,7 @@ declare namespace PptxGenJS {
text: any[]
opts: {}
}
_arrObjTabHeadRows?: [ITableToSlidesCell[]?]
_arrObjTabHeadRows?: [ITableToSlidesCell[]?] // TODO: split off into internal library Iface and remove from here
addHeaderToEach?: boolean
autoPage?: boolean
autoPageCharWeight?: number
Expand Down Expand Up @@ -1296,7 +1296,7 @@ declare namespace PptxGenJS {
type: SLIDE_OBJECT_TYPES
options?: IObjectOptions
text?: string | IText[]
arrTabRows?: [ITableCell[]?]
arrTabRows?: [ITableCell[]?] // TODO: remove "?" it generates tslint/ts TS8020 (Issue #672)
chartRid?: number
image?: string
imageRid?: number
Expand Down Expand Up @@ -1382,7 +1382,7 @@ declare namespace PptxGenJS {
* @param {IChartOpts} options - chart options
* @return {Slide} this Slide
*/
addChart(type: CHART_NAME | IChartMulti[], data: [], options?: IChartOpts): Slide
addChart(type: CHART_NAME | IChartMulti[], data: any[], options?: IChartOpts): Slide
/**
* Add image to Slide
* @param {IImageOpts} options - image options
Expand Down

0 comments on commit e114b75

Please # to comment.