Update tslint to v6

This commit is contained in:
Dolan Miu
2020-08-01 17:58:16 +01:00
parent 69adbbc1c1
commit d18cfbc26f
12 changed files with 65 additions and 35 deletions

View File

@ -41,7 +41,7 @@ export interface ISectionOptions {
readonly size?: IPageSizeAttributes;
readonly margins?: IPageMarginAttributes;
readonly properties?: SectionPropertiesOptions;
readonly children: Array<Paragraph | Table | TableOfContents | HyperlinkRef>;
readonly children: (Paragraph | Table | TableOfContents | HyperlinkRef)[];
}
export class File {

View File

@ -2,7 +2,7 @@ import { Paragraph } from "./paragraph";
import { Table } from "./table";
export interface IHeaderOptions {
readonly children: Array<Paragraph | Table>;
readonly children: (Paragraph | Table)[];
}
export class Header {

View File

@ -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 {

View File

@ -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 {

View File

@ -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;

View File

@ -10,7 +10,7 @@ import { IRunPropertiesOptions, RunProperties } from "./properties";
import { Text } from "./run-components/text";
export interface IRunOptions extends IRunPropertiesOptions {
readonly children?: Array<Begin | FieldInstruction | Separate | End | PageNumber | FootnoteReferenceRun | string>;
readonly children?: (Begin | FieldInstruction | Separate | End | PageNumber | FootnoteReferenceRun | string)[];
readonly text?: string;
}

View File

@ -9,7 +9,7 @@ export interface IStylesOptions {
readonly initialStyles?: BaseXmlComponent;
readonly paragraphStyles?: IParagraphStyleOptions[];
readonly characterStyles?: ICharacterStyleOptions[];
readonly importedStyles?: Array<XmlComponent | ParagraphStyle | CharacterStyle | ImportedXmlComponent>;
readonly importedStyles?: (XmlComponent | ParagraphStyle | CharacterStyle | ImportedXmlComponent)[];
}
export class Styles extends XmlComponent {

View File

@ -44,7 +44,7 @@ export interface ITableCellOptions {
readonly color: string;
};
};
readonly children: Array<Paragraph | Table>;
readonly children: (Paragraph | Table)[];
}
export class TableCell extends XmlComponent {

View File

@ -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<BaseXmlComponent | string | any>;
protected root: (BaseXmlComponent | string | any)[];
constructor(rootKey: string) {
super(rootKey);