@stacksee/analytics 0.4.5 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { AnalyticsConfig, EventContext } from '../../core/events/types.js';
2
2
  type DefaultEventMap = Record<string, Record<string, unknown>>;
3
- export declare class ServerAnalytics<TEventMap extends DefaultEventMap = DefaultEventMap> {
3
+ export declare class ServerAnalytics<TEventMap extends Record<string, Record<string, unknown>> = DefaultEventMap> {
4
4
  private providers;
5
5
  private config;
6
6
  private initialized;
@@ -207,7 +207,7 @@ export declare class ServerAnalytics<TEventMap extends DefaultEventMap = Default
207
207
  * }
208
208
  * ```
209
209
  */
210
- track<TEventName extends keyof TEventMap & string>(eventName: TEventName, properties: TEventMap[TEventName], options?: {
210
+ track<TEventName extends string>(eventName: TEventName, properties: TEventName extends keyof TEventMap ? TEventMap[TEventName] : Record<string, unknown>, options?: {
211
211
  userId?: string;
212
212
  sessionId?: string;
213
213
  context?: EventContext;
@@ -20,6 +20,6 @@ export type EventMapFromCollection<T> = T extends EventCollection<infer Events>
20
20
  } ? N extends string ? N : never : never]: Events[K] extends {
21
21
  properties: infer P;
22
22
  } ? P : never;
23
- } : never;
23
+ } : Record<string, Record<string, unknown>>;
24
24
  export type AnyEventName = string;
25
25
  export type AnyEventProperties = Record<string, unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stacksee/analytics",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "A highly typed, provider-agnostic analytics library for TypeScript applications",
5
5
  "type": "module",
6
6
  "exports": {