mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-16 14:06:49 +01:00
15 lines
388 B
TypeScript
15 lines
388 B
TypeScript
import type { AnalyticsAction, AnalyticsResource } from '../../src-tauri/bindings/analytics';
|
|
import { invokeCmd } from './tauri';
|
|
|
|
export function trackEvent(
|
|
resource: AnalyticsResource,
|
|
action: AnalyticsAction,
|
|
attributes: Record<string, string | number> = {},
|
|
) {
|
|
invokeCmd('cmd_track_event', {
|
|
resource: resource,
|
|
action,
|
|
attributes,
|
|
}).catch(console.error);
|
|
}
|