Skip to content

Commit

Permalink
fix types errors TS1122 and TS8020 (Issue #672)
Browse files Browse the repository at this point in the history
  • Loading branch information
gitbrent committed May 14, 2020
1 parent 7d799de commit ccb06ba
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions dist/pptxgen.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pptxgen.bundle.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/pptxgen.cjs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* PptxGenJS 3.2.0-beta @ 2020-05-14T04:22:32.908Z */
/* PptxGenJS 3.2.0-beta @ 2020-05-14T04:49:24.406Z */
'use strict';

var JSZip = require('jszip');
Expand Down Expand Up @@ -5868,7 +5868,7 @@ function createSvgPngPreview(rel) {
|*| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|*| SOFTWARE.
\*/
var VERSION = '3.2.0-beta-20200513.2302';
var VERSION = '3.2.0-beta-20200513.2344';
var PptxGenJS = /** @class */ (function () {
function PptxGenJS() {
var _this = this;
Expand Down
4 changes: 2 additions & 2 deletions dist/pptxgen.es.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* PptxGenJS 3.2.0-beta @ 2020-05-14T04:22:32.914Z */
/* PptxGenJS 3.2.0-beta @ 2020-05-14T04:49:24.411Z */
import * as JSZip from 'jszip';

/**
Expand Down Expand Up @@ -5866,7 +5866,7 @@ function createSvgPngPreview(rel) {
|*| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|*| SOFTWARE.
\*/
var VERSION = '3.2.0-beta-20200513.2302';
var VERSION = '3.2.0-beta-20200513.2344';
var PptxGenJS = /** @class */ (function () {
function PptxGenJS() {
var _this = this;
Expand Down
4 changes: 2 additions & 2 deletions dist/pptxgen.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pptxgen.min.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/core-interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,14 +303,14 @@ export interface IChartMulti {
data: any[]
options: {}
}

// TODO: create TableToSlidesOpts
export interface ITableToSlidesOpts extends ITableOptions {
addImage?: { url: string; x: number; y: number; w?: number; h?: number }
addShape?: { shape: any; opts: {} }
addTable?: { rows: any[]; opts: {} }
addText?: { text: any[]; opts: {} }
//
_arrObjTabHeadRows?: [ITableToSlidesCell[]?]
_arrObjTabHeadRows?: ITableToSlidesCell[][]
addHeaderToEach?: boolean
autoPage?: boolean
autoPageCharWeight?: number // -1.0 to 1.0
Expand Down Expand Up @@ -546,7 +546,7 @@ export interface ISlideObject {
// text
text?: string | IText[]
// table
arrTabRows?: [ITableCell[]?]
arrTabRows?: ITableCell[][]
// chart
chartRid?: number
// image:
Expand Down
2 changes: 1 addition & 1 deletion src/gen-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ export function addTableDefinition(

// STEP 2: Transform `tableRows` into well-formatted ITableCell's
// tableRows can be object or plain text array: `[{text:'cell 1'}, {text:'cell 2', options:{color:'ff0000'}}]` | `["cell 1", "cell 2"]`
let arrRows: [ITableCell[]?] = []
let arrRows: ITableCell[][] = []
tableRows.forEach(row => {
let newRow: ITableCell[] = []

Expand Down
2 changes: 1 addition & 1 deletion src/gen-tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function parseTextToLines(cell: ITableCell, colWidth: number): string[] {
* @return {TableRowSlide[]} array of table rows
*/
export function getSlidesForTableRows(
tableRows: [ITableToSlidesCell[]?] = [],
tableRows: ITableToSlidesCell[][] = [],
tabOpts: ITableToSlidesOpts = {},
presLayout: ILayout,
masterSlide: ISlideLayout
Expand Down
2 changes: 1 addition & 1 deletion src/pptxgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ import * as genMedia from './gen-media'
import * as genTable from './gen-tables'
import * as genXml from './gen-xml'

const VERSION = '3.2.0-beta-20200513.2302'
const VERSION = '3.2.0-beta-20200513.2344'

export default class PptxGenJS implements IPresentation {
// Property getters/setters
Expand Down
4 changes: 2 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ declare namespace PptxGenJS {
text: any[]
opts: {}
}
_arrObjTabHeadRows?: [ITableToSlidesCell[]?] // TODO: split off into internal library Iface and remove from here
_arrObjTabHeadRows?: ITableToSlidesCell[][]
addHeaderToEach?: boolean
autoPage?: boolean
autoPageCharWeight?: number
Expand Down Expand Up @@ -958,7 +958,7 @@ declare namespace PptxGenJS {
type: SLIDE_OBJECT_TYPES
options?: IObjectOptions
text?: string | IText[]
arrTabRows?: [TableCell[]?] // TODO: remove "?" it generates tslint/ts TS8020 (Issue #672)
arrTabRows?: TableCell[][]
chartRid?: number
image?: string
imageRid?: number
Expand Down

0 comments on commit ccb06ba

Please # to comment.