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