@rotorjs/dashboard 0.6.0 → 0.7.1

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.
@@ -11,16 +11,14 @@ export type DashboardStateReducerMap<Engine extends DashboardEngine = DashboardE
11
11
  [type: string]: DashboardStateReducerConfig<Engine>;
12
12
  };
13
13
  export type DashboardEngineInit = {
14
- vars?: {
15
- [name: string]: DashboardVar;
16
- };
17
- facts?: {
18
- [name: string]: DashboardFact;
19
- };
14
+ vars?: readonly [name: string, value: DashboardVar][];
15
+ facts?: readonly [name: string, value: DashboardFact][];
20
16
  };
21
17
  export declare class DashboardEngine extends StateEngine<DashboardStateDescriptor, DashboardState, DashboardAction, DashboardEventTarget> {
22
18
  #private;
23
19
  constructor(target: DashboardEventTarget, reducerInit: DashboardStateReducerMap, init?: DashboardEngineInit);
20
+ get vars(): readonly [name: string, value: DashboardVar][];
21
+ get facts(): readonly [name: string, value: DashboardFact][];
24
22
  hasVar(name: string): boolean;
25
23
  getVar(name: string): DashboardVar | undefined;
26
24
  hasFact(name: string): boolean;
@@ -3,12 +3,8 @@ import { DashboardEventTarget } from './DashboardEventTarget';
3
3
  import { DashboardFact } from './DashboardFact';
4
4
  import { DashboardVar } from './DashboardVar';
5
5
  export type DashboardEnvironmentInit = {
6
- vars?: {
7
- [name: string]: DashboardVar;
8
- };
9
- facts?: {
10
- [name: string]: DashboardFact;
11
- };
6
+ vars?: readonly [name: string, value: DashboardVar][];
7
+ facts?: readonly [name: string, value: DashboardFact][];
12
8
  };
13
9
  export declare class DashboardEnvironment extends TypedEventTarget<{
14
10
  var: VarEvent;
package/dist/main.js CHANGED
@@ -11,7 +11,7 @@ var c = class extends a {
11
11
  #a;
12
12
  #o = new AbortController();
13
13
  constructor(t, n) {
14
- super(), this.#e = t, this.#n = Object.fromEntries(Object.entries(n?.vars ?? {}).map(([e, t]) => [e, Object.freeze(t)])), this.#i = Object.fromEntries(Object.entries(n?.facts ?? {}).map(([e, t]) => [e, Object.freeze(t)]));
14
+ super(), this.#e = t, this.#n = Object.fromEntries(n?.vars?.map(([e, t]) => [e, Object.freeze(t)]) ?? []), this.#i = Object.fromEntries(n?.facts?.map(([e, t]) => [e, Object.freeze(t)]) ?? []);
15
15
  let r = this.signal;
16
16
  this.target.addEventListener("action", (t) => {
17
17
  if (t.emitter === this.#t) return;
@@ -135,6 +135,12 @@ var p = class extends n {
135
135
  this.#t.stop();
136
136
  });
137
137
  }
138
+ get vars() {
139
+ return this.#t.vars;
140
+ }
141
+ get facts() {
142
+ return this.#t.facts;
143
+ }
138
144
  hasVar(e) {
139
145
  return this.#t.hasVar(e);
140
146
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rotorjs/dashboard",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "description": "Rotor",
5
5
  "author": {
6
6
  "name": "Aaron Burmeister"