import { GlideQueryCondition } from "./GlideQueryCondition"; import { SafeTableField, SafeTableFieldKey, } from "./_GlideRecordHelpers/SafeTableTypes"; /** * The scoped GlideAggregate class is an extension of GlideRecord and allows database aggregation (COUNT, SUM, MIN, MAX, * AVG) queries to be done. This can be helpful in creating customized reports or in calculations for calculated fields. * The GlideAggregate class works only on number fields. Since currency fields are strings, you can't use the * GlideAggregate class on currency fields */ export type GlideAggregate = IGlideAggregate; export declare const GlideAggregate: IGlideAggregate; interface IGlideAggregate { // Construction and table setup new (tableName: T): GlideAggregate; // ScopedGlideAggregate _next(): boolean; _query, V extends SafeTableField>( field: F, value: V ): void; addNotNullQuery>( fieldName: F ): GlideQueryCondition; addNullQuery>(fieldName: F): GlideQueryCondition; addQuery, V extends SafeTableField>( name: F, operator: any, value: V ): GlideQueryCondition; addSystemEncodedQuery(query: string): void; addSystemQuery, V extends SafeTableField>( name: F, operator: any, value: V ): GlideQueryCondition; addUserEncodedQuery(query: string): void; addUserQuery, V extends SafeTableField>( name: F, operator: any, value: V ): GlideQueryCondition; disableSecurityFeature(feature: string): void; enableSecurityFeature(feature: string): void; /** * Moves to the next record in the GlideAggregate */ next(): boolean; hasNext(): boolean; query, V extends SafeTableField>( field: F, value: V ): void; query(): void; // GlideAggregate /** * Adds an aggregate */ addAggregate(agg: string, name: string): void; addBizCalendarTrend>( fieldName: F, bizCalendarSysId: string ): void; addBizCalendarTrendBase>( fieldName: F, bizCalendarSysId: string ): void; addBizCalendarTrendIntersect( anotherCalendarSysId: string, overlapMode: string ): void; /** * Adds a query to the aggregate. Adds an encoded query to the other queries that may have been set for this aggregate */ addEncodedQuery(query: string, enforceFieldACLs?: any): void; getEncodedQuery(): string; addHaving(arg1: string, arg2: string, arg3: string, arg4: string): void; addSystemOrderBy>(name: F): void; /** * Sorts the aggregates into descending order based on the specified field */ addSystemOrderByDesc>(name: F): void; addTrend>( fieldName: F, timeInterval: string, numUnits: number ): void; addUserOrderBy>(name: F): void; /** * Sorts the aggregates into descending order based on the specified field */ addUserOrderByDesc>(name: F): void; /** * Gets the value of the specified aggregate */ getAggregate(agg: string, name: string): string; /** * Gets the query necessary to return the current aggregate */ getAggregateEncodedQuery(): string; getCount(): number; getQuery(): string; getTotal(agg: string, name: string): number; /** * Gets the value of a field */ getValue>(name: F): string; /** * Provides the name of a field to use in grouping the aggregates. May be called numerous times to set multiple * group fields */ groupBy>(name: F): void; isBizCalendarTrendFillGap(): boolean; /** * Orders the aggregates using the value of the specified field. The field will also be added to the group-by list */ orderBy>(name: F): void; /** * Sorts the aggregates based on the specified aggregate and field */ orderByAggregate(agg: string, name: string): void; /** * Sorts the aggregates into descending order based on the specified field */ orderByDesc>(name: F): void; setAggregateWindow(firstRowWanted: number, lastRowWanted: number): void; setBizCalendarTrendFillGap(b: boolean): void; /** * Sets whether the results are to be grouped */ setGroup(b: boolean): void; setGroupByFollowRef(b: boolean): void; setIntervalYearIncluded(b: boolean): void; setOrder(b: boolean): void; setOrderByFollowRef(b: boolean): void; /** *

* Enables or disables session language join which allows GlideRecord and GlideAggregate * to work with translated fields before a query. *

*

   * var ga = new GlideAggregate("cmn_department");
   * ga.enableSessionLanguageJoin();
   * ga.addQuery("name", "人力资源");
   * ga.addAggregate("count", null);
   * ga.query();
   * 
*/ enableSessionLanguageJoin(): void; // GlideRecord _get, V extends SafeTableField>( name: F, value?: V ): boolean; getTableName(): string; getRowCount(): number; }