import { type Message } from 'ai'

export interface Chat extends Record<string, any> {
  id: string
  title: string
  createdAt: Date
  userId: string
  path: string
  messages: Message[]
  sharePath?: string
}

export interface ChatListItem extends Record<string, any> {
  id: string
  createdAt: Date
  title: string
  userId: string
  path: string
  sharePath?: string
}

export type ServerActionResult<Result> = Promise<
  | Result
  | {
      error: string
    }
>

export type ChainData = {
  name: string
  chain: string
  icon?: string
  rpc: string[]
  features?: { name: string }[]
  faucets: string[]
  nativeCurrency: {
    name: string
    symbol: string
    decimals: number
  }
  infoURL: string
  shortName: string
  chainId: number
  networkId: number
  slip44?: number
  ens?: {
    registry: string
  }
  explorers?: {
    name: string
    url: string
    standard?: string
    icon?: string
  }[]
}

declare global {
  interface Window {
    RUNTIME_ENV?: Record<string, string>;
  }
}