mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-04 17:20:09 +00:00
Add expo-mixpanel-analytics type definitions
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import ExpoMixpanelAnalytics from 'expo-mixpanel-analytics';
|
||||
|
||||
const analytics = new ExpoMixpanelAnalytics('5224da5bbbed3fdeaad0911820f1bf2x');
|
||||
|
||||
analytics.identify("13793");
|
||||
|
||||
analytics.track("Signed Up", { "Referred By": "Friend" });
|
||||
|
||||
analytics.people_set({
|
||||
$first_name: "Joe",
|
||||
$last_name: "Doe",
|
||||
$email: "joe.doe@example.com",
|
||||
$created: "2013-04-01T13:20:00",
|
||||
$phone: "4805551212",
|
||||
Address: "1313 Mockingbird Lane",
|
||||
Birthday: "1948-01-01"
|
||||
});
|
||||
|
||||
analytics.people_set_once({ "First login date": "2013-04-01T13:20:00" });
|
||||
|
||||
analytics.people_unset([ "Days Overdue" ]);
|
||||
|
||||
analytics.people_increment({ "Coins Gathered": 12 });
|
||||
|
||||
analytics.people_append({ "Power Ups": "Bubble Lead" });
|
||||
|
||||
analytics.people_union({ "Items purchased": ["socks", "shirts"] });
|
||||
|
||||
analytics.people_delete_user();
|
||||
|
||||
analytics.reset();
|
||||
26
types/expo-mixpanel-analytics/index.d.ts
vendored
Normal file
26
types/expo-mixpanel-analytics/index.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
// Type definitions for expo-mixpanel-analytics 0.0
|
||||
// Project: https://github.com/codekadiya/expo-mixpanel-analytics
|
||||
// Definitions by: Martin Treurnicht <https://github.com/martintreurnicht>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
declare class ExpoMixpanelAnalytics {
|
||||
constructor(token: string);
|
||||
identify(userId: string): void;
|
||||
track(name: string, props: Props): void;
|
||||
people_set(props: Props): void;
|
||||
people_set_once(props: Props): void;
|
||||
people_unset(keys: string[]): void;
|
||||
people_increment(props: Props<number>): void;
|
||||
people_append(props: Props): void;
|
||||
people_union(props: Props<string[]>): void;
|
||||
people_delete_user(): void;
|
||||
reset(): void;
|
||||
token: string;
|
||||
}
|
||||
|
||||
interface Props<T = any> {
|
||||
[key: string]: T;
|
||||
}
|
||||
|
||||
export default ExpoMixpanelAnalytics;
|
||||
23
types/expo-mixpanel-analytics/tsconfig.json
Normal file
23
types/expo-mixpanel-analytics/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"expo-mixpanel-analytics-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/expo-mixpanel-analytics/tslint.json
Normal file
1
types/expo-mixpanel-analytics/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user