mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-17 11:45:58 +08:00
Merge pull request #26579 from danielcompton/patch-1
intercom-web: Add onUnreadCountChange command
This commit is contained in:
24
types/intercom-web/index.d.ts
vendored
24
types/intercom-web/index.d.ts
vendored
@@ -21,7 +21,7 @@ declare namespace Intercom_ {
|
||||
activator?: string;
|
||||
};
|
||||
company?: {
|
||||
id: string|number,
|
||||
id: string | number,
|
||||
name: string,
|
||||
created_at: number,
|
||||
plan?: string,
|
||||
@@ -33,16 +33,17 @@ declare namespace Intercom_ {
|
||||
}
|
||||
|
||||
type IntercomCommand = 'boot'
|
||||
|'shutdown'
|
||||
|'update'
|
||||
|'hide'
|
||||
|'show'
|
||||
|'showMessages'
|
||||
|'showNewMessage'
|
||||
|'onHide'
|
||||
|'onShow'
|
||||
|'onActivatorClick'
|
||||
|'trackEvent';
|
||||
| 'shutdown'
|
||||
| 'update'
|
||||
| 'hide'
|
||||
| 'show'
|
||||
| 'showMessages'
|
||||
| 'showNewMessage'
|
||||
| 'onHide'
|
||||
| 'onShow'
|
||||
| 'onUnreadCountChange'
|
||||
| 'onActivatorClick'
|
||||
| 'trackEvent';
|
||||
|
||||
interface IntercomStatic {
|
||||
(command: 'boot', param: IntercomSettings): void;
|
||||
@@ -51,6 +52,7 @@ declare namespace Intercom_ {
|
||||
(command: 'showNewMessage', param?: string): void;
|
||||
(command: 'onHide' | 'onShow' | 'onActivatorClick', param?: () => void): void;
|
||||
(command: 'trackEvent', tag?: string, metadata?: any): void;
|
||||
(command: 'onUnreadCountChange', cb: (unreadCount: number) => void): void;
|
||||
(command: IntercomCommand, param1?: any, param2?: any): void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ Intercom('showMessages');
|
||||
Intercom('showNewMessage');
|
||||
Intercom('showNewMessage', 'pre-populated content');
|
||||
Intercom('onHide', () => { /* Do stuff */ });
|
||||
Intercom('onUnreadCountChange', (unreadCount: number) => { /* Do stuff */ });
|
||||
Intercom('onActivatorClick', () => { /* Do stuff */ });
|
||||
Intercom('trackEvent', 'invited-friend');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user