diff --git a/lib/globals.d.ts b/lib/globals.d.ts new file mode 100644 index 0000000..29a05d7 --- /dev/null +++ b/lib/globals.d.ts @@ -0,0 +1,17 @@ +/* + * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +declare global { + interface Window { + _notify_push_listeners: { [event: string]: ((string, any) => void)[] }, + _notify_push_ws: WebSocket | null | true, + _notify_push_online: boolean, + _notify_push_available: boolean, + _notify_push_error_count: number, + _notify_push_ready: boolean, + } +} + +export {} diff --git a/lib/index.ts b/lib/index.ts index b8df635..73d9737 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -1,22 +1,12 @@ -/** +/* * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ + import {getCapabilities} from '@nextcloud/capabilities'; import axios from '@nextcloud/axios' import {subscribe} from '@nextcloud/event-bus' -declare global { - interface Window { - _notify_push_listeners: { [event: string]: ((string, any) => void)[] }, - _notify_push_ws: WebSocket | null | true, - _notify_push_online: boolean, - _notify_push_available: boolean, - _notify_push_error_count: number, - _notify_push_ready: boolean, - } -} - type NotifyPushOptions = { credentials?: { username: string,