feat(mixpanel): Update/add functions (#2697)

* Update mixpanel typings for Ionic native.

* Update index.ts
This commit is contained in:
Todd Vrba 2018-09-15 03:37:52 -05:00 committed by Daniel Sogl
parent 267149b16f
commit ac467c50ac

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Cordova, Plugin, IonicNativePlugin } from '@ionic-native/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';
declare var mixpanel: any; declare var mixpanel: any;
@ -33,36 +33,44 @@ declare var mixpanel: any;
}) })
@Injectable() @Injectable()
export class Mixpanel extends IonicNativePlugin { export class Mixpanel extends IonicNativePlugin {
/** /**
* * If originalId is omitted, aliasId will be used as originalId.
* @param aliasId {string} * @param aliasId {string}
* @param originalId {string} * @param originalId {string}
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
alias(aliasId: string, originalId: string): Promise<any> { return; } alias(aliasId: string, originalId?: string): Promise<any> {
return;
}
/** /**
* *
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
distinctId(): Promise<any> { return; } distinctId(): Promise<any> {
return;
}
/** /**
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
flush(): Promise<any> { return; } flush(): Promise<any> {
return;
}
/** /**
* * The usePeople parameter is used for the iOS Mixpanel SDK.
* @param distinctId {string} * @param distinctId {string}
* @param usePeople {boolean}
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
identify(distinctId: string): Promise<any> { return; } identify(distinctId: string, usePeople?: boolean): Promise<any> {
return;
}
/** /**
* *
@ -70,14 +78,18 @@ export class Mixpanel extends IonicNativePlugin {
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
init(token: string): Promise<any> { return; } init(token: string): Promise<any> {
return;
}
/** /**
* *
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
getSuperProperties(): Promise<any> { return; } getSuperProperties(): Promise<any> {
return;
}
/** /**
* *
@ -85,7 +97,9 @@ export class Mixpanel extends IonicNativePlugin {
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
registerSuperProperties(superProperties: any): Promise<any> { return; } registerSuperProperties(superProperties: any): Promise<any> {
return;
}
/** /**
* *
@ -93,7 +107,9 @@ export class Mixpanel extends IonicNativePlugin {
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
registerSuperPropertiesOnce(superProperties: any): Promise<any> { return; } registerSuperPropertiesOnce(superProperties: any): Promise<any> {
return;
}
/** /**
* *
@ -101,14 +117,18 @@ export class Mixpanel extends IonicNativePlugin {
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
unregisterSuperProperty(superPropertyName: string): Promise<any> { return; } unregisterSuperProperty(superPropertyName: string): Promise<any> {
return;
}
/** /**
* *
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
reset(): Promise<any> { return; } reset(): Promise<any> {
return;
}
/** /**
* *
@ -116,7 +136,9 @@ export class Mixpanel extends IonicNativePlugin {
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
@Cordova() @Cordova()
timeEvent(eventName: string): Promise<any> { return; } timeEvent(eventName: string): Promise<any> {
return;
}
/** /**
* *
@ -128,8 +150,9 @@ export class Mixpanel extends IonicNativePlugin {
successIndex: 2, successIndex: 2,
errorIndex: 3 errorIndex: 3
}) })
track(eventName: string, eventProperties?: any): Promise<any> { return; } track(eventName: string, eventProperties?: any): Promise<any> {
return;
}
} }
/** /**
* @hidden * @hidden
@ -141,6 +164,24 @@ export class Mixpanel extends IonicNativePlugin {
}) })
@Injectable() @Injectable()
export class MixpanelPeople extends IonicNativePlugin { export class MixpanelPeople extends IonicNativePlugin {
/**
*
* @param appendObject {any}
* @return {Promise<any>}
*/
@Cordova()
append(appendObject: any): Promise<any> {
return;
}
/**
*
* @return {Promise<any>}
*/
@Cordova()
deleteUser(): Promise<any> {
return;
}
/** /**
* *
@ -148,7 +189,9 @@ export class MixpanelPeople extends IonicNativePlugin {
* @return {Promise<any>} * @return {Promise<any>}
*/ */
@Cordova() @Cordova()
identify(distinctId: string): Promise<any> { return; } identify(distinctId: string): Promise<any> {
return;
}
/** /**
* *
@ -156,7 +199,9 @@ export class MixpanelPeople extends IonicNativePlugin {
* @return {Promise<any>} * @return {Promise<any>}
*/ */
@Cordova() @Cordova()
increment(peopleProperties: any): Promise<any> { return; } increment(peopleProperties: any): Promise<any> {
return;
}
/** /**
* *
@ -164,7 +209,9 @@ export class MixpanelPeople extends IonicNativePlugin {
* @return {Promise<any>} * @return {Promise<any>}
*/ */
@Cordova() @Cordova()
setPushId(pushId: string): Promise<any> { return; } setPushId(pushId: string): Promise<any> {
return;
}
/** /**
* *
@ -172,14 +219,48 @@ export class MixpanelPeople extends IonicNativePlugin {
* @return {Promise<any>} * @return {Promise<any>}
*/ */
@Cordova() @Cordova()
set(peopleProperties: any): Promise<any> { return; } set(peopleProperties: any): Promise<any> {
return;
}
/** /**
* *
* @param peopleProperties * @param peopleProperties {any}
* @return {Promise<any>} * @return {Promise<any>}
*/ */
@Cordova() @Cordova()
setOnce(peopleProperties: any): Promise<any> { return; } setOnce(peopleProperties: any): Promise<any> {
return;
}
/**
*
* @param amount {number}
* @param chargeProperties
* @return {Promise<any>}
*/
@Cordova()
trackCharge(amount: number, chargeProperties: any): Promise<any> {
return;
}
/**
*
* @param propertiesArray
* @return {Promise<any>}
*/
@Cordova()
unset(propertiesArray: Array<string>): Promise<any> {
return;
}
/**
*
* @param unionObject {any}
* @return {Promise<any>}
*/
@Cordova()
union(unionObject: any): Promise<any> {
return;
}
} }