Skip to content

Commit 9c9c78d

Browse files
committed
chore(types): fixes declarations
1 parent a0eb2c7 commit 9c9c78d

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

src/classes/slide.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export class Slide implements ISlide {
178178
*/
179179
modifyElement(
180180
selector: string,
181-
callback: ShapeModificationCallback | ShapeModificationCallback[] | Function | Function[],
181+
callback: ShapeModificationCallback | ShapeModificationCallback[],
182182
): this {
183183
const presName = this.sourceTemplate.name;
184184
const slideNumber = this.sourceNumber;
@@ -204,7 +204,7 @@ export class Slide implements ISlide {
204204
presName: string,
205205
slideNumber: number,
206206
selector: string,
207-
callback?: ShapeModificationCallback | ShapeModificationCallback[] | Function | Function[],
207+
callback?: ShapeModificationCallback | ShapeModificationCallback[],
208208
): this {
209209
return this.addElementToModificationsList(
210210
presName,
@@ -230,7 +230,7 @@ export class Slide implements ISlide {
230230
slideNumber: number,
231231
selector: string,
232232
mode: string,
233-
callback?: ShapeModificationCallback | ShapeModificationCallback[] | Function | Function[],
233+
callback?: ShapeModificationCallback | ShapeModificationCallback[],
234234
): this {
235235
this.importElements.push({
236236
presName,

src/helper/modify-chart-helper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default class ModifyChartHelper {
1414
* See `__tests__/modify-existing-chart.test.js`
1515
*/
1616
static setChartData = (data: ChartData) => (
17-
element: XMLDocument,
17+
element: XMLDocument | Element,
1818
chart: Document,
1919
workbook: Workbook,
2020
): void => {
@@ -39,7 +39,7 @@ export default class ModifyChartHelper {
3939
* See `__tests__/modify-chart-vertical-lines.test.js`
4040
*/
4141
static setChartVerticalLines = (data: ChartData) => (
42-
element: XMLDocument,
42+
element: XMLDocument | Element,
4343
chart: Document,
4444
workbook: Workbook,
4545
): void => {
@@ -68,7 +68,7 @@ export default class ModifyChartHelper {
6868
* See `__tests__/modify-chart-bubbles.test.js`
6969
*/
7070
static setChartBubbles = (data: ChartData) => (
71-
element: XMLDocument,
71+
element: XMLDocument | Element,
7272
chart: Document,
7373
workbook: Workbook,
7474
): void => {

src/helper/modify-shape-helper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default class ModifyShapeHelper {
44
/**
55
* Set solid fill of modified shape
66
*/
7-
static setSolidFill = (element: XMLDocument): void => {
7+
static setSolidFill = (element: XMLDocument | Element): void => {
88
element
99
.getElementsByTagName('a:solidFill')[0]
1010
.getElementsByTagName('a:schemeClr')[0]
@@ -14,15 +14,15 @@ export default class ModifyShapeHelper {
1414
/**
1515
* Set text content of modified shape
1616
*/
17-
static setText = (text: string) => (element: XMLDocument): void => {
17+
static setText = (text: string) => (element: XMLDocument | Element): void => {
1818
element.getElementsByTagName('a:t')[0].firstChild.textContent = text;
1919
};
2020

2121
/**
2222
* Set position and size of modified shape.
2323
*/
2424
static setPosition = (pos: ShapeCoordinates) => (
25-
element: XMLDocument,
25+
element: XMLDocument | Element,
2626
): void => {
2727
const map = {
2828
x: { tag: 'a:off', attribute: 'x' },

src/helper/modify-table-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default class ModifyTableHelper {
77
* @TODO: Set table data of modify table helper
88
*/
99
static setTableData = (data: TableData) => (
10-
element: Element,
10+
element: XMLDocument | Element,
1111
): void => {
1212
const modTable = new ModifyTable(element, data);
1313

src/modify/modify-table.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import { Modification, ModificationTags } from '../types/modify-types';
77
export class ModifyTable {
88
data: TableData;
99
table: ModifyXmlHelper;
10-
xml: Element;
10+
xml: XMLDocument | Element;
1111

1212
constructor(
13-
table: Element,
13+
table: XMLDocument | Element,
1414
data: TableData,
1515
) {
1616
this.data = data;

src/types/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export type ImportElement = {
4343
slideNumber: number;
4444
selector: string;
4545
mode: string;
46-
callback?: ShapeModificationCallback | ShapeModificationCallback[] | Function | Function[]
46+
callback?: ShapeModificationCallback | ShapeModificationCallback[]
4747
};
4848
export type ImportedElement = {
4949
mode: string;

0 commit comments

Comments
 (0)