[MM-57348] Support notification metrics from the Desktop App client (#2998)
* [MM-57348] Support notification metrics from the Desktop App client * Add timeout in case promise never resolves
This commit is contained in:
@@ -28,7 +28,7 @@ export type DesktopAPI = {
|
||||
) => void) => () => void;
|
||||
|
||||
// Unreads/mentions/notifications
|
||||
sendNotification: (title: string, body: string, channelId: string, teamId: string, url: string, silent: boolean, soundName: string) => void;
|
||||
sendNotification: (title: string, body: string, channelId: string, teamId: string, url: string, silent: boolean, soundName: string) => Promise<{result: string; reason?: string; data?: string}>;
|
||||
onNotificationClicked: (listener: (channelId: string, teamId: string, url: string) => void) => () => void;
|
||||
setUnreadsAndMentions: (isUnread: boolean, mentionCount: number) => void;
|
||||
|
||||
|
14
api-types/lib/index.d.ts
vendored
14
api-types/lib/index.d.ts
vendored
@@ -1,6 +1,4 @@
|
||||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
export declare type DesktopSourcesOptions = {
|
||||
export type DesktopSourcesOptions = {
|
||||
types: Array<'screen' | 'window'>;
|
||||
thumbnailSize?: {
|
||||
height: number;
|
||||
@@ -8,12 +6,12 @@ export declare type DesktopSourcesOptions = {
|
||||
};
|
||||
fetchWindowIcons?: boolean;
|
||||
};
|
||||
export declare type DesktopCaptureSource = {
|
||||
export type DesktopCaptureSource = {
|
||||
id: string;
|
||||
name: string;
|
||||
thumbnailURL: string;
|
||||
};
|
||||
export declare type DesktopAPI = {
|
||||
export type DesktopAPI = {
|
||||
isDev: () => Promise<boolean>;
|
||||
getAppInfo: () => Promise<{
|
||||
name: string;
|
||||
@@ -22,7 +20,11 @@ export declare type DesktopAPI = {
|
||||
reactAppInitialized: () => void;
|
||||
setSessionExpired: (isExpired: boolean) => void;
|
||||
onUserActivityUpdate: (listener: (userIsActive: boolean, idleTime: number, isSystemEvent: boolean) => void) => () => void;
|
||||
sendNotification: (title: string, body: string, channelId: string, teamId: string, url: string, silent: boolean, soundName: string) => void;
|
||||
sendNotification: (title: string, body: string, channelId: string, teamId: string, url: string, silent: boolean, soundName: string) => Promise<{
|
||||
result: string;
|
||||
reason?: string;
|
||||
data?: string;
|
||||
}>;
|
||||
onNotificationClicked: (listener: (channelId: string, teamId: string, url: string) => void) => () => void;
|
||||
setUnreadsAndMentions: (isUnread: boolean, mentionCount: number) => void;
|
||||
requestBrowserHistoryStatus: () => Promise<{
|
||||
|
@@ -1,7 +1,4 @@
|
||||
"use strict";
|
||||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
'use strict';
|
||||
|
||||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mattermost/desktop-api",
|
||||
"version": "5.8.0-1",
|
||||
"version": "5.8.0-3",
|
||||
"description": "Shared types for the Desktop App API provided to the Web App",
|
||||
"keywords": [
|
||||
"mattermost"
|
||||
|
@@ -12,7 +12,8 @@
|
||||
"jsx": "react",
|
||||
"outDir": "./lib",
|
||||
"rootDir": ".",
|
||||
"composite": true
|
||||
"composite": true,
|
||||
"types": []
|
||||
},
|
||||
"include": [
|
||||
"./index.ts"
|
||||
|
Reference in New Issue
Block a user