Commit 3a343aa5 by Ryan McKinley Committed by GitHub

Chore: add more docs annotations (#30847)

parent c9c7bfbc
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[];
......
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'; ...@@ -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> { ...@@ -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[];
......
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) {}
......
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> { ...@@ -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();
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment