<commit_before>import { Service, Id } from '@feathersjs/feathers'
import { Params, Paginated } from '../utils'
import { EventEmitter } from 'events'
import { Store } from 'vuex'

export { Id } from '@feathersjs/feathers'

/*
eslint
@typescript-eslint/no-explicit-any: 0
*/
export interface FeathersVuexOptions {
  serverAlias: string
  addOnUpsert?: boolean
  autoRemove?: boolean
  debug?: boolean
  enableEvents?: boolean
  handleEvents?: HandleEvents
  idField?: string
  tempIdField?: string
  keepCopiesInStore?: boolean
  nameStyle?: string
  paramsForServer?: string[]
  preferUpdate?: boolean
  replaceItems?: boolean
  skipRequestIfExists?: boolean
  whitelist?: string[]
}

export interface HandleEvents {
  created?: Function
  patched?: Function
  updated?: Function
  removed?: Function
}

export interface MakeServicePluginOptions {
  Model: any
  service: Service<any>

  idField?: string
  tempIdField?: string

  addOnUpsert?: boolean
  autoRemove?: boolean
  debug?: boolean
  enableEvents?: boolean
  preferUpdate?: boolean
  replaceItems?: boolean
  skipRequestIfExists?: boolean
  nameStyle?: string

  servicePath?: string
  namespace?: string

  whitelist?: string[]
  paramsForServer?: string[]

  instanceDefaults?: () => {}
  setupInstance?: (data: any, { models, store }) => {}
  handleEvents?: HandleEvents
  state?: {}
  getters?: {}
  mutations?: {}
  actions?: {}
}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface FeathersVuexStoreState {
  /** Allow clients to augment store state */
}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface FeathersVuexGlobalModels {
  /** Allow clients to augment Global models */
}

// Alias and default to any if user doesn't augment interfaces
export type StoreState = keyof FeathersVuexStoreState extends never ? any : FeathersVuexStoreState
export type GlobalModels = keyof FeathersVuexGlobalModels extends never ? any : FeathersVuexGlobalModels

export interface PatchParams<D extends {} = AnyData> extends Params {
  data?: Partial<D>
}

export interface ModelSetupContext {
  /**
   * The global Vuex store
   */
  store: StoreState
  /**
   * The global `models` object
   */
  models: GlobalModels
}

export interface ModelInstanceOptions {
  /**
   * Creating clone?
   *
   * Default: `false`
   */
  clone?: boolean
  /**
   * Add to store
   *
   * Default: `true`
   */
  commit?: boolean
  /**
   * Merge with existing?
   *
   * Default: `true`
   */
  merge?: boolean
}

export type AnyData = { [key: string]: any }

/** Static Model interface */
export interface ModelStatic extends EventEmitter {
  /**
   * The path passed to `FeathersClient.service()` to create the service
   */
  readonly servicePath: string
  /**
   * Holds the value that was used to register the module with Vuex.
   * This will match the servicePath unless you've provided a custom
   * namespace in the Service Module plugin options.
   */
  readonly namespace: string
  /**
   * The global Vuex store
   */
  readonly store: Store<StoreState>
  /**
   * The field in each record that will contain the ID
   */
  readonly idField: string
  /**
   * The field in each temporary record that contains the temporary ID
   */
  readonly tempIdField: string
  /**
   *  If `true`, calling `model.save()` will do an `update` instead of a `patch`.
   */
  readonly preferUpdate: boolean
  /**
   * Server alias in the global `models` object
   */
  readonly serverAlias: string
  /**
   * Model name used to circumvent Babel transpilation errors
   */
  readonly modelName: string
  /**
   * The global `models` object
   */
  readonly models: GlobalModels
  /**
   * All model copies created using `model.clone()`
   */
  readonly copiesById: {
    [key: string]: Model | undefined
    [key: number]: Model | undefined
  }

  /**
   * The BaseModel constructor calls mergeWithAccessors(this, newData).
   * This utility function correctly copies data between both regular
   * objects and Vue.observable instances. If you create a class where
   * you need to do your own merging, you probably don't want
   * mergeWithAccessors to run twice. In this case, you can use the
   * `merge: false` BaseModel instance option to prevent the internal
   * merge. You can then access the mergeWithAccessors method by calling
   * this method like MyModel.merge(this, newData).<commit_msg>fix: make static props mutable<commit_after>import { Service, Id } from '@feathersjs/feathers'
import { Params, Paginated } from '../utils'
import { EventEmitter } from 'events'
import { Store } from 'vuex'

export { Id } from '@feathersjs/feathers'

/*
eslint
@typescript-eslint/no-explicit-any: 0
*/
export interface FeathersVuexOptions {
  serverAlias: string
  addOnUpsert?: boolean
  autoRemove?: boolean
  debug?: boolean
  enableEvents?: boolean
  handleEvents?: HandleEvents
  idField?: string
  tempIdField?: string
  keepCopiesInStore?: boolean
  nameStyle?: string
  paramsForServer?: string[]
  preferUpdate?: boolean
  replaceItems?: boolean
  skipRequestIfExists?: boolean
  whitelist?: string[]
}

export interface HandleEvents {
  created?: Function
  patched?: Function
  updated?: Function
  removed?: Function
}

export interface MakeServicePluginOptions {
  Model: any
  service: Service<any>

  idField?: string
  tempIdField?: string

  addOnUpsert?: boolean
  autoRemove?: boolean
  debug?: boolean
  enableEvents?: boolean
  preferUpdate?: boolean
  replaceItems?: boolean
  skipRequestIfExists?: boolean
  nameStyle?: string

  servicePath?: string
  namespace?: string

  whitelist?: string[]
  paramsForServer?: string[]

  instanceDefaults?: () => {}
  setupInstance?: (data: any, { models, store }) => {}
  handleEvents?: HandleEvents
  state?: {}
  getters?: {}
  mutations?: {}
  actions?: {}
}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface FeathersVuexStoreState {
  /** Allow clients to augment store state */
}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface FeathersVuexGlobalModels {
  /** Allow clients to augment Global models */
}

// Alias and default to any if user doesn't augment interfaces
export type StoreState = keyof FeathersVuexStoreState extends never ? any : FeathersVuexStoreState
export type GlobalModels = keyof FeathersVuexGlobalModels extends never ? any : FeathersVuexGlobalModels

export interface PatchParams<D extends {} = AnyData> extends Params {
  data?: Partial<D>
}

export interface ModelSetupContext {
  /**
   * The global Vuex store
   */
  store: StoreState
  /**
   * The global `models` object
   */
  models: GlobalModels
}

export interface ModelInstanceOptions {
  /**
   * Creating clone?
   *
   * Default: `false`
   */
  clone?: boolean
  /**
   * Add to store
   *
   * Default: `true`
   */
  commit?: boolean
  /**
   * Merge with existing?
   *
   * Default: `true`
   */
  merge?: boolean
}

export type AnyData = { [key: string]: any }

/** Static Model interface */
export interface ModelStatic extends EventEmitter {
  /**
   * The path passed to `FeathersClient.service()` to create the service
   */
  servicePath: string
  /**
   * Holds the value that was used to register the module with Vuex.
   * This will match the servicePath unless you've provided a custom
   * namespace in the Service Module plugin options.
   */
  namespace: string
  /**
   * The global Vuex store
   */
  readonly store: Store<StoreState>
  /**
   * The field in each record that will contain the ID
   */
  idField: string
  /**
   * The field in each temporary record that contains the temporary ID
   */
  tempIdField: string
  /**
   *  If `true`, calling `model.save()` will do an `update` instead of a `patch`.
   */
  preferUpdate: boolean
  /**
   * Server alias in the global `models` object
   */
  serverAlias: string
  /**
   * Model name used to circumvent Babel transpilation errors
   */
  modelName: string
  /**
   * The global `models` object
   */
  readonly models: GlobalModels
  /**
   * All model copies created using `model.clone()`
   */
  readonly copiesById: {
    [key: string]: Model | undefined
    [key: number]: Model | undefined
  }

  /**
   * The BaseModel constructor calls mergeWithAccessors(this, newData).
   * This utility function correctly copies data between both regular
   * objects and Vue.observable instances. If you create a class where
   * you need to do your own merging, you probably don't want
   * mergeWithAccessors to run twice. In this case, you can use the
   * `merge: false` BaseModel instance option to prevent the internal
   * merge. You can then access the mergeWithAccessors method by calling
   * this method like MyModel.merge(this, newData).
{'fraction_non_alphanumeric': 0.1002056672760512, 'fraction_numerical': 0.00022851919561243144, 'mean_word_length': 3.5683716075156577, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '489954', 'n_tokens_mistral': 2520, 'n_tokens_neox': 2516, 'n_words': 866}