Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/ComponentRelay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
private lastStreamedItem?: DecryptedTransferPayload
private pendingSaveItems?: DecryptedTransferPayload[]
private pendingSaveTimeout?: NodeJS.Timeout
private pendingSaveParams?: any

Check warning on line 31 in lib/ComponentRelay.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
private messageHandler?: (event: any) => void

Check warning on line 32 in lib/ComponentRelay.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
private keyDownEventListener?: (event: KeyboardEvent) => void
private keyUpEventListener?: (event: KeyboardEvent) => void
private clickEventListener?: (event: MouseEvent) => void
Expand Down Expand Up @@ -288,7 +288,7 @@
* @param key The key for the data object.
* @returns `undefined` if the value for the key does not exist. Returns the stored value otherwise.
*/
public getComponentDataValueForKey(key: string): any {

Check warning on line 291 in lib/ComponentRelay.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
if (!this.component.data) {
return
}
Expand All @@ -300,7 +300,7 @@
* @param key The key for the data object.
* @param value The value to store under the specified key.
*/
public setComponentDataValueForKey(key: string, value: any): void {

Check warning on line 303 in lib/ComponentRelay.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type

Check warning on line 303 in lib/ComponentRelay.ts

View workflow job for this annotation

GitHub Actions / test

Argument 'value' should be typed with a non-any type
if (!this.component.data) {
throw new Error('The component has not been initialized.')
}
Expand All @@ -326,7 +326,7 @@
})
}

private postMessage(action: ComponentAction, data: MessageData, callback?: (...params: any) => void) {

Check warning on line 329 in lib/ComponentRelay.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
/**
* If the sessionKey is not set, we push the message to queue
* that will be processed later on.
Expand Down Expand Up @@ -367,7 +367,8 @@
}

Logger.info('Posting message:', postMessagePayload)
this.contentWindow.parent.postMessage(postMessagePayload, this.component.origin!)
const targetOrigin = this.component.origin && this.component.origin !== 'null' ? this.component.origin : '*'
this.contentWindow.parent.postMessage(postMessagePayload, targetOrigin)
}

private activateThemes(incomingUrls: string[] = []) {
Expand Down Expand Up @@ -466,8 +467,8 @@
* @param contentTypes A collection of Content Types.
* @param callback A callback to process the streamed items.
*/
public streamItems(contentTypes: ContentType[], callback: (data: any) => void): void {

Check warning on line 470 in lib/ComponentRelay.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
this.postMessage(ComponentAction.StreamItems, { content_types: contentTypes }, (data: any) => {

Check warning on line 471 in lib/ComponentRelay.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
callback(data.items)
})
}
Expand All @@ -476,7 +477,7 @@
* Streams the current Item in context.
* @param callback A callback to process the streamed item.
*/
public streamContextItem(callback: (data: any) => void): void {

Check warning on line 480 in lib/ComponentRelay.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
this.postMessage(ComponentAction.StreamContextItem, {}, (data) => {
const { item } = data
/**
Expand Down Expand Up @@ -504,7 +505,7 @@
* @param item The Item's payload content.
* @param callback The callback to process the created Item.
*/
public createItem(item: DecryptedTransferPayload, callback: (data: any) => void): void {

Check warning on line 508 in lib/ComponentRelay.ts

View workflow job for this annotation

GitHub Actions / test

Unexpected any. Specify a different type
this.postMessage(ComponentAction.CreateItem, { item: this.jsonObjectForItem(item) }, (data: any) => {
let { item } = data
/**
Expand Down
Loading