epos 1.6.2 → 1.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.
@@ -40,7 +40,6 @@ declare class Unit<TRoot = unknown> {
40
40
  reaction: typeof mobx.reaction;
41
41
  setTimeout: typeof self.setTimeout;
42
42
  setInterval: typeof self.setInterval;
43
- static v: Record<number, (this: Unit, unit: Unit) => void>;
44
43
  }
45
44
  export interface Epos {
46
45
  /** Listen for an event. */
@@ -64,6 +63,8 @@ export interface Epos {
64
63
  };
65
64
  /** Disconnect from the state. */
66
65
  disconnect(name?: string): void;
66
+ /** Performs any state changes in a batch. */
67
+ transaction: (fn: () => void) => void;
67
68
  /** Create local state (no sync). */
68
69
  local<T extends State = {}>(state?: T): T;
69
70
  /** Get the list of all state names. */
@@ -74,17 +75,10 @@ export interface Epos {
74
75
  }>>;
75
76
  /** Destroy state. */
76
77
  destroy(name?: string): Promise<void>;
77
- /** Performs any state changes in a batch. */
78
- transaction: (fn: () => void) => void;
79
- /** @see https://mobx.js.org/reactions.html#autorun */
80
- autorun: typeof mobx.autorun;
81
- /** @see https://mobx.js.org/reactions.html#reaction */
82
- reaction: typeof mobx.reaction;
83
- root: HTMLElement;
84
- shadow: HTMLElement;
78
+ element: HTMLElement;
85
79
  component: {
86
- <P>(fn: react.FC<P>): typeof fn;
87
- <P>(name: string, fn: react.FC<P>): typeof fn;
80
+ <P>(Component: react.FC<P>): typeof Component;
81
+ <P>(name: string, Component: react.FC<P>): typeof Component;
88
82
  };
89
83
  render(node: react.ReactNode, container?: reactDomClient.Container): void;
90
84
  portal: typeof reactDom.createPortal;
@@ -99,6 +93,10 @@ export interface Epos {
99
93
  };
100
94
  fetch: typeof window.fetch;
101
95
  browser: typeof chrome;
96
+ /** @see https://mobx.js.org/reactions.html#autorun */
97
+ autorun: typeof mobx.autorun;
98
+ /** @see https://mobx.js.org/reactions.html#reaction */
99
+ reaction: typeof mobx.reaction;
102
100
  /** Get value from the storage. */
103
101
  get<T = unknown>(key: string, storageName?: string): Promise<T>;
104
102
  /** Set value in the storage. */
@@ -137,15 +135,15 @@ export interface Epos {
137
135
  hub: boolean;
138
136
  /** True if running on any page except hub. */
139
137
  page: boolean;
140
- /** True if running in a popup or in side panel (<popup> or <panel>). */
138
+ /** True if running in a popup or side panel (`<popup>` or `<panel>`). */
141
139
  shell: boolean;
142
- /** True if running in a popup (<popup>). */
140
+ /** True if running in a popup (`<popup>`). */
143
141
  popup: boolean;
144
- /** True if running in a side panel (<panel>). */
142
+ /** True if running in a side panel (`<panel>`). */
145
143
  panel: boolean;
146
- /** True if running in background (<background>). */
144
+ /** True if running in the background (`<background>`). */
147
145
  background: boolean;
148
- /** True if running in foreground */
146
+ /** True if running in the foreground. */
149
147
  foreground: boolean;
150
148
  };
151
149
  mobx: typeof mobx;
package/epos.schema.json CHANGED
@@ -35,7 +35,7 @@
35
35
  },
36
36
 
37
37
  "Action": {
38
- "oneOf": [{ "type": "null" }, { "type": "string" }, true]
38
+ "oneOf": [{ "type": "null" }, { "type": "string" }, { "type": "boolean" }]
39
39
  },
40
40
 
41
41
  "Popup": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epos",
3
- "version": "1.6.2",
3
+ "version": "1.7.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "imkost",
@@ -28,7 +28,7 @@
28
28
  "epos.schema.json"
29
29
  ],
30
30
  "dependencies": {
31
- "@types/chrome": "^0.1.4",
31
+ "@types/chrome": "^0.1.6",
32
32
  "@types/react": "^19.1.12",
33
33
  "@types/react-dom": "^19.1.9",
34
34
  "mobx": "^6.13.7",