Skip to content

Commit

Permalink
style: Format index.d.ts using editor
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-suhas committed Jun 14, 2017
1 parent a382652 commit 31a950c
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 44 deletions.
167 changes: 124 additions & 43 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ class Query {
*
* @extends Query
*/
export class MatchAllQuery extends Query { }
export class MatchAllQuery extends Query {}

/**
* The most simple query, which matches all documents, giving them all a `_score` of `1.0`.
Expand All @@ -313,7 +313,7 @@ export function matchAllQuery(): MatchAllQuery;
*
* @extends Query
*/
export class MatchNoneQuery extends Query { }
export class MatchNoneQuery extends Query {}

/**
* The inverse of the `match_all` query, which matches no documents.
Expand Down Expand Up @@ -393,7 +393,6 @@ class MonoFieldQueryBase extends FullTextQueryBase {
* @returns {object} returns an Object which maps to the elasticsearch query DSL
*/
toJSON(): object;

}

/**
Expand Down Expand Up @@ -609,7 +608,10 @@ export class MatchPhrasePrefixQuery extends MatchPhraseQueryBase {
* @param {string=} field The document field to query against
* @param {string=} queryString The query string
*/
export function matchPhrasePrefixQuery(field?: string, queryString?: string): MatchPhrasePrefixQuery;
export function matchPhrasePrefixQuery(
field?: string,
queryString?: string
): MatchPhrasePrefixQuery;

/**
* A `MultiMatchQuery` query builds further on top of the
Expand Down Expand Up @@ -660,9 +662,7 @@ export class MultiMatchQuery extends FullTextQueryBase {
* @param {string} type Can be one of `best_fields`, `most_fields`,
* `cross_fields`, `phrase`, and `phrase_prefix`. Default is `best_fields`.
*/
type(
type: 'best_fields' | 'most_fields' | 'cross_fields' | 'phrase' | 'phrase_prefix'
): this;
type(type: 'best_fields' | 'most_fields' | 'cross_fields' | 'phrase' | 'phrase_prefix'): this;

/**
* The tie breaker value. The tie breaker capability allows results
Expand Down Expand Up @@ -1340,8 +1340,7 @@ export function termsQuery(field?: string, values?: string[] | string | number):
* this class could be extended.
* @extends ValueTermQueryBase
*/
class MultiTermQueryBase extends ValueTermQueryBase {
}
class MultiTermQueryBase extends ValueTermQueryBase {}

/**
* Matches documents with fields that have terms within a certain range.
Expand Down Expand Up @@ -1811,7 +1810,6 @@ export class ConstantScoreQuery extends Query {
*/
export function constantScoreQuery(filterQuery?: Query): ConstantScoreQuery;


/**
* A query that matches documents matching boolean combinations of other queries.
* The bool query maps to Lucene `BooleanQuery`. It is built using one or more
Expand Down Expand Up @@ -2048,7 +2046,11 @@ export class BoostingQuery extends Query {
* @param {Query=} negativeQry A valid `Query` object.
* @param {number=} negativeBoost A positive `double` value where `0 < n < 1`.
*/
export function boostingQuery(positiveQry?: Query, negativeQry?: Query, negativeBoost?: number): BoostingQuery;
export function boostingQuery(
positiveQry?: Query,
negativeQry?: Query,
negativeBoost?: number
): BoostingQuery;

/**
* The `JoiningQueryBase` class provides support for common options used across
Expand Down Expand Up @@ -2519,7 +2521,6 @@ export class GeoDistanceQuery extends GeoQueryBase {
* @throws {TypeError} If parameter `point` is not an instance of `GeoPoint`
*/
geoPoint(point: GeoPoint): this;

}

/**
Expand Down Expand Up @@ -2857,8 +2858,7 @@ export function percolateQuery(field?: string, docType?: string): PercolateQuery
*
* @extends Query
*/
export class SpanQueryBase extends Query {
}
export class SpanQueryBase extends Query {}

/**
* Matches spans containing a term. The span term query maps to Lucene `SpanTermQuery`.
Expand Down Expand Up @@ -3102,8 +3102,7 @@ export class SpanLittleBigQueryBase extends SpanQueryBase {
*
* @extends SpanLittleBigQueryBase
*/
export class SpanContainingQuery extends SpanLittleBigQueryBase {
}
export class SpanContainingQuery extends SpanLittleBigQueryBase {}

/**
* Returns matches which enclose another span query. The span containing query
Expand All @@ -3119,8 +3118,7 @@ export function spanContainingQuery(): SpanContainingQuery;
*
* @extends SpanLittleBigQueryBase
*/
export class SpanWithinQuery extends SpanLittleBigQueryBase {
}
export class SpanWithinQuery extends SpanLittleBigQueryBase {}

/**
* Returns matches which are enclosed inside another span query. The span within
Expand Down Expand Up @@ -3180,7 +3178,10 @@ export class SpanFieldMaskingQuery extends SpanQueryBase {
* @param {string=} field
* @param {SpanQueryBase=} spanQry Any other span type query
*/
export function spanFieldMaskingQuery(field?: string, spanQry?: SpanQueryBase): SpanFieldMaskingQuery;
export function spanFieldMaskingQuery(
field?: string,
spanQry?: SpanQueryBase
): SpanFieldMaskingQuery;

/**
* Base class implementation for all aggregation types.
Expand Down Expand Up @@ -3683,7 +3684,9 @@ export class PercentileRanksAggregation extends MetricsAggregationBase {
}

export function percentileRanksAggregation(
name: string, field?: string, values?: number[]
name: string,
field?: string,
values?: number[]
): PercentileRanksAggregation;

/**
Expand Down Expand Up @@ -4243,7 +4246,11 @@ export class DateHistogramAggregation extends HistogramAggregationBase {
* @param {string=} interval Interval to generate histogram over.
* Available expressions for interval: year, quarter, month, week, day, hour, minute, second
*/
export function dateHistogramAggregation(name: string, field?: string, interval?: string): DateHistogramAggregation;
export function dateHistogramAggregation(
name: string,
field?: string,
interval?: string
): DateHistogramAggregation;

/**
* The `RangeAggregationBase` provides support for common options used across
Expand Down Expand Up @@ -4403,7 +4410,10 @@ export class DiversifiedSamplerAggregation extends BucketAggregationBase {
* @param {string} name The name which will be used to refer to this aggregation.
* @param {string=} field The field to aggregate on
*/
export function diversifiedSamplerAggregation(name: string, field?: string): DiversifiedSamplerAggregation;
export function diversifiedSamplerAggregation(
name: string,
field?: string
): DiversifiedSamplerAggregation;

/**
* Defines a single bucket of all the documents in the current document set
Expand Down Expand Up @@ -4739,7 +4749,11 @@ export class HistogramAggregation extends HistogramAggregationBase {
* @param {string=} field The field to aggregate on
* @param {number=} interval Interval to generate histogram over.
*/
export function histogramAggregation(name: string, field?: string, interval?: number): HistogramAggregation;
export function histogramAggregation(
name: string,
field?: string,
interval?: number
): HistogramAggregation;

/**
* Dedicated range aggregation for IP typed fields.
Expand Down Expand Up @@ -5076,7 +5090,10 @@ export class TermsAggregationBase extends BucketAggregationBase {
* @param {string=} field The field to aggregate on
*/
export function termsAggregationBase(
name: string, aggType: string, refUrl: string, field?: string
name: string,
aggType: string,
refUrl: string,
field?: string
): TermsAggregationBase;

/**
Expand Down Expand Up @@ -5158,7 +5175,10 @@ export class SignificantTermsAggregation extends TermsAggregationBase {
* @param {string} name The name which will be used to refer to this aggregation.
* @param {string=} field The field to aggregate on
*/
export function significantTermsAggregation(name: string, field?: string): SignificantTermsAggregation;
export function significantTermsAggregation(
name: string,
field?: string
): SignificantTermsAggregation;

/**
* A multi-bucket value source based aggregation where buckets are dynamically
Expand Down Expand Up @@ -5455,7 +5475,10 @@ export class ExtendedStatsBucketAggregation extends PipelineAggregationBase {
* @param {string} name The name which will be used to refer to this aggregation.
* @param {string=} bucketsPath The relative path of metric to aggregate over
*/
export function extendedStatsBucketAggregation(name: string, bucketsPath?: string): ExtendedStatsBucketAggregation;
export function extendedStatsBucketAggregation(
name: string,
bucketsPath?: string
): ExtendedStatsBucketAggregation;

/**
* A sibling pipeline aggregation which calculates percentiles across all
Expand Down Expand Up @@ -5487,7 +5510,10 @@ export class PercentilesBucketAggregation extends PipelineAggregationBase {
* @param {string} name The name which will be used to refer to this aggregation.
* @param {string=} bucketsPath The relative path of metric to aggregate over
*/
export function percentilesBucketAggregation(name: string, bucketsPath?: string): PercentilesBucketAggregation;
export function percentilesBucketAggregation(
name: string,
bucketsPath?: string
): PercentilesBucketAggregation;

/**
* Given an ordered series of data, the Moving Average aggregation will
Expand Down Expand Up @@ -5562,7 +5588,10 @@ export class MovingAverageAggregation extends PipelineAggregationBase {
* @param {string} name The name which will be used to refer to this aggregation.
* @param {string=} bucketsPath The relative path of metric to aggregate over
*/
export function movingAverageAggregation(name: string, bucketsPath?: string): MovingAverageAggregation;
export function movingAverageAggregation(
name: string,
bucketsPath?: string
): MovingAverageAggregation;

/**
* A parent pipeline aggregation which calculates the cumulative sum of
Expand Down Expand Up @@ -5593,7 +5622,10 @@ export class CumulativeSumAggregation extends PipelineAggregationBase {
* @param {string} name The name which will be used to refer to this aggregation.
* @param {string=} bucketsPath The relative path of metric to aggregate over
*/
export function cumulativeSumAggregation(name: string, bucketsPath?: string): CumulativeSumAggregation;
export function cumulativeSumAggregation(
name: string,
bucketsPath?: string
): CumulativeSumAggregation;

/**
* A parent pipeline aggregation which executes a script which can perform
Expand Down Expand Up @@ -5626,7 +5658,10 @@ export class BucketScriptAggregation extends PipelineAggregationBase {
* @param {string} name The name which will be used to refer to this aggregation.
* @param {string=} bucketsPath The relative path of metric to aggregate over
*/
export function bucketScriptAggregation(name: string, bucketsPath?: string): BucketScriptAggregation;
export function bucketScriptAggregation(
name: string,
bucketsPath?: string
): BucketScriptAggregation;

/**
* A parent pipeline aggregation which executes a script which determines whether
Expand Down Expand Up @@ -5666,7 +5701,10 @@ export class BucketSelectorAggregation extends PipelineAggregationBase {
* @param {string} name The name which will be used to refer to this aggregation.
* @param {string=} bucketsPath The relative path of metric to aggregate over
*/
export function bucketSelectorAggregation(name: string, bucketsPath?: string): BucketSelectorAggregation;
export function bucketSelectorAggregation(
name: string,
bucketsPath?: string
): BucketSelectorAggregation;

/**
* Serial differencing is a technique where values in a time series are
Expand Down Expand Up @@ -5697,7 +5735,10 @@ export class SerialDifferencingAggregation extends PipelineAggregationBase {
* @param {string} name The name which will be used to refer to this aggregation.
* @param {string=} bucketsPath The relative path of metric to aggregate over
*/
export function serialDifferencingAggregation(name: string, bucketsPath?: string): SerialDifferencingAggregation;
export function serialDifferencingAggregation(
name: string,
bucketsPath?: string
): SerialDifferencingAggregation;

/**
* The `matrix_stats` aggregation is a numeric aggregation that computes
Expand Down Expand Up @@ -5898,7 +5939,17 @@ export class FieldValueFactorFunction extends ScoreFunction {
* Defaults to `none`.
*/
modifier(
mod: 'none' | 'log' | 'log1p' | 'log2p' | 'ln' | 'ln1p' | 'ln2p' | 'square' | 'sqrt' | 'reciprocal'
mod:
| 'none'
| 'log'
| 'log1p'
| 'log2p'
| 'ln'
| 'ln1p'
| 'ln2p'
| 'square'
| 'sqrt'
| 'reciprocal'
): this;

/**
Expand Down Expand Up @@ -6022,7 +6073,10 @@ export class DecayScoreFunction extends ScoreFunction {
* Defaults to `gauss`.
* @param {string=} field the document field to run decay function against.
*/
export function decayScoreFunction(mode?: 'linear' | 'exp' | 'gauss', field?: string): DecayScoreFunction;
export function decayScoreFunction(
mode?: 'linear' | 'exp' | 'gauss',
field?: string
): DecayScoreFunction;

/**
* Allows to highlight search results on one or more fields. In order to
Expand Down Expand Up @@ -6402,9 +6456,19 @@ export function geoPoint(): GeoPoint;
* @param {Array=} coords A valid coordinat definition for the given shape.
*/
export class GeoShape {
constructor(type?: 'point' | 'linestring' | 'polygon' | 'multipoint' |
'multilinestring' | 'multipolygon' | 'geometrycollection' |
'envelope' | 'circle', coords?: object);
constructor(
type?:
| 'point'
| 'linestring'
| 'polygon'
| 'multipoint'
| 'multilinestring'
| 'multipolygon'
| 'geometrycollection'
| 'envelope'
| 'circle',
coords?: object
);

/**
* Sets the GeoJSON format type used to represent shape.
Expand All @@ -6414,9 +6478,16 @@ export class GeoShape {
* `multipolygon`, `geometrycollection`, `envelope`, `circle`
*/
type(
type: 'point' | 'linestring' | 'polygon' | 'multipoint' |
'multilinestring' | 'multipolygon' | 'geometrycollection' |
'envelope' | 'circle'
type:
| 'point'
| 'linestring'
| 'polygon'
| 'multipoint'
| 'multilinestring'
| 'multipolygon'
| 'geometrycollection'
| 'envelope'
| 'circle'
): this;

/**
Expand Down Expand Up @@ -6454,9 +6525,19 @@ export class GeoShape {
* `multipolygon`, `geometrycollection`, `envelope` and `circle`
* @param {Array=} coords A valid coordinat definition for the given shape.
*/
export function geoShape(type?: 'point' | 'linestring' | 'polygon' | 'multipoint' |
'multilinestring' | 'multipolygon' | 'geometrycollection' |
'envelope' | 'circle', coords?: object): GeoShape;
export function geoShape(
type?:
| 'point'
| 'linestring'
| 'polygon'
| 'multipoint'
| 'multilinestring'
| 'multipolygon'
| 'geometrycollection'
| 'envelope'
| 'circle',
coords?: object
): GeoShape;

/**
* A shape which has already been indexed in another index and/or index
Expand Down
2 changes: 1 addition & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from '../'
export * from '../';

0 comments on commit 31a950c

Please sign in to comment.