From e114b75dada7bc1595859ab0a6898857aeb3b130 Mon Sep 17 00:00:00 2001 From: Brent Ely Date: Wed, 12 Feb 2020 23:31:04 -0600 Subject: [PATCH] updated ts defs to resolve TS1122 error (Issue #672) --- src/gen-objects.ts | 2 +- src/slide.ts | 2 +- types/index.d.ts | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gen-objects.ts b/src/gen-objects.ts index 88ad1c83b..b6c28447c 100644 --- a/src/gen-objects.ts +++ b/src/gen-objects.ts @@ -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)) { diff --git a/src/slide.ts b/src/slide.ts index 99780f23d..caca56320 100644 --- a/src/slide.ts +++ b/src/slide.ts @@ -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 || {} diff --git a/types/index.d.ts b/types/index.d.ts index 8ad86e20c..a3dbcab03 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1034,7 +1034,7 @@ declare namespace PptxGenJS { } export interface IChartMulti { type: CHART_NAME - data: [] + data: any[] options: {} } export interface ITableToSlidesOpts extends ITableOptions { @@ -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 @@ -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 @@ -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