import { RequestSpan } from './tracing' ; category export class ViewResult < TValue = any , TKey = any > { /**
     * The rows which have been returned by the query.
     */ rows : ViewRow < TKey , TValue > [ ] ; /**
     * The meta-data which has been returned by the query.
     */ meta : ViewMetaData ; internal constructor ( data ) { this . rows = data . rows ; this . meta = data . meta ; } } category export class ViewMetaData { /**
     * The total number of rows available in the index that match the query.
     */ totalRows : number ; /**
     * Contains various pieces of debug information exposed by the view service.
     */ debug ? : any ; internal constructor ( data ) { this . totalRows = data . totalRows ; this . debug = data . debug ; } /**
     * Same as  ViewMetaData . totalRows , but represented as
     * the raw server-side value.
     *
     *  deprecated Use  ViewMetaData . totalRows instead.
      get total_rows ( ) : number { return this . totalRows ; } } category export class ViewRow < TValue = any , TKey = any > { /**
     * The value for this row.
     */ value : TValue ; /**
     * The key for this row.
     */ key ? : TKey ; /**
     * The id for this row.
     */ id ? : string ; internal constructor ( data ) { this . value = data . value ; this . key = data . key ; this . id = data . id ; } } category export enum ViewScanConsistency { /**
     * Indicates that no specific consistency is required, this is the fastest
     * options, but results may not include the most recent operations which have
     * been performed.
     */ NotBounded = 'ok' , /**
     * Indicates that the results to the query should include all operations that
     * have occurred up until the query was started.  This incurs a performance
     * penalty of waiting for the index to catch up to the most recent operations,
     * but provides the highest level of consistency.
     */ RequestPlus = 'false' , /**
     * Indicates that the results of the query should behave according to similar
     * semantics as NotBounded, but following the execution of the query the index
     * should begin updating such that following queries will likely include up
     * to date data.
     */ UpdateAfter = 'update_after' } category export enum ViewOrdering { /**
     * Indicates that results should be returned in ascending order.
     */ Ascending = 'false' , /**
     * Indicates that results should be returned in descending order.
     */ Descending = 'true' } category export enum ViewErrorMode { /**
     * Indicates that if an error occurs during the execution of the view query,
     * the query should continue to process and include any available results.
     */ Continue = 'continue' , /**
     * Indicates that if an error occurs during the execution of the view query,
     * the query should be aborted immediately rather than attempting to continue.
     */ Stop = 'stop' } category export interface ViewQueryKeyRange { /**
     * Specifies the first key that should be included in the results.
     */ start ? : string | string [ ] ; /**
     * Specifies the last key that should be included in the results.
     */ end ? : string | string [ ] ; /**
     * Specifies whether the end key should be considered inclusive or exclusive.
     */ inclusiveEnd ? : boolean ; /**
     * Same as  ViewQueryKeyRange . inclusiveEnd , but represented as
     * the raw server-side value instead.
     *
     *  deprecated Use  ViewQueryKeyRange . inclusiveEnd instead.
      inclusive_end ? : boolean ; } category export interface ViewQueryIdRange { /**
     * Specifies the first id that should be included in the results.
     */ start ? : string ; /**
     * Specifies the last id (inclusively) that should be included in the results.
     */ end ? : string ; } category export interface ViewQueryOptions { see ViewScanConsistency scanConsistency ? : ViewScanConsistency ; /**
     * Specifies the number of results to skip from the index before returning
     * results.
     */ skip ? : number ; /**
     * Specifies the limit to the number of results that should be returned.
     */ limit ? : number ; /**
     * Specifies the ordering that should be used when returning results.
     */ order ? : ViewOrdering ; /**
     * Specifies a reduction function that should be used for the 'reduce' portion
     * of map/reduce querying.
     */ reduce ? : string ; /**
     * Specifies whether the results should be grouped together.
     */ group ? : boolean ; /**
     * Specifies the level to which results should be group.
     */ groupLevel ? : number ; /**
     * Specifies a specific key which should be fetched from the index.
     */ key ? : string ; /**
     * Specifies a list of keys which should be fetched from the index.
     */ keys ? : string [ ] ; /**
     * Specifies a range of keys that should be fetched from the index.
     */ range ? : ViewQueryKeyRange ; /**
     * Specifies a range of ids that should be fetched from the index.
     */ idRange ? : ViewQueryIdRange ; /**
     * Indicates whether the query should force the entire set of document in the index
     * to be included in the result.  This is on by default for production views and off
     * by default for development views (only a subset of results may be returned).
     */ fullSet ? : boolean ; /**
     * Specifies the error-handling behaviour that should be used when an error occurs.
     */ onError ? : ViewErrorMode ; /**
     * The parent tracing span that this operation will be part of.
     */ parentSpan ? : RequestSpan ; /**
     * The timeout for this operation, represented in milliseconds.
     */ timeout ? : number ; /**
     * Same as  ViewQueryOptions . scanConsistency , but represented as
     * the raw server-side value instead.
     *
     *  deprecated Use  ViewQueryOptions . scanConsistency instead.
      stale ? : string | ViewScanConsistency ; /**
     * Same as  ViewQueryOptions . groupLevel , but represented as
     * the raw server-side value instead.
     *
     *  deprecated Use  ViewQueryOptions . groupLevel instead.
      group_level ? : number ; /**
     * Same as  ViewQueryOptions . idRange , but represented as
     * the raw server-side value instead.
     *
     *  deprecated Use  ViewQueryOptions . idRange instead.
      id_range ? : ViewQueryIdRange ; /**
     * Same as  ViewQueryOptions . fullSet , but represented as
     * the raw server-side value instead.
     *
     *  deprecated Use  ViewQueryOptions . fullSet instead.
      full_set ? : boolean ; /**
     * Same as  ViewQueryOptions . onError , but represented as
     * the raw server-side value instead.
     *
     *  deprecated Use  ViewQueryOptions . onError instead.
      on_error ? : ViewErrorMode ; }