glyphix 1.0.12 → 1.0.14

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/bin/glyphix.js CHANGED
@@ -254,6 +254,7 @@ function build(rootPath, entriedFullPath) {
254
254
  target: "node14",
255
255
  // 目标平台设置为最新 ECMAScript
256
256
  define: envDefine,
257
+ sourcemap: true,
257
258
  minify: process.env.GLYPHIX_ENV === "development" ? false : true,
258
259
  plugins: [
259
260
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glyphix",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "main": "lib/index.js",
5
5
  "types": "types/index.d.ts",
6
6
  "files": [
@@ -16,6 +16,7 @@
16
16
  "bin": {
17
17
  "glyphix": "./bin/glyphix.js"
18
18
  },
19
+ "sideEffects": false,
19
20
  "exports": {
20
21
  ".": {
21
22
  "import": {
@@ -0,0 +1,37 @@
1
+ declare module "@system.device" {
2
+ interface DeviceFactory {
3
+ getInfo
4
+ (): Promise<{
5
+ brand: string,
6
+ manufacturer: string,
7
+ model: string,
8
+ product: string,
9
+ osType: string,
10
+ osVersionName: string
11
+ }>,
12
+ getId
13
+ (types: ('device' | 'mac' | 'user' | 'advertising')[])
14
+ : Promise<{
15
+ device?: string,
16
+ mac?: string,
17
+ user?: string,
18
+ advertising?: string
19
+ }>,
20
+ getDeviceId
21
+ (): Promise<{ deviceId: string }>,
22
+ getSerial
23
+ (): Promise<{ serial: string }>,
24
+ getTotalStorage
25
+ (): Promise<{ totalStorage: number }>,
26
+ getAvailableStorage
27
+ (): Promise<{ availableStorage: number }>,
28
+ screenWidth: number,
29
+ screenHeight: number,
30
+ screenDensity: number,
31
+ screenShape: 'rect' | 'circle',
32
+ memoryProfile: number
33
+ }
34
+
35
+ const deviceFactory: DeviceFactory;
36
+ export default deviceFactory;
37
+ }
package/types/index.d.ts CHANGED
@@ -8,6 +8,8 @@
8
8
  /// <reference path="./file.d.ts" />
9
9
  /// <reference path="./network.d.ts" />
10
10
  /// <reference path="./cipher.d.ts" />
11
+ /// <reference path="./device.d.ts" />
12
+
11
13
 
12
14
  type ComputedResults<C, D> = {
13
15
  readonly [K in keyof C as C[K] extends (this: D) => any
@@ -49,7 +51,18 @@ type OmitedProps =
49
51
  | "onShow"
50
52
  | "onHide"
51
53
  | "onDestroy";
52
- type ComponentProps<D, C, M> = Omit<D & ComputedResults<C, D> & M, OmitedProps>;
54
+ type ComponentInternals = {
55
+ $element(id: string): Record<string, any> | undefined;
56
+ $valid: boolean;
57
+ $app: Record<string, any>;
58
+ $page: Record<string, any>;
59
+ $component(name: string, url: string): void;
60
+ $emit(name: string, ...args: Array<any>);
61
+ };
62
+ type ComponentProps<D, C, M> = Omit<
63
+ D & ComputedResults<C, D> & M & ComponentInternals,
64
+ OmitedProps
65
+ >;
53
66
  type ComponentOptions<
54
67
  D extends Data,
55
68
  C, // 先不深究 C 的 this 约束
@@ -0,0 +1,10 @@
1
+ declare module "@system.invoke" {
2
+ interface InvokeFactory {
3
+ invoke(name: string, params?: Record<string, any>): Promise<any>;
4
+ queryFeature(name: string): boolean;
5
+ install(name: string, executor: (params?: Record<string, any>) => any);
6
+ }
7
+
8
+ const invokeFactory: InvokeFactory;
9
+ export default invokeFactory;
10
+ }
@@ -0,0 +1,14 @@
1
+ declare module "@system.prompt" {
2
+ interface PromptFactory {
3
+ showToast(options: { message: string, duration?: number }): void;
4
+ showPopup(options: { uri: string, params?: { [k: string]: any } }): void;
5
+ }
6
+
7
+ interface DownloadTask {
8
+ complete: Promise<void>;
9
+ cancel(): void;
10
+ }
11
+
12
+ const promptFactory: PromptFactory;
13
+ export default promptFactory;
14
+ }