Skip to content

Commit 7d8cc2e

Browse files
committed
Tighten public indicator contracts
1 parent 14c93d9 commit 7d8cc2e

6 files changed

Lines changed: 6 additions & 6 deletions

File tree

deno.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rvitaliy/quantix",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "Streaming-first technical indicators in modern TypeScript.",
55
"license": "MIT",
66
"repository": {

src/core/ring-buffer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class RingBuffer<T> {
5656
return this.#values[(this.#cursor + index) % this.capacity];
5757
}
5858

59-
values(): T[] {
59+
values(): ReadonlyArray<T> {
6060
if (this.#size === 0) {
6161
return [];
6262
}

src/indicators/bollinger-bands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class BollingerBands {
7474
}
7575

7676
/** Computes a full Bollinger Bands series from an iterable input. */
77-
static from(values: Iterable<number>, options: BollingerBandsOptions = {}): Array<
77+
static from(values: Iterable<number>, options: BollingerBandsOptions = {}): ReadonlyArray<
7878
BollingerBandsResult | undefined
7979
> {
8080
const indicator = new BollingerBands(options);

src/indicators/rsi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class RSI {
3737
}
3838

3939
/** Computes a full RSI series from an iterable input. */
40-
static from(values: Iterable<number>, options: RSIOptions = {}): Array<number | undefined> {
40+
static from(values: Iterable<number>, options: RSIOptions = {}): ReadonlyArray<number | undefined> {
4141
const indicator = new RSI(options);
4242
return Array.from(values, (value) => indicator.next(value));
4343
}

src/indicators/sma.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class SMA {
5656
}
5757

5858
/** Computes a full SMA series from an iterable input. */
59-
static from(values: Iterable<number>, options: SMAOptions = {}): Array<number | undefined> {
59+
static from(values: Iterable<number>, options: SMAOptions = {}): ReadonlyArray<number | undefined> {
6060
const indicator = new SMA(options);
6161
return Array.from(values, (value) => indicator.next(value));
6262
}

src/indicators/smma.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class SMMA {
5656
}
5757

5858
/** Computes a full SMMA series from an iterable input. */
59-
static from(values: Iterable<number>, options: SMMAOptions = {}): Array<number | undefined> {
59+
static from(values: Iterable<number>, options: SMMAOptions = {}): ReadonlyArray<number | undefined> {
6060
const indicator = new SMMA(options);
6161
return Array.from(values, (value) => indicator.next(value));
6262
}

0 commit comments

Comments
 (0)