@columenlabs/lumen-ui-types 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/chart-formula.d.ts +14 -14
- package/dist/frames.d.ts +5 -5
- package/dist/market.d.ts +2 -2
- package/dist/tasks.d.ts +2 -2
- package/dist/view-formula.d.ts +1 -1
- package/dist/views.d.ts +2209 -1674
- package/dist/views.js +52 -19
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
Lumen's view model: view config, formulas (Jexl), domains and joins, the data catalog, frames, chart formulas and market shapes. It has no React and can be used on a server.
|
|
4
4
|
|
|
5
|
-
See the [Lumen README](https://github.com/columenlabs/lumen#readme). MIT.
|
|
5
|
+
See the [Lumen README](https://github.com/columenlabs/lumen-ui#readme). MIT.
|
package/dist/chart-formula.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
/** The bar fields a formula reads. */
|
|
3
|
-
export declare const FORMULA_FIELDS: readonly [
|
|
3
|
+
export declare const FORMULA_FIELDS: readonly ['open', 'high', 'low', 'close'];
|
|
4
4
|
export type FormulaField = (typeof FORMULA_FIELDS)[number];
|
|
5
5
|
/** Each function's arguments: `x` a series, `n` a window in bars (a whole number written as is). */
|
|
6
6
|
export declare const FORMULA_FUNCTIONS: {
|
|
7
7
|
readonly sma: {
|
|
8
8
|
readonly args: readonly ["x", "n"];
|
|
9
|
-
readonly about:
|
|
9
|
+
readonly about: 'simple moving average';
|
|
10
10
|
};
|
|
11
11
|
readonly ema: {
|
|
12
12
|
readonly args: readonly ["x", "n"];
|
|
13
|
-
readonly about:
|
|
13
|
+
readonly about: 'exponential moving average';
|
|
14
14
|
};
|
|
15
15
|
readonly rsi: {
|
|
16
16
|
readonly args: readonly ["x", "n"];
|
|
@@ -18,48 +18,48 @@ export declare const FORMULA_FUNCTIONS: {
|
|
|
18
18
|
};
|
|
19
19
|
readonly stdev: {
|
|
20
20
|
readonly args: readonly ["x", "n"];
|
|
21
|
-
readonly about:
|
|
21
|
+
readonly about: 'standard deviation over n bars';
|
|
22
22
|
};
|
|
23
23
|
readonly highest: {
|
|
24
24
|
readonly args: readonly ["x", "n"];
|
|
25
|
-
readonly about:
|
|
25
|
+
readonly about: 'highest over n bars';
|
|
26
26
|
};
|
|
27
27
|
readonly lowest: {
|
|
28
28
|
readonly args: readonly ["x", "n"];
|
|
29
|
-
readonly about:
|
|
29
|
+
readonly about: 'lowest over n bars';
|
|
30
30
|
};
|
|
31
31
|
readonly sum: {
|
|
32
32
|
readonly args: readonly ["x", "n"];
|
|
33
|
-
readonly about:
|
|
33
|
+
readonly about: 'sum over n bars';
|
|
34
34
|
};
|
|
35
35
|
readonly ref: {
|
|
36
36
|
readonly args: readonly ["x", "n"];
|
|
37
|
-
readonly about:
|
|
37
|
+
readonly about: 'x n bars ago';
|
|
38
38
|
};
|
|
39
39
|
readonly change: {
|
|
40
40
|
readonly args: readonly ["x", "n"];
|
|
41
|
-
readonly about:
|
|
41
|
+
readonly about: '% change over n bars';
|
|
42
42
|
};
|
|
43
43
|
readonly atr: {
|
|
44
44
|
readonly args: readonly ["n"];
|
|
45
|
-
readonly about:
|
|
45
|
+
readonly about: 'average true range';
|
|
46
46
|
};
|
|
47
47
|
readonly abs: {
|
|
48
48
|
readonly args: readonly ["x"];
|
|
49
|
-
readonly about:
|
|
49
|
+
readonly about: 'absolute value';
|
|
50
50
|
};
|
|
51
51
|
readonly min: {
|
|
52
52
|
readonly args: readonly ["x", "x"];
|
|
53
|
-
readonly about:
|
|
53
|
+
readonly about: 'the lower of two';
|
|
54
54
|
};
|
|
55
55
|
readonly max: {
|
|
56
56
|
readonly args: readonly ["x", "x"];
|
|
57
|
-
readonly about:
|
|
57
|
+
readonly about: 'the higher of two';
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
60
|
export type FormulaFunction = keyof typeof FORMULA_FUNCTIONS;
|
|
61
61
|
/** The chart's catalog (LumenShell's `CHART_INDICATORS`), by id, for checking a spec on the server. */
|
|
62
|
-
export declare const CHART_INDICATOR_IDS: readonly [
|
|
62
|
+
export declare const CHART_INDICATOR_IDS: readonly ['sma_20', 'sma_50', 'sma_200', 'ema_9', 'ema_21', 'ema_50', 'bollinger', 'high_low_52w', 'rsi_14', 'macd', 'atr_14', 'rel_volume_20', 'vwap_distance', 'pe_trailing', 'pe_forward', 'iv30', 'est_eps'];
|
|
63
63
|
export type ChartIndicatorId = (typeof CHART_INDICATOR_IDS)[number];
|
|
64
64
|
/** A window: 1 to 400 bars, like an app's indicators. */
|
|
65
65
|
export declare const MAX_FORMULA_WINDOW = 400;
|
package/dist/frames.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare const FRAME_COLUMNS = 50;
|
|
|
9
9
|
/** Most hand edits a frame keeps (the latest per cell); past it the oldest go. */
|
|
10
10
|
export declare const FRAME_EDITS = 500;
|
|
11
11
|
/** The formats a frame column can carry; the assistant may set one, else number or text. */
|
|
12
|
-
export declare const FRAME_FORMATS: readonly [
|
|
12
|
+
export declare const FRAME_FORMATS: readonly ['number', 'rounded', 'compact', 'integer', 'price', 'price_rounded', 'price_signed', 'percent', 'weight', 'signed', 'text', 'amount', 'amount_signed', 'quantity'];
|
|
13
13
|
export type FrameFormat = (typeof FRAME_FORMATS)[number];
|
|
14
14
|
export declare function frameFormat(f: FrameFormat): {
|
|
15
15
|
format: ViewFormat;
|
|
@@ -133,11 +133,11 @@ export type FrameEditInput = z.infer<typeof frameEditSchema>;
|
|
|
133
133
|
/** A field key from a column name: `Day %` → `day_pct`. */
|
|
134
134
|
export declare function columnKey(name: string, taken: Set<string>): string;
|
|
135
135
|
/** The columns that make a frame's rows carry a symbol key (the registry's Symbol join). */
|
|
136
|
-
export declare const SYMBOL_COLUMNS: readonly [
|
|
136
|
+
export declare const SYMBOL_COLUMNS: readonly ['symbol', 'ticker', 'underlying'];
|
|
137
137
|
/** The columns that make a frame's rows carry an account key (the registry's Account join). */
|
|
138
|
-
export declare const ACCOUNT_COLUMNS: readonly [
|
|
138
|
+
export declare const ACCOUNT_COLUMNS: readonly ['account', 'account_id'];
|
|
139
139
|
/** The frame's column for a join key, if it has one: a text column named like that key. */
|
|
140
|
-
export declare const frameKeyAt: (meta: Pick<FrameMeta,
|
|
140
|
+
export declare const frameKeyAt: (meta: Pick<FrameMeta, 'columns'>, key: JoinKey) => number;
|
|
141
141
|
/**
|
|
142
142
|
* Columns a frame with a symbol column must not carry where the app has a live feed (a price in a frame freezes): the card's Symbol join fills live Price and Day % by
|
|
143
143
|
* itself. Keys as `columnKey` makes them; a dated price goes in under its own name (`close_q3`).
|
|
@@ -146,7 +146,7 @@ export declare const LIVE_QUOTE_COLUMNS: Record<string, 'price' | 'change_pct'>;
|
|
|
146
146
|
/** The live quote columns a frame carries that its Symbol join already gives. */
|
|
147
147
|
export declare function liveQuoteColumns(columns: FrameColumn[]): FrameColumn[];
|
|
148
148
|
/** The frame's symbol column, if it has one: a text column named like a ticker column. */
|
|
149
|
-
export declare const frameSymbolAt: (meta: Pick<FrameMeta,
|
|
149
|
+
export declare const frameSymbolAt: (meta: Pick<FrameMeta, 'columns'>) => number;
|
|
150
150
|
/** The key column a Your data frame starts with, for a join key. */
|
|
151
151
|
export declare const yourKeyColumn: (key: JoinKey) => FrameColumn;
|
|
152
152
|
/**
|
package/dist/market.d.ts
CHANGED
|
@@ -105,7 +105,7 @@ export type MarketServerMessage = {
|
|
|
105
105
|
at: number;
|
|
106
106
|
};
|
|
107
107
|
/** Chart dialog windows. */
|
|
108
|
-
export declare const marketWindows: readonly [
|
|
108
|
+
export declare const marketWindows: readonly ['1D', '5D', '1M', '6M', 'YTD', '1Y', '5Y', 'Max'];
|
|
109
109
|
export type MarketWindow = (typeof marketWindows)[number];
|
|
110
110
|
/** `GET /api/v1/market/bars?symbol=&window=`: one symbol's history over a window. */
|
|
111
111
|
export interface MarketBarsResponse {
|
|
@@ -127,7 +127,7 @@ export interface MarketBarsResponse {
|
|
|
127
127
|
* Indicator lines bars cannot give, read from the warehouse once when the person adds one to the
|
|
128
128
|
* chart: P/E trailing and forward, IV 30d, the EPS estimate.
|
|
129
129
|
*/
|
|
130
|
-
export declare const SOURCED_INDICATORS: readonly [
|
|
130
|
+
export declare const SOURCED_INDICATORS: readonly ['pe_trailing', 'pe_forward', 'iv30', 'est_eps'];
|
|
131
131
|
export type SourcedIndicator = (typeof SOURCED_INDICATORS)[number];
|
|
132
132
|
export declare const isSourcedIndicator: (s: string) => s is SourcedIndicator;
|
|
133
133
|
/** `GET /api/v1/market/indicators?symbol=&names=`: one symbol's sourced lines, `[t, value]` a day. */
|
package/dist/tasks.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Search, a Sweep, a backfill, a sync). Every app shows them in the header's Tasks list; the engines
|
|
5
5
|
* keep their own internals and only report here.
|
|
6
6
|
*/
|
|
7
|
-
export declare const TASK_STATES: readonly [
|
|
7
|
+
export declare const TASK_STATES: readonly ['queued', 'running', 'done', 'failed', 'cancelled'];
|
|
8
8
|
export type TaskState = (typeof TASK_STATES)[number];
|
|
9
9
|
export interface Task {
|
|
10
10
|
id: string;
|
|
@@ -42,4 +42,4 @@ export interface TaskList {
|
|
|
42
42
|
/** Ended and not seen yet. */
|
|
43
43
|
unseen: number;
|
|
44
44
|
}
|
|
45
|
-
export declare const isActive: (t: Pick<Task,
|
|
45
|
+
export declare const isActive: (t: Pick<Task, 'state'>) => boolean;
|
package/dist/view-formula.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export interface ViewFormulaScope {
|
|
|
5
5
|
groupSum: (key: string) => number;
|
|
6
6
|
totalSum: (key: string) => number;
|
|
7
7
|
}
|
|
8
|
-
export declare const viewFormulaFunctions: readonly [
|
|
8
|
+
export declare const viewFormulaFunctions: readonly ['group_sum', 'total_sum'];
|
|
9
9
|
/** Compiles a formula (throws on a syntax error) into a row evaluator; a failed row is null. */
|
|
10
10
|
export declare function compileViewFormula(expr: string): (scope: ViewFormulaScope) => number | string | null;
|
|
11
11
|
/**
|