<commit_before>// API Globals
export interface Looker {
  plugins: {
    visualizations: {
      add: (visualization: VisualizationDefinition) => void
    }
  }
}

export interface LookerChartUtils {
  Utils: {
    openDrillMenu: (options: { links: Link[], event: object }) => void
    openUrl: (url: string, event: object) => void
    textForCell: (cell: Cell) => string
    filterableValueForCell: (cell: Cell) => string
    htmlForCell: (cell: Cell, context?: string, fieldDefinitionForCell?: any, customHtml?: string) => string
  }
}

// Looker visualization types
export interface VisualizationDefinition {
  id?: string
  label?: string
  options: VisOptions
  addError?: (error: VisualizationError) => void
  clearErrors?: (errorName?: string) => void
  create: (element: HTMLElement, settings: VisConfig) => void
  trigger?: (event: string, config: object[]) => void
  update?: (data: VisData, element: HTMLElement, config: VisConfig, queryResponse: VisQueryResponse, details?: VisUpdateDetails) => void
  updateAsync?: (data: VisData, element: HTMLElement, config: VisConfig, queryResponse: VisQueryResponse, details: VisUpdateDetails | undefined, updateComplete: () => void) => void
  destroy?: () => void
}

export interface VisOptions { [optionName: string]: VisOption }

export interface VisOptionValue { [label: string]: string }

export interface VisQueryResponse {<commit_msg>fix: add onCrossfilter to viz def (#1)<commit_after>// API Globals
export interface Looker {
  plugins: {
    visualizations: {
      add: (visualization: VisualizationDefinition) => void
    }
  }
}

export interface LookerChartUtils {
  Utils: {
    openDrillMenu: (options: { links: Link[], event: object }) => void
    openUrl: (url: string, event: object) => void
    textForCell: (cell: Cell) => string
    filterableValueForCell: (cell: Cell) => string
    htmlForCell: (cell: Cell, context?: string, fieldDefinitionForCell?: any, customHtml?: string) => string
  }
}
/**
 * Minimal representation of a Crossfilter action
 */
export interface Crossfilter {
  field: string
  values: string[]
  range?: [string, string]
}

// Looker visualization types
export interface VisualizationDefinition {
  id?: string
  label?: string
  options: VisOptions
  addError?: (error: VisualizationError) => void
  clearErrors?: (errorName?: string) => void
  create: (element: HTMLElement, settings: VisConfig) => void
  onCrossfilter: (crossfilters: Crossfilter[], event: Event | null) => void,
  trigger?: (event: string, config: object[]) => void
  update?: (data: VisData, element: HTMLElement, config: VisConfig, queryResponse: VisQueryResponse, details?: VisUpdateDetails) => void
  updateAsync?: (data: VisData, element: HTMLElement, config: VisConfig, queryResponse: VisQueryResponse, details: VisUpdateDetails | undefined, updateComplete: () => void) => void
  destroy?: () => void
}

export interface VisOptions { [optionName: string]: VisOption }

export interface VisOptionValue { [label: string]: string }

export interface VisQueryResponse {
{'fraction_non_alphanumeric': 0.1240539651201053, 'fraction_numerical': 0.0003290556103981573, 'mean_word_length': 4.972495088408644, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3280378', 'n_tokens_mistral': 854, 'n_tokens_neox': 853, 'n_words': 275}