mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-26 09:44:45 -07:00
kibo: move types around
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,3 +0,0 @@
|
||||
URL + Version:
|
||||
|
||||
https://unpkg.com/browse/lightweight-charts@latest/
|
||||
@@ -1,117 +0,0 @@
|
||||
import { Signal } from "../solid-signals/types";
|
||||
import { Accessor } from "../solid-signals/v0.2.4-treeshaked/types/signals";
|
||||
import {
|
||||
DeepPartial,
|
||||
BaselineStyleOptions,
|
||||
CandlestickStyleOptions,
|
||||
LineStyleOptions,
|
||||
SeriesOptionsCommon,
|
||||
Time,
|
||||
ISeriesApi,
|
||||
BaselineData,
|
||||
} from "./v5.0.5-treeshaked/types";
|
||||
import { VecId } from "../../scripts/vecid-to-indexes";
|
||||
|
||||
interface BaseSeriesBlueprint {
|
||||
title: string;
|
||||
defaultActive?: boolean;
|
||||
}
|
||||
interface BaselineSeriesBlueprint extends BaseSeriesBlueprint {
|
||||
type: "Baseline";
|
||||
color?: Color;
|
||||
options?: DeepPartial<BaselineStyleOptions & SeriesOptionsCommon>;
|
||||
data?: Accessor<BaselineData<Time>[]>;
|
||||
}
|
||||
interface CandlestickSeriesBlueprint extends BaseSeriesBlueprint {
|
||||
type: "Candlestick";
|
||||
color?: Color;
|
||||
options?: DeepPartial<CandlestickStyleOptions & SeriesOptionsCommon>;
|
||||
data?: Accessor<CandlestickData[]>;
|
||||
}
|
||||
interface LineSeriesBlueprint extends BaseSeriesBlueprint {
|
||||
type?: "Line";
|
||||
color: Color;
|
||||
options?: DeepPartial<LineStyleOptions & SeriesOptionsCommon>;
|
||||
data?: Accessor<LineData<Time>[]>;
|
||||
}
|
||||
type AnySpecificSeriesBlueprint =
|
||||
| BaselineSeriesBlueprint
|
||||
| CandlestickSeriesBlueprint
|
||||
| LineSeriesBlueprint;
|
||||
|
||||
type SeriesType = NonNullable<AnySpecificSeriesBlueprint["type"]>;
|
||||
type PriceSeriesType = "Candlestick" | "Line";
|
||||
|
||||
type RemoveSeriesBlueprintFluff<Blueprint extends AnySpecificSeriesBlueprint> =
|
||||
Omit<Blueprint, "type" | "title">;
|
||||
|
||||
type SplitSeriesBlueprint<> = {
|
||||
key: VecId;
|
||||
} & AnySpecificSeriesBlueprint;
|
||||
|
||||
type SingleSeriesBlueprint = AnySpecificSeriesBlueprint;
|
||||
|
||||
interface CreateBaseSeriesParameters extends BaseSeriesBlueprint {
|
||||
id: string;
|
||||
disabled?: Accessor<boolean>;
|
||||
color?: Color;
|
||||
}
|
||||
interface BaseSeries {
|
||||
id: string;
|
||||
title: string;
|
||||
color: Color | Color[];
|
||||
active: Signal<boolean>;
|
||||
visible: Accessor<boolean>;
|
||||
}
|
||||
interface SingleSeries extends BaseSeries {
|
||||
iseries: ISeriesApi<SeriesType>;
|
||||
dataset: Accessor<(SingleValueData | CandlestickData)[] | null>;
|
||||
}
|
||||
interface SplitSeries extends BaseSeries {
|
||||
chunks: Array<Accessor<ISeriesApi<SeriesType> | undefined>>;
|
||||
// dataset: ResourceDataset<number>;
|
||||
}
|
||||
type AnySeries = SingleSeries | SplitSeries;
|
||||
|
||||
interface CreateSingleSeriesParameters {
|
||||
blueprint: SingleSeriesBlueprint;
|
||||
id: string;
|
||||
}
|
||||
|
||||
interface CreateSplitSeriesParameters {
|
||||
// dataset: ResourceDataset;
|
||||
blueprint: SplitSeriesBlueprint;
|
||||
id: string;
|
||||
index: number;
|
||||
disabled?: Accessor<boolean>;
|
||||
}
|
||||
|
||||
type ChartPane = IChartApi & {
|
||||
whitespace: ISeriesApi<"Line">;
|
||||
hidden: () => boolean;
|
||||
setHidden: (b: boolean) => void;
|
||||
setInitialVisibleTimeRange: VoidFunction;
|
||||
createSingleSeries: (a: CreateSingleSeriesParameters) => SingleSeries;
|
||||
createSplitSeries: (a: CreateSplitSeriesParameters) => SplitSeries[];
|
||||
anySeries: AnySeries[];
|
||||
singleSeries: SingleSeries[];
|
||||
splitSeries: SplitSeries[];
|
||||
remove: VoidFunction;
|
||||
};
|
||||
|
||||
interface CreatePaneParameters {
|
||||
options?: DeepPartial<ChartOptions>;
|
||||
config?: SingleSeriesBlueprint[];
|
||||
}
|
||||
|
||||
interface Marker {
|
||||
weight: number;
|
||||
time: Time;
|
||||
value: number;
|
||||
seriesChunk: ISeriesApi<SeriesType>;
|
||||
}
|
||||
|
||||
interface HoveredLegend {
|
||||
label: HTMLLabelElement;
|
||||
series: AnySeries;
|
||||
}
|
||||
@@ -1,6 +1,26 @@
|
||||
// @ts-check
|
||||
|
||||
/** @import {IChartApi, ISeriesApi, SeriesDefinition} from './v5.0.5-treeshaked/types' */
|
||||
/** @import {IChartApi, ISeriesApi, SeriesDefinition, SingleValueData as _SingleValueData, CandlestickData as _CandlestickData} from './v5.0.5-treeshaked/types' */
|
||||
|
||||
/**
|
||||
* @typedef {[number, number, number, number]} OHLCTuple
|
||||
*
|
||||
* @typedef {Object} Valued
|
||||
* @property {number} value
|
||||
*
|
||||
* @typedef {Object} Indexed
|
||||
* @property {number} index
|
||||
*/
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @typedef {T & Valued & Indexed} ChartData<T>
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {ChartData<_SingleValueData>} SingleValueData
|
||||
* @typedef {ChartData<_CandlestickData>} CandlestickData
|
||||
*/
|
||||
|
||||
export default import("./v5.0.5-treeshaked/script.js").then((lc) => {
|
||||
const oklchToRGBA = createOklchToRGBA();
|
||||
@@ -752,6 +772,7 @@ function createPriceScaleSelectorIfNeeded({
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
const field = utils.dom.createHorizontalChoiceField({
|
||||
title: unit,
|
||||
selected: serializedValue(),
|
||||
@@ -759,6 +780,7 @@ function createPriceScaleSelectorIfNeeded({
|
||||
id: unit,
|
||||
signals,
|
||||
});
|
||||
|
||||
field.addEventListener("change", (event) => {
|
||||
// @ts-ignore
|
||||
const value = event.target.value;
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
Compiled version of: https://github.com/solidjs/signals/commits/main/
|
||||
|
||||
Head:
|
||||
- SHA: 4d75d3f84ce22b560988f3b27a5065c0fd2e69a8
|
||||
- Date: Apr 17, 2024
|
||||
@@ -1,8 +1,8 @@
|
||||
// @ts-check
|
||||
|
||||
/**
|
||||
* @import { Option, Weighted, Color, DatasetCandlestickData, PartialChartOption, ChartOption, AnyPartialOption, ProcessedOptionAddons, OptionsTree, SimulationOption, Valued, SingleValueData, CandlestickData, ChartData, OHLCTuple, Unit } from "./types/self"
|
||||
* @import { Marker, CreatePaneParameters, HoveredLegend, ChartPane, SplitSeries, SingleSeries, CreateSplitSeriesParameters, LineSeriesBlueprint, CandlestickSeriesBlueprint, BaselineSeriesBlueprint, CreateBaseSeriesParameters, BaseSeries, RemoveSeriesBlueprintFluff, SplitSeriesBlueprint, AnySeries, PriceSeriesType } from "../packages/lightweight-charts/types";
|
||||
* @import { Option, PartialChartOption, ChartOption, AnyPartialOption, ProcessedOptionAddons, OptionsTree, SimulationOption, Unit } from "./types/self"
|
||||
* @import {Valued, SingleValueData, CandlestickData, ChartData, OHLCTuple} from "../packages/lightweight-charts/wrapper"
|
||||
* @import * as _ from "../packages/ufuzzy/v1.0.14/types"
|
||||
* @import { createChart as CreateClassicChart, LineStyleOptions, DeepPartial, ChartOptions, IChartApi, IHorzScaleBehavior, WhitespaceData, ISeriesApi, Time, LineData, LogicalRange, SeriesType, BaselineStyleOptions, SeriesOptionsCommon } from "../packages/lightweight-charts/v5.0.5-treeshaked/types"
|
||||
* @import { SignalOptions } from "../packages/solid-signals/v0.2.4-treeshaked/types/core/core"
|
||||
@@ -885,12 +885,12 @@ function createUtils() {
|
||||
return v ? Number(v) : null;
|
||||
},
|
||||
},
|
||||
date: {
|
||||
optDate: {
|
||||
/**
|
||||
* @param {Date} v
|
||||
* @param {Date | null} date
|
||||
*/
|
||||
serialize(v) {
|
||||
return date.toString(v);
|
||||
serialize(date) {
|
||||
return date !== null ? date.toString() : "";
|
||||
},
|
||||
/**
|
||||
* @param {string} v
|
||||
@@ -1609,6 +1609,8 @@ function createColors(dark, elements) {
|
||||
}
|
||||
/**
|
||||
* @typedef {ReturnType<typeof createColors>} Colors
|
||||
* @typedef {Colors["orange"]} Color
|
||||
* @typedef {keyof Colors} ColorName
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -1676,7 +1678,7 @@ function initWebSockets(signals, utils) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {(candle: DatasetCandlestickData) => void} callback
|
||||
* @param {(candle: CandlestickData) => void} callback
|
||||
* @param {number} interval
|
||||
*/
|
||||
function krakenCandleWebSocketCreator(callback, interval) {
|
||||
@@ -1706,7 +1708,7 @@ function initWebSockets(signals, utils) {
|
||||
|
||||
const dateStr = utils.date.toString(date);
|
||||
|
||||
/** @type {DatasetCandlestickData} */
|
||||
/** @type {CandlestickData} */
|
||||
const candle = {
|
||||
index: -1,
|
||||
time: dateStr,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/**
|
||||
* @import { CohortOption, CohortOptions, Color, DefaultCohortOption, DefaultCohortOptions, OptionsGroup, PartialChartOption, PartialOptionsGroup, PartialOptionsTree, RatioOption, RatioOptions, Unit } from "./types/self"
|
||||
* @import {AnySpecificSeriesBlueprint, SplitSeriesBlueprint} from '../packages/lightweight-charts/types';
|
||||
* @import { AnySeriesBlueprint} from '../packages/lightweight-charts/wrapper';
|
||||
*/
|
||||
|
||||
function initGroups() {
|
||||
@@ -2815,7 +2815,7 @@ function createPartialOptions(colors) {
|
||||
// generateSeriesBlueprints(arg, blueprint) {
|
||||
// return this.toList(arg).map(
|
||||
// ({ scale, datasetId, color, name }) =>
|
||||
// /** @satisfies {SplitSeriesBlueprint} */ ({
|
||||
// /** @satisfies {AnySeriesBlueprint} */ ({
|
||||
// title: cohortOptionOrOptions.toLegendName(
|
||||
// arg,
|
||||
// name,
|
||||
@@ -5159,7 +5159,7 @@ export function initOptions({
|
||||
const optionsIds = env.localhost ? [] : undefined;
|
||||
|
||||
// /**
|
||||
// * @param {SplitSeriesBlueprint[]} array
|
||||
// * @param {AnySeriesBlueprint[]} array
|
||||
// */
|
||||
// function getMainIdFromBlueprints(array) {
|
||||
// const searchArray = array.filter(
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
*/
|
||||
export function init({ colors, elements, lightweightCharts, signals, utils }) {
|
||||
/**
|
||||
* @import { ColorName } from './types/self';
|
||||
*
|
||||
* @typedef {Object} Frequency
|
||||
* @property {string} name
|
||||
* @property {string} value
|
||||
@@ -151,7 +149,7 @@ export function init({ colors, elements, lightweightCharts, signals, utils }) {
|
||||
initial: {
|
||||
amount: signals.createSignal(/** @type {number | null} */ (1000), {
|
||||
save: {
|
||||
...utils.serde.number,
|
||||
...utils.serde.optNumber,
|
||||
keyPrefix,
|
||||
key: "initial-amount",
|
||||
},
|
||||
@@ -160,7 +158,7 @@ export function init({ colors, elements, lightweightCharts, signals, utils }) {
|
||||
topUp: {
|
||||
amount: signals.createSignal(/** @type {number | null} */ (150), {
|
||||
save: {
|
||||
...utils.serde.number,
|
||||
...utils.serde.optNumber,
|
||||
keyPrefix,
|
||||
key: "top-up-amount",
|
||||
},
|
||||
@@ -181,14 +179,14 @@ export function init({ colors, elements, lightweightCharts, signals, utils }) {
|
||||
investment: {
|
||||
initial: signals.createSignal(/** @type {number | null} */ (1000), {
|
||||
save: {
|
||||
...utils.serde.number,
|
||||
...utils.serde.optNumber,
|
||||
keyPrefix,
|
||||
key: "initial-swap",
|
||||
},
|
||||
}),
|
||||
recurrent: signals.createSignal(/** @type {number | null} */ (5), {
|
||||
save: {
|
||||
...utils.serde.number,
|
||||
...utils.serde.optNumber,
|
||||
keyPrefix,
|
||||
key: "recurrent-swap",
|
||||
},
|
||||
@@ -210,7 +208,7 @@ export function init({ colors, elements, lightweightCharts, signals, utils }) {
|
||||
/** @type {Date | null} */ (new Date("2021-04-15")),
|
||||
{
|
||||
save: {
|
||||
...utils.serde.date,
|
||||
...utils.serde.optDate,
|
||||
keyPrefix,
|
||||
key: "interval-start",
|
||||
},
|
||||
@@ -218,7 +216,7 @@ export function init({ colors, elements, lightweightCharts, signals, utils }) {
|
||||
),
|
||||
end: signals.createSignal(/** @type {Date | null} */ (new Date()), {
|
||||
save: {
|
||||
...utils.serde.date,
|
||||
...utils.serde.optDate,
|
||||
keyPrefix,
|
||||
key: "interval-end",
|
||||
},
|
||||
@@ -227,7 +225,7 @@ export function init({ colors, elements, lightweightCharts, signals, utils }) {
|
||||
fees: {
|
||||
percentage: signals.createSignal(/** @type {number | null} */ (0.25), {
|
||||
save: {
|
||||
...utils.serde.number,
|
||||
...utils.serde.optNumber,
|
||||
keyPrefix,
|
||||
key: "percentage",
|
||||
},
|
||||
@@ -545,8 +543,7 @@ export function init({ colors, elements, lightweightCharts, signals, utils }) {
|
||||
signals,
|
||||
colors,
|
||||
id: `simulation-0`,
|
||||
kind: "static",
|
||||
scale: "date",
|
||||
fitContentOnResize: true,
|
||||
utils,
|
||||
config: [
|
||||
{
|
||||
@@ -586,8 +583,7 @@ export function init({ colors, elements, lightweightCharts, signals, utils }) {
|
||||
signals,
|
||||
colors,
|
||||
id: `simulation-1`,
|
||||
scale: "date",
|
||||
kind: "static",
|
||||
fitContentOnResize: true,
|
||||
utils,
|
||||
config: [
|
||||
{
|
||||
@@ -609,8 +605,7 @@ export function init({ colors, elements, lightweightCharts, signals, utils }) {
|
||||
signals,
|
||||
colors,
|
||||
id: `simulation-average-price`,
|
||||
scale: "date",
|
||||
kind: "static",
|
||||
fitContentOnResize: true,
|
||||
utils,
|
||||
config: [
|
||||
{
|
||||
@@ -638,8 +633,7 @@ export function init({ colors, elements, lightweightCharts, signals, utils }) {
|
||||
signals,
|
||||
colors,
|
||||
id: `simulation-return-ratio`,
|
||||
scale: "date",
|
||||
kind: "static",
|
||||
fitContentOnResize: true,
|
||||
utils,
|
||||
config: [
|
||||
{
|
||||
@@ -670,8 +664,7 @@ export function init({ colors, elements, lightweightCharts, signals, utils }) {
|
||||
signals,
|
||||
colors,
|
||||
id: `simulation-profitability-ratios`,
|
||||
kind: "static",
|
||||
scale: "date",
|
||||
fitContentOnResize: true,
|
||||
utils,
|
||||
owner,
|
||||
config: [
|
||||
@@ -939,36 +932,43 @@ export function init({ colors, elements, lightweightCharts, signals, utils }) {
|
||||
|
||||
p3.innerHTML = `You would've been ${serProfitableDaysRatio} of the time profitable and ${serUnprofitableDaysRatio} of the time unprofitable.`;
|
||||
|
||||
signals.createEffect(lastValues, (lastValues) => {
|
||||
const lowestAnnual4YReturn = 0.2368;
|
||||
// const lowestAnnual4YReturn = lastValues?.["price-4y-compound-return"] || 0
|
||||
const serLowestAnnual4YReturn = c(
|
||||
"cyan",
|
||||
`${fp(lowestAnnual4YReturn)}`,
|
||||
);
|
||||
|
||||
const lowestAnnual4YReturnPercentage = 1 + lowestAnnual4YReturn;
|
||||
/**
|
||||
* @param {number} power
|
||||
*/
|
||||
function bitcoinValueReturn(power) {
|
||||
return (
|
||||
bitcoinValue * Math.pow(lowestAnnual4YReturnPercentage, power)
|
||||
signals.createEffect(
|
||||
() => 0.2368,
|
||||
(lowestAnnual4YReturn) => {
|
||||
const serLowestAnnual4YReturn = c(
|
||||
"cyan",
|
||||
`${fp(lowestAnnual4YReturn)}`,
|
||||
);
|
||||
}
|
||||
const bitcoinValueAfter4y = bitcoinValueReturn(4);
|
||||
const serBitcoinValueAfter4y = c("purple", fd(bitcoinValueAfter4y));
|
||||
const bitcoinValueAfter10y = bitcoinValueReturn(10);
|
||||
const serBitcoinValueAfter10y = c(
|
||||
"fuchsia",
|
||||
fd(bitcoinValueAfter10y),
|
||||
);
|
||||
const bitcoinValueAfter21y = bitcoinValueReturn(21);
|
||||
const serBitcoinValueAfter21y = c("pink", fd(bitcoinValueAfter21y));
|
||||
|
||||
/** @param {number} v */
|
||||
p4.innerHTML = `The lowest annual return after 4 years has historically been ${serLowestAnnual4YReturn}.<br/>Using it as the baseline, your Bitcoin would be worth ${serBitcoinValueAfter4y} after 4 years, ${serBitcoinValueAfter10y} after 10 years and ${serBitcoinValueAfter21y} after 21 years.`;
|
||||
});
|
||||
const lowestAnnual4YReturnPercentage = 1 + lowestAnnual4YReturn;
|
||||
/**
|
||||
* @param {number} power
|
||||
*/
|
||||
function bitcoinValueReturn(power) {
|
||||
return (
|
||||
bitcoinValue * Math.pow(lowestAnnual4YReturnPercentage, power)
|
||||
);
|
||||
}
|
||||
const bitcoinValueAfter4y = bitcoinValueReturn(4);
|
||||
const serBitcoinValueAfter4y = c(
|
||||
"purple",
|
||||
fd(bitcoinValueAfter4y),
|
||||
);
|
||||
const bitcoinValueAfter10y = bitcoinValueReturn(10);
|
||||
const serBitcoinValueAfter10y = c(
|
||||
"fuchsia",
|
||||
fd(bitcoinValueAfter10y),
|
||||
);
|
||||
const bitcoinValueAfter21y = bitcoinValueReturn(21);
|
||||
const serBitcoinValueAfter21y = c(
|
||||
"pink",
|
||||
fd(bitcoinValueAfter21y),
|
||||
);
|
||||
|
||||
/** @param {number} v */
|
||||
p4.innerHTML = `The lowest annual return after 4 years has historically been ${serLowestAnnual4YReturn}.<br/>Using it as the baseline, your Bitcoin would be worth ${serBitcoinValueAfter4y} after 4 years, ${serBitcoinValueAfter10y} after 10 years and ${serBitcoinValueAfter21y} after 21 years.`;
|
||||
},
|
||||
);
|
||||
|
||||
totalInvestedAmountData.set((a) => a);
|
||||
bitcoinValueData.set((a) => a);
|
||||
|
||||
79
websites/kibo.money/scripts/types/self.d.ts
vendored
79
websites/kibo.money/scripts/types/self.d.ts
vendored
@@ -1,28 +1,17 @@
|
||||
import {
|
||||
Accessor,
|
||||
Setter,
|
||||
} from "../../packages/solid-signals/v0.2.4-treeshaked/types/signals";
|
||||
import { Accessor } from "../../packages/solid-signals/v0.2.4-treeshaked/types/signals";
|
||||
import {
|
||||
DeepPartial,
|
||||
BaselineStyleOptions,
|
||||
CandlestickStyleOptions,
|
||||
LineStyleOptions,
|
||||
SeriesOptionsCommon,
|
||||
IRange,
|
||||
Time,
|
||||
SingleValueData as _SingleValueData,
|
||||
CandlestickData as _CandlestickData,
|
||||
SeriesType,
|
||||
ISeriesApi,
|
||||
BaselineData,
|
||||
} from "../../packages/lightweight-charts/v5.0.5-treeshaked/types";
|
||||
import { AnyPossibleCohortId, Groups } from "../options";
|
||||
import { AnyPossibleCohortId } from "../options";
|
||||
|
||||
type Color = () => string;
|
||||
type ColorName = keyof Colors;
|
||||
|
||||
// TODO: Compute from VecId when displaying the Unit
|
||||
// And write a checker when localhost, similar to the dup one
|
||||
type Unit =
|
||||
| ""
|
||||
| "Bitcoin"
|
||||
@@ -47,11 +36,39 @@ interface PartialOption {
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface BaseSeriesBlueprint {
|
||||
title: string;
|
||||
key: VecId;
|
||||
defaultActive?: boolean;
|
||||
}
|
||||
interface BaselineSeriesBlueprint extends BaseSeriesBlueprint {
|
||||
type: "Baseline";
|
||||
color?: Color;
|
||||
options?: DeepPartial<BaselineStyleOptions & SeriesOptionsCommon>;
|
||||
data?: Accessor<BaselineData<Time>[]>;
|
||||
}
|
||||
interface CandlestickSeriesBlueprint extends BaseSeriesBlueprint {
|
||||
type: "Candlestick";
|
||||
color?: Color;
|
||||
options?: DeepPartial<CandlestickStyleOptions & SeriesOptionsCommon>;
|
||||
data?: Accessor<CandlestickData[]>;
|
||||
}
|
||||
interface LineSeriesBlueprint extends BaseSeriesBlueprint {
|
||||
type?: "Line";
|
||||
color: Color;
|
||||
options?: DeepPartial<LineStyleOptions & SeriesOptionsCommon>;
|
||||
data?: Accessor<LineData<Time>[]>;
|
||||
}
|
||||
type AnySeriesBlueprint =
|
||||
| BaselineSeriesBlueprint
|
||||
| CandlestickSeriesBlueprint
|
||||
| LineSeriesBlueprint;
|
||||
|
||||
interface PartialChartOption extends PartialOption {
|
||||
title?: string;
|
||||
unit?: Unit;
|
||||
top?: SplitSeriesBlueprint[];
|
||||
bottom?: SplitSeriesBlueprint[];
|
||||
top?: AnySeriesBlueprint[];
|
||||
bottom?: AnySeriesBlueprint[];
|
||||
}
|
||||
|
||||
interface PartialSimulationOption extends PartialOption {
|
||||
@@ -105,34 +122,6 @@ interface OptionsGroup extends PartialOptionsGroup {
|
||||
tree: OptionsTree;
|
||||
}
|
||||
|
||||
type OHLCTuple = [number, number, number, number];
|
||||
|
||||
interface Valued {
|
||||
value: number;
|
||||
}
|
||||
interface Indexed {
|
||||
index: number;
|
||||
}
|
||||
type ChartData<T> = T & Valued & Indexed;
|
||||
type SingleValueData = ChartData<_SingleValueData>;
|
||||
type CandlestickData = ChartData<_CandlestickData>;
|
||||
|
||||
type FetchedSource = string;
|
||||
|
||||
interface FetchedChunk {
|
||||
id: number;
|
||||
previous: string | null;
|
||||
next: string | null;
|
||||
}
|
||||
|
||||
interface Weighted {
|
||||
weight: number;
|
||||
}
|
||||
|
||||
type DatasetCandlestickData = ChartData<CandlestickData>;
|
||||
|
||||
// type NotFunction<T> = T extends Function ? never : T;
|
||||
|
||||
type DefaultCohortOption = CohortOption<AnyPossibleCohortId>;
|
||||
|
||||
interface CohortOption<Id extends AnyPossibleCohortId> {
|
||||
@@ -162,7 +151,3 @@ interface RatioOptions {
|
||||
title: string;
|
||||
list: RatioOption[];
|
||||
}
|
||||
|
||||
// TODO: Remove
|
||||
// Fetch last of each individually when in viewport
|
||||
// type LastValues = Record<LastPath, number> | null;
|
||||
|
||||
Reference in New Issue
Block a user