epos 1.21.0 → 1.23.0
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/dist/chrome-types.d.d.ts +1 -0
- package/dist/chrome-types.d.js +0 -0
- package/dist/epos.d.ts +19 -16
- package/package.json +1 -1
- package/src/chrome-types.d.ts +2 -0
- package/src/epos.ts +21 -18
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="chrome" />
|
|
File without changes
|
package/dist/epos.d.ts
CHANGED
|
@@ -33,10 +33,7 @@ interface Epos {
|
|
|
33
33
|
browser: typeof chrome;
|
|
34
34
|
element: HTMLDivElement;
|
|
35
35
|
render(node: react.ReactNode, container?: reactDomClient.Container): void;
|
|
36
|
-
component:
|
|
37
|
-
<P>(Component: react.FC<P>): typeof Component;
|
|
38
|
-
<P>(name: string, Component: react.FC<P>): typeof Component;
|
|
39
|
-
};
|
|
36
|
+
component<T>(Component: react.FC<T>): typeof Component;
|
|
40
37
|
bus: {
|
|
41
38
|
/** Listen for an event. */
|
|
42
39
|
on(eventName: string, callback: Fn, thisValue?: unknown): void;
|
|
@@ -114,18 +111,24 @@ interface Epos {
|
|
|
114
111
|
url: string;
|
|
115
112
|
}[]>;
|
|
116
113
|
};
|
|
117
|
-
|
|
118
|
-
/** Get
|
|
114
|
+
assets: {
|
|
115
|
+
/** Get asset URL. The asset must be loaded first via `epos.assets.load`. */
|
|
119
116
|
url(path: string): string;
|
|
120
|
-
/** Load
|
|
121
|
-
load
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
117
|
+
/** Load either all assets or a specific asset by its path. */
|
|
118
|
+
load: {
|
|
119
|
+
/** Load all assets. */
|
|
120
|
+
(): Promise<void>;
|
|
121
|
+
/** Load asset by path. */
|
|
122
|
+
(path: string): Promise<Blob>;
|
|
123
|
+
};
|
|
124
|
+
/** Unload either all assets from memory or a specific asset by its path. */
|
|
125
|
+
unload: {
|
|
126
|
+
/** Unload all assets from memory. */
|
|
127
|
+
(): void;
|
|
128
|
+
/** Unload asset by path. */
|
|
129
|
+
(path: string): void;
|
|
130
|
+
};
|
|
131
|
+
/** Get list of all available asset files. */
|
|
129
132
|
list(filter?: {
|
|
130
133
|
loaded?: boolean;
|
|
131
134
|
}): {
|
|
@@ -151,7 +154,7 @@ interface Epos {
|
|
|
151
154
|
};
|
|
152
155
|
}
|
|
153
156
|
declare global {
|
|
154
|
-
|
|
157
|
+
const epos: Epos;
|
|
155
158
|
namespace React {
|
|
156
159
|
interface HTMLAttributes<T> {
|
|
157
160
|
class?: ClassName;
|
package/package.json
CHANGED
package/src/epos.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import './chrome-types.d.ts'
|
|
2
2
|
|
|
3
3
|
import type * as mobx from 'mobx'
|
|
4
4
|
import type * as mobxReactLite from 'mobx-react-lite'
|
|
@@ -39,10 +39,7 @@ export interface Epos {
|
|
|
39
39
|
browser: typeof chrome
|
|
40
40
|
element: HTMLDivElement
|
|
41
41
|
render(node: react.ReactNode, container?: reactDomClient.Container): void
|
|
42
|
-
component:
|
|
43
|
-
<P>(Component: react.FC<P>): typeof Component
|
|
44
|
-
<P>(name: string, Component: react.FC<P>): typeof Component
|
|
45
|
-
}
|
|
42
|
+
component<T>(Component: react.FC<T>): typeof Component
|
|
46
43
|
|
|
47
44
|
// Bus
|
|
48
45
|
bus: {
|
|
@@ -120,19 +117,25 @@ export interface Epos {
|
|
|
120
117
|
list(): Promise<{ name: string | null; url: string }[]>
|
|
121
118
|
}
|
|
122
119
|
|
|
123
|
-
//
|
|
124
|
-
|
|
125
|
-
/** Get
|
|
120
|
+
// Assets
|
|
121
|
+
assets: {
|
|
122
|
+
/** Get asset URL. The asset must be loaded first via `epos.assets.load`. */
|
|
126
123
|
url(path: string): string
|
|
127
|
-
/** Load
|
|
128
|
-
load
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
124
|
+
/** Load either all assets or a specific asset by its path. */
|
|
125
|
+
load: {
|
|
126
|
+
/** Load all assets. */
|
|
127
|
+
(): Promise<void>
|
|
128
|
+
/** Load asset by path. */
|
|
129
|
+
(path: string): Promise<Blob>
|
|
130
|
+
}
|
|
131
|
+
/** Unload either all assets from memory or a specific asset by its path. */
|
|
132
|
+
unload: {
|
|
133
|
+
/** Unload all assets from memory. */
|
|
134
|
+
(): void
|
|
135
|
+
/** Unload asset by path. */
|
|
136
|
+
(path: string): void
|
|
137
|
+
}
|
|
138
|
+
/** Get list of all available asset files. */
|
|
136
139
|
list(filter?: { loaded?: boolean }): { path: string; loaded: boolean }[]
|
|
137
140
|
}
|
|
138
141
|
|
|
@@ -158,7 +161,7 @@ export interface Epos {
|
|
|
158
161
|
}
|
|
159
162
|
|
|
160
163
|
declare global {
|
|
161
|
-
|
|
164
|
+
const epos: Epos
|
|
162
165
|
|
|
163
166
|
namespace React {
|
|
164
167
|
interface HTMLAttributes<T> {
|