mirror of
https://github.com/grafana/grafana.git
synced 2026-07-30 00:08:10 -05:00
Chore: add more docs annotations (#30847)
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { MutableVector } from '../types/vector';
|
||||
import { FunctionalVector } from './FunctionalVector';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export class ArrayVector<T = any> extends FunctionalVector<T> implements MutableVector<T> {
|
||||
buffer: T[];
|
||||
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import { Vector } from '../types';
|
||||
import { FunctionalVector } from './FunctionalVector';
|
||||
|
||||
/**
|
||||
* This will force all values to be numbers
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export class AsNumberVector extends FunctionalVector<number> {
|
||||
constructor(private field: Vector) {
|
||||
super();
|
||||
|
||||
@@ -2,6 +2,9 @@ import { Vector } from '../types/vector';
|
||||
import { vectorToArray } from './vectorToArray';
|
||||
import { BinaryOperation } from '../utils/binaryOperators';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export class BinaryOperationVector implements Vector<number> {
|
||||
constructor(private left: Vector<number>, private right: Vector<number>, private operation: BinaryOperation) {}
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ interface CircularOptions<T> {
|
||||
*
|
||||
* This supports adding to the 'head' or 'tail' and will grow the buffer
|
||||
* to match a configured capacity.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export class CircularVector<T = any> extends FunctionalVector<T> implements MutableVector<T> {
|
||||
private buffer: T[];
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { Vector } from '../types/vector';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export class ConstantVector<T = any> implements Vector<T> {
|
||||
constructor(private value: T, private len: number) {}
|
||||
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
import { Vector } from '../types/vector';
|
||||
import { DisplayProcessor } from '../types';
|
||||
import { formattedValueToString } from '../valueFormats';
|
||||
import { vectorToArray } from './vectorToArray';
|
||||
import { FunctionalVector } from './FunctionalVector';
|
||||
|
||||
export class FormattedVector<T = any> implements Vector<string> {
|
||||
constructor(private source: Vector<T>, private formatter: DisplayProcessor) {}
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export class FormattedVector<T = any> extends FunctionalVector<string> {
|
||||
constructor(private source: Vector<T>, private formatter: DisplayProcessor) {
|
||||
super();
|
||||
}
|
||||
|
||||
get length() {
|
||||
return this.source.length;
|
||||
@@ -14,12 +19,4 @@ export class FormattedVector<T = any> implements Vector<string> {
|
||||
const v = this.source.get(index);
|
||||
return formattedValueToString(this.formatter(v));
|
||||
}
|
||||
|
||||
toArray(): string[] {
|
||||
return vectorToArray(this);
|
||||
}
|
||||
|
||||
toJSON(): string[] {
|
||||
return this.toArray();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user