diff --git a/package-lock.json b/package-lock.json index 878af22c12..942a9ddcf6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,12 +5,12 @@ "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", - "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", "dev": true, "requires": { - "@babel/highlight": "^7.0.0" + "@babel/highlight": "^7.10.4" } }, "@babel/core": { @@ -246,13 +246,13 @@ } }, "@babel/highlight": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", - "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", "dev": true, "requires": { + "@babel/helper-validator-identifier": "^7.10.4", "chalk": "^2.0.0", - "esutils": "^2.0.2", "js-tokens": "^4.0.0" }, "dependencies": { @@ -7946,30 +7946,53 @@ } }, "tslib": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", - "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", "dev": true }, "tslint": { - "version": "5.18.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.18.0.tgz", - "integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==", + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz", + "integrity": "sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "builtin-modules": "^1.1.1", "chalk": "^2.3.0", "commander": "^2.12.1", - "diff": "^3.2.0", + "diff": "^4.0.1", "glob": "^7.1.1", "js-yaml": "^3.13.1", "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", + "mkdirp": "^0.5.3", "resolve": "^1.3.2", "semver": "^5.3.0", - "tslib": "^1.8.0", + "tslib": "^1.13.0", "tsutils": "^2.29.0" + }, + "dependencies": { + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + } } }, "tslint-immutable": { diff --git a/package.json b/package.json index 9e3756fcd6..32f24f72f8 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "shelljs": "^0.8.4", "sinon": "^9.0.2", "ts-node": "^8.10.2", - "tslint": "^5.11.0", + "tslint": "^6.1.3", "tslint-immutable": "^4.9.0", "typedoc": "^0.16.11", "typescript": "2.9.2", diff --git a/src/file/file.ts b/src/file/file.ts index 59af9fa7f7..270714ed17 100644 --- a/src/file/file.ts +++ b/src/file/file.ts @@ -41,7 +41,7 @@ export interface ISectionOptions { readonly size?: IPageSizeAttributes; readonly margins?: IPageMarginAttributes; readonly properties?: SectionPropertiesOptions; - readonly children: Array; + readonly children: (Paragraph | Table | TableOfContents | HyperlinkRef)[]; } export class File { diff --git a/src/file/header.ts b/src/file/header.ts index 05e227d9f8..5f59ae2bec 100644 --- a/src/file/header.ts +++ b/src/file/header.ts @@ -2,7 +2,7 @@ import { Paragraph } from "./paragraph"; import { Table } from "./table"; export interface IHeaderOptions { - readonly children: Array; + readonly children: (Paragraph | Table)[]; } export class Header { diff --git a/src/file/numbering/numbering.ts b/src/file/numbering/numbering.ts index b8747991d0..a02caf6bef 100644 --- a/src/file/numbering/numbering.ts +++ b/src/file/numbering/numbering.ts @@ -8,10 +8,10 @@ import { ILevelsOptions } from "./level"; import { ConcreteNumbering } from "./num"; export interface INumberingOptions { - readonly config: Array<{ + readonly config: { readonly levels: ILevelsOptions[]; readonly reference: string; - }>; + }[]; } export class Numbering extends XmlComponent { diff --git a/src/file/paragraph/paragraph.ts b/src/file/paragraph/paragraph.ts index a593f6f0ab..e1db0ec910 100644 --- a/src/file/paragraph/paragraph.ts +++ b/src/file/paragraph/paragraph.ts @@ -10,9 +10,16 @@ import { PictureRun, Run, SequentialIdentifier, SymbolRun, TextRun } from "./run export interface IParagraphOptions extends IParagraphPropertiesOptions { readonly text?: string; - readonly children?: Array< - TextRun | PictureRun | SymbolRun | Bookmark | PageBreak | SequentialIdentifier | FootnoteReferenceRun | HyperlinkRef - >; + readonly children?: ( + | TextRun + | PictureRun + | SymbolRun + | Bookmark + | PageBreak + | SequentialIdentifier + | FootnoteReferenceRun + | HyperlinkRef + )[]; } export class Paragraph extends XmlComponent { diff --git a/src/file/paragraph/properties.ts b/src/file/paragraph/properties.ts index 52afbd1dd8..af97e2c684 100644 --- a/src/file/paragraph/properties.ts +++ b/src/file/paragraph/properties.ts @@ -30,11 +30,11 @@ export interface IParagraphPropertiesOptions extends IParagraphStylePropertiesOp readonly heading?: HeadingLevel; readonly bidirectional?: boolean; readonly pageBreakBefore?: boolean; - readonly tabStops?: Array<{ + readonly tabStops?: { readonly position: number | TabStopPosition; readonly type: TabStopType; readonly leader?: LeaderType; - }>; + }[]; readonly style?: string; readonly bullet?: { readonly level: number; diff --git a/src/file/paragraph/run/run.ts b/src/file/paragraph/run/run.ts index 8b5fb0ddd3..bf7903e35e 100644 --- a/src/file/paragraph/run/run.ts +++ b/src/file/paragraph/run/run.ts @@ -10,7 +10,7 @@ import { IRunPropertiesOptions, RunProperties } from "./properties"; import { Text } from "./run-components/text"; export interface IRunOptions extends IRunPropertiesOptions { - readonly children?: Array; + readonly children?: (Begin | FieldInstruction | Separate | End | PageNumber | FootnoteReferenceRun | string)[]; readonly text?: string; } diff --git a/src/file/styles/styles.ts b/src/file/styles/styles.ts index 064411e419..45efe9f784 100644 --- a/src/file/styles/styles.ts +++ b/src/file/styles/styles.ts @@ -9,7 +9,7 @@ export interface IStylesOptions { readonly initialStyles?: BaseXmlComponent; readonly paragraphStyles?: IParagraphStyleOptions[]; readonly characterStyles?: ICharacterStyleOptions[]; - readonly importedStyles?: Array; + readonly importedStyles?: (XmlComponent | ParagraphStyle | CharacterStyle | ImportedXmlComponent)[]; } export class Styles extends XmlComponent { diff --git a/src/file/table/table-cell/table-cell.ts b/src/file/table/table-cell/table-cell.ts index babd0031ff..6fbd748cf5 100644 --- a/src/file/table/table-cell/table-cell.ts +++ b/src/file/table/table-cell/table-cell.ts @@ -44,7 +44,7 @@ export interface ITableCellOptions { readonly color: string; }; }; - readonly children: Array; + readonly children: (Paragraph | Table)[]; } export class TableCell extends XmlComponent { diff --git a/src/file/xml-components/xml-component.ts b/src/file/xml-components/xml-component.ts index dfe3800b96..b06f73b930 100644 --- a/src/file/xml-components/xml-component.ts +++ b/src/file/xml-components/xml-component.ts @@ -6,7 +6,7 @@ export const EMPTY_OBJECT = Object.seal({}); export abstract class XmlComponent extends BaseXmlComponent { // tslint:disable-next-line:readonly-keyword no-any - protected root: Array; + protected root: (BaseXmlComponent | string | any)[]; constructor(rootKey: string) { super(rootKey); diff --git a/src/import-dotx/import-dotx.ts b/src/import-dotx/import-dotx.ts index 2b1261efe7..d8d5d1190c 100644 --- a/src/import-dotx/import-dotx.ts +++ b/src/import-dotx/import-dotx.ts @@ -17,8 +17,8 @@ const schemeToType = { }; interface IDocumentRefs { - readonly headers: Array<{ readonly id: number; readonly type: HeaderReferenceType }>; - readonly footers: Array<{ readonly id: number; readonly type: FooterReferenceType }>; + readonly headers: { readonly id: number; readonly type: HeaderReferenceType }[]; + readonly footers: { readonly id: number; readonly type: FooterReferenceType }[]; } enum RelationshipType { @@ -99,7 +99,7 @@ export class ImportDotx { return { type: reference.type, footer: wrapper }; }) - .filter((x) => !!x) as Array>; + .filter((x) => !!x) as Promise[]; return Promise.all(result); } @@ -134,7 +134,7 @@ export class ImportDotx { return { type: reference.type, header: wrapper }; }) - .filter((x) => !!x) as Array>; + .filter((x) => !!x) as Promise[]; return Promise.all(result); }