Skip to content

Commit 09e2ba0

Browse files
committed
fix some TS compiler errors
1 parent 104b65f commit 09e2ba0

9 files changed

Lines changed: 23 additions & 22 deletions

File tree

app/elements/options/crm-app/crm-app.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4180,12 +4180,12 @@ namespace CRMAppElement {
41804180
mainObject[key] !== undefined &&
41814181
mainObject[key] !== null) {
41824182
if (Array.isArray(additions[key])) {
4183-
mainObject[key] = this.mergeArrays(mainObject[key], additions[key]);
4183+
mainObject[key] = this.mergeArrays(mainObject[key], (additions as any)[key]);
41844184
} else {
41854185
mainObject[key] = this.mergeObjects(mainObject[key], additions[key]);
41864186
}
41874187
} else {
4188-
mainObject[key] = (additions[key] as any) as T[keyof T];
4188+
mainObject[key] = (additions[key] as any) as any;
41894189
}
41904190
}
41914191
}
@@ -4218,12 +4218,12 @@ namespace CRMAppElement {
42184218
mainObject[key] !== undefined &&
42194219
mainObject[key] !== null) {
42204220
if (Array.isArray(additions[key])) {
4221-
this.mergeArraysWithoutAssignment(mainObject[key], additions[key]);
4221+
this.mergeArraysWithoutAssignment(mainObject[key], additions[key] as any);
42224222
} else {
4223-
this.mergeObjectsWithoutAssignment(mainObject[key], additions[key]);
4223+
this.mergeObjectsWithoutAssignment(mainObject[key], additions[key] as any);
42244224
}
42254225
} else {
4226-
mainObject[key] = additions[key];
4226+
mainObject[key] = additions[key] as any;
42274227
}
42284228
}
42294229
}

app/elements/options/edit-crm/edit-crm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ namespace EditCrmElement {
798798
for (let i = 0; i < props.length; i++) {
799799
const property = props[i];
800800
if (node[property] !== void 0) {
801-
target[property] = node[property];
801+
(target as any)[property] = node[property];
802802
}
803803
}
804804
}

app/elements/options/editpages/monaco-editor/monaco-editor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2257,12 +2257,12 @@ namespace MonacoEditorElement {
22572257
mainObject[key] !== undefined &&
22582258
mainObject[key] !== null) {
22592259
if (Array.isArray(additions[key])) {
2260-
mainObject[key] = this._mergeArrays(mainObject[key], additions[key]);
2260+
mainObject[key] = this._mergeArrays(mainObject[key], additions[key] as any);
22612261
} else {
2262-
mainObject[key] = this._mergeObjects(mainObject[key], additions[key]);
2262+
mainObject[key] = this._mergeObjects(mainObject[key], additions[key] as any);
22632263
}
22642264
} else {
2265-
mainObject[key] = (additions[key] as any) as T[keyof T];
2265+
mainObject[key] = (additions[key] as any) as any;
22662266
}
22672267
}
22682268
}

app/elements/options/node-edit-behavior/node-edit-behavior.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// <reference path="../../elements.d.ts" />
1+
/// <reference path="../../elements.d.ts" />
22

33
import { CodeEditBehaviorScriptInstance, CodeEditBehaviorStylesheetInstance, CodeEditBehavior } from "../editpages/code-edit-pages/code-edit-behavior";
44
import { DividerEdit } from '../editpages/divider-edit/divider-edit';
@@ -406,7 +406,7 @@ namespace NodeEditBehaviorNamespace {
406406
delete item.children;
407407
} else {
408408
item[prevType + 'Val' as ('menuVal'|'linkVal'|'scriptVal'|'stylesheetVal')] =
409-
item.value;
409+
item.value as any;
410410
}
411411
item.type = this.item.type = type;
412412
if (type === 'menu') {
@@ -555,6 +555,7 @@ namespace NodeEditBehaviorNamespace {
555555

556556
static _init(this: NodeEditBehaviorInstance) {
557557
this.newSettings = JSON.parse(JSON.stringify(this.item));
558+
console.log('Setting new settings to', this.newSettings);
558559
window.crmEditPage.nodeInfo = this.newSettings.nodeInfo;
559560
this.assignContentTypeSelectedValues();
560561
setTimeout(() => {

app/elements/options/type-switcher/type-switcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ namespace TypeSwitcherElement {
200200
delete item.children;
201201
} else {
202202
item[prevType + 'Val' as ('menuVal'|'linkVal'|'scriptVal'|'stylesheetVal')] =
203-
item.value;
203+
item.value as any;
204204
}
205205
item.type = type;
206206
if (type === 'menu') {

app/js/background/crmapifunctions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export namespace CRMAPIFunctions.contextMenuItem {
6969

7070
for (const key in override) {
7171
const overrideKey = key as keyof ContextMenuOverrides;
72-
destination[overrideKey] = override[overrideKey];
72+
(destination as any)[overrideKey] = override[overrideKey];
7373
}
7474

7575
const contextmenuId = modules.crmValues.contextMenuIds.get(nodeId);

app/js/background/global.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ export namespace Global {
130130
mainObject[key] !== undefined &&
131131
mainObject[key] !== null) {
132132
if (Array.isArray(additions[key])) {
133-
mainObject[key] = this.mergeArrays(mainObject[key], additions[key]);
133+
mainObject[key] = this.mergeArrays(mainObject[key], additions[key] as any);
134134
} else {
135-
mainObject[key] = this.mergeObjects(mainObject[key], additions[key]);
135+
mainObject[key] = this.mergeObjects(mainObject[key], additions[key] as any);
136136
}
137137
} else {
138-
mainObject[key] = additions[key];
138+
mainObject[key] = additions[key] as any;
139139
}
140140
}
141141
}

app/js/contentscripts/contentscript.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
declare const browserAPI: browserAPI;
1+
declare const browserAPI: browserAPI;
22

33
(() => {
44
function hacksecuteScript(script: string) {
@@ -104,7 +104,7 @@ declare const browserAPI: browserAPI;
104104
if (CONTEXT_MENU_EVENT_KEYS.indexOf(key) !== -1) {
105105
const pointerKey = key as keyof MouseEvent;
106106
if (pointerKey !== 'button') {
107-
responseObj[pointerKey] = lastContextmenuCall[pointerKey];
107+
(responseObj as any)[pointerKey] = lastContextmenuCall[pointerKey];
108108
}
109109
}
110110
}

app/js/crmapi.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3787,8 +3787,8 @@ export type CRMAPIMessage = {
37873787
hold && length--;
37883788
let dataChild: T|U = data;
37893789
for (let i = 0; i < length; i++) {
3790-
if (!(dataChild as T)[path[i]] && (i + 1) !== length) {
3791-
(dataChild as T)[path[i]] = {} as T|U;
3790+
if (!(dataChild as T)[path[i] as keyof T] && (i + 1) !== length) {
3791+
(dataChild as T)[path[i] as any] = {} as T|U;
37923792
}
37933793
dataChild = (dataChild as T)[path[i]];
37943794
}
@@ -3830,12 +3830,12 @@ export type CRMAPIMessage = {
38303830
if (typeof additions[key] === 'object' &&
38313831
key in mainObject) {
38323832
if (Array.isArray(additions[key])) {
3833-
mainObject[key] = this.mergeArrays(mainObject[key], additions[key]);
3833+
mainObject[key] = this.mergeArrays(mainObject[key], additions[key] as any);
38343834
} else {
38353835
mainObject[key] = this.mergeObjects(mainObject[key], additions[key] as any);
38363836
}
38373837
} else {
3838-
mainObject[key] = additions[key]
3838+
mainObject[key] = additions[key] as any;
38393839
}
38403840
}
38413841
}

0 commit comments

Comments
 (0)