Home / File/ events.ts — ui Source File

events.ts — ui Source File

Architecture documentation for events.ts, a typescript file in the ui codebase. 2 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  acce3f38_3a9c_c3d9_1ddb_5cc53ac90f9d["events.ts"]
  3e86e93a_5f16_ded6_e0c4_1a91ee73a159["analytics"]
  acce3f38_3a9c_c3d9_1ddb_5cc53ac90f9d --> 3e86e93a_5f16_ded6_e0c4_1a91ee73a159
  6802ce19_522d_e5fb_e458_8826d9f6952e["zod"]
  acce3f38_3a9c_c3d9_1ddb_5cc53ac90f9d --> 6802ce19_522d_e5fb_e458_8826d9f6952e
  style acce3f38_3a9c_c3d9_1ddb_5cc53ac90f9d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import va from "@vercel/analytics"
import { z } from "zod"

const eventSchema = z.object({
  name: z.enum([
    "copy_npm_command",
    "copy_usage_import_code",
    "copy_usage_code",
    "copy_primitive_code",
    "copy_theme_code",
    "copy_block_code",
    "copy_chunk_code",
    "enable_lift_mode",
    "copy_chart_code",
    "copy_chart_theme",
    "copy_chart_data",
    "copy_color",
    "set_layout",
    "search_query",
    "create_app",
    "copy_create_share_url",
    "copy_registry_add_command",
  ]),
  // declare type AllowedPropertyValues = string | number | boolean | null
  properties: z
    .record(z.union([z.string(), z.number(), z.boolean(), z.null()]))
    .optional(),
})

export type Event = z.infer<typeof eventSchema>

export function trackEvent(input: Event): void {
  const event = eventSchema.parse(input)
  if (event) {
    va.track(event.name, event.properties)
  }
}

Subdomains

Functions

Types

Dependencies

  • analytics
  • zod

Frequently Asked Questions

What does events.ts do?
events.ts is a source file in the ui codebase, written in typescript. It belongs to the DocumentationAtlas domain, SearchAPI subdomain.
What functions are defined in events.ts?
events.ts defines 1 function(s): trackEvent.
What does events.ts depend on?
events.ts imports 2 module(s): analytics, zod.
Where is events.ts in the architecture?
events.ts is located at apps/v4/lib/events.ts (domain: DocumentationAtlas, subdomain: SearchAPI, directory: apps/v4/lib).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free