UNPKG

5.33 kBJavaScriptView Raw
1"use strict";
2var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6 return c > 3 && r && Object.defineProperty(target, key, r), r;
7};
8var plugin_1 = require('./plugin');
9/**
10 * @name Mixpanel
11 * @description
12 * Cordova Plugin that wraps Mixpanel SDK for Android and iOS
13 *
14 * @usage
15 * ```
16 * import {Mixpanel} from 'ionic-native';
17 *
18 * Mixpanel.init(token)
19 * .then(onSuccess)
20 * .catch(onError);
21 *
22 * ```
23 * @classes
24 * MixpanelPeople
25 */
26var Mixpanel = (function () {
27 function Mixpanel() {
28 }
29 /**
30 *
31 * @param aliasId {string}
32 * @param originalId {string}
33 * @returns {Promise<any>}
34 */
35 Mixpanel.alias = function (aliasId, originalId) { return; };
36 /**
37 *
38 * @returns {Promise<any>}
39 */
40 Mixpanel.distinctId = function () { return; };
41 /**
42 * @returns {Promise<any>}
43 */
44 Mixpanel.flush = function () { return; };
45 /**
46 *
47 * @param distinctId {string}
48 * @returns {Promise<any>}
49 */
50 Mixpanel.identify = function (distinctId) { return; };
51 /**
52 *
53 * @param token {string}
54 * @returns {Promise<any>}
55 */
56 Mixpanel.init = function (token) { return; };
57 /**
58 *
59 * @param superProperties {any}
60 * @returns {Promise<any>}
61 */
62 Mixpanel.registerSuperProperties = function (superProperties) { return; };
63 /**
64 *
65 * @returns {Promise<any>}
66 */
67 Mixpanel.reset = function () { return; };
68 /**
69 *
70 * @param eventName {string}
71 * @param eventProperties {any} optional
72 * @returns {Promise<any>}
73 */
74 Mixpanel.track = function (eventName, eventProperties) { return; };
75 /**
76 *
77 * @returns {Promise<any>}
78 */
79 Mixpanel.showSurvey = function () { return; };
80 Object.defineProperty(Mixpanel, "people", {
81 /**
82 *
83 * @returns {MixpanelPeople}
84 */
85 get: function () {
86 return MixpanelPeople;
87 },
88 enumerable: true,
89 configurable: true
90 });
91 ;
92 __decorate([
93 plugin_1.Cordova()
94 ], Mixpanel, "alias", null);
95 __decorate([
96 plugin_1.Cordova()
97 ], Mixpanel, "distinctId", null);
98 __decorate([
99 plugin_1.Cordova()
100 ], Mixpanel, "flush", null);
101 __decorate([
102 plugin_1.Cordova()
103 ], Mixpanel, "identify", null);
104 __decorate([
105 plugin_1.Cordova()
106 ], Mixpanel, "init", null);
107 __decorate([
108 plugin_1.Cordova()
109 ], Mixpanel, "registerSuperProperties", null);
110 __decorate([
111 plugin_1.Cordova()
112 ], Mixpanel, "reset", null);
113 __decorate([
114 plugin_1.Cordova({
115 successIndex: 2,
116 errorIndex: 3
117 })
118 ], Mixpanel, "track", null);
119 __decorate([
120 plugin_1.Cordova()
121 ], Mixpanel, "showSurvey", null);
122 Mixpanel = __decorate([
123 plugin_1.Plugin({
124 pluginName: 'Mixpanel',
125 plugin: 'cordova-plugin-mixpanel',
126 pluginRef: 'mixpanel',
127 repo: 'https://github.com/samzilverberg/cordova-mixpanel-plugin'
128 })
129 ], Mixpanel);
130 return Mixpanel;
131}());
132exports.Mixpanel = Mixpanel;
133/**
134 * @private
135 */
136var MixpanelPeople = (function () {
137 function MixpanelPeople() {
138 }
139 /**
140 *
141 * @param distinctId {string}
142 * @return {Promise<any>}
143 */
144 MixpanelPeople.identify = function (distinctId) { return; };
145 /**
146 *
147 * @param peopleProperties {string}
148 * @return {Promise<any>}
149 */
150 MixpanelPeople.increment = function (peopleProperties) { return; };
151 /**
152 *
153 * @param pushId
154 * @return {Promise<any>}
155 */
156 MixpanelPeople.setPushId = function (pushId) { return; };
157 /**
158 *
159 * @param peopleProperties
160 * @return {Promise<any>}
161 */
162 MixpanelPeople.set = function (peopleProperties) { return; };
163 /**
164 *
165 * @param peopleProperties
166 * @return {Promise<any>}
167 */
168 MixpanelPeople.setOnce = function (peopleProperties) { return; };
169 /**
170 * @private
171 */
172 MixpanelPeople.plugin = 'cordova-plugin-mixpanel';
173 /**
174 * @private
175 */
176 MixpanelPeople.pluginRef = 'mixpanel.people';
177 __decorate([
178 plugin_1.Cordova()
179 ], MixpanelPeople, "identify", null);
180 __decorate([
181 plugin_1.Cordova()
182 ], MixpanelPeople, "increment", null);
183 __decorate([
184 plugin_1.Cordova()
185 ], MixpanelPeople, "setPushId", null);
186 __decorate([
187 plugin_1.Cordova()
188 ], MixpanelPeople, "set", null);
189 __decorate([
190 plugin_1.Cordova()
191 ], MixpanelPeople, "setOnce", null);
192 return MixpanelPeople;
193}());
194exports.MixpanelPeople = MixpanelPeople;
195//# sourceMappingURL=mixpanel.js.map
\No newline at end of file