glyphix 1.0.15 → 1.0.17
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/package.json +1 -1
- package/script/install.js +1 -1
- package/types/device.d.ts +1 -1
- package/types/index.d.ts +3 -0
- package/types/messagechannel.d.ts +32 -0
- package/types/server.d.ts +15 -0
package/package.json
CHANGED
package/script/install.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var f=Object.create;var c=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty;var w=(o,i,n,r)=>{if(i&&typeof i=="object"||typeof i=="function")for(let m of h(i))!_.call(o,m)&&m!==n&&c(o,m,{get:()=>i[m],enumerable:!(r=p(i,m))||r.enumerable});return o};var d=(o,i,n)=>(n=o!=null?f(x(o)):{},w(i||!o||!o.__esModule?c(n,"default",{value:o,enumerable:!0}):n,o));var u=d(require("http")),l=d(require("fs")),a=require("child_process"),s=require("fs-extra"),e=require("path"),g=d(require("adm-zip"));function b(o,i){let n=l.default.createWriteStream(i);return new Promise((r,m)=>{u.default.get(o,t=>{if(t.statusCode!==200){console.error(`Failed to download file: ${t.statusCode}`),t.resume(),m();return}t.pipe(n),n.on("finish",()=>{n.close(()=>{console.log("Download completed."),r(i)})})}).on("error",t=>{l.default.unlink(i,()=>{}),console.error(`Error downloading file: ${t.message}`),m()})})}function y(){let o="http://10.147.18.10:9012/download/gx-build-mac-arm64-test-0.0.1.zip",i=(0,e.parse)(o),n=`${i.name}${i.ext}`,r=(0,e.resolve)(__dirname,"../emu/");return(0,s.existsSync)(r)||(0,s.mkdirSync)(r),b(o,(0,e.resolve)(r,n))}function P(o,i){new g.default(o).extractAllTo(i,!0)}(0,s.existsSync)((0,e.resolve)(__dirname,"emu/bin"))||y().then(o=>{P(o,(0,e.dirname)(o)),(0,a.spawn)("chmod",["+x",(0,e.resolve)(__dirname,"../emu/bin/gx")]),(0,a.spawn)("chmod",["+x",(0,e.resolve)(__dirname,"../emu/bin/glyphix-emu")]),(0,a.spawn)("chmod",["+x",(0,e.resolve)(__dirname,"../emu/bin/glyphix-jsc")]),(0,a.spawn)("chmod",["+x",(0,e.resolve)(__dirname,"../emu/bin/image-forge")])});
|
package/types/device.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare module "@system.device" {
|
|
|
11
11
|
osVersionName: string
|
|
12
12
|
}>
|
|
13
13
|
|
|
14
|
-
getId<T extends IdType[]>({
|
|
14
|
+
getId<T extends IdType[]>({type: T}): Promise<{[K in T[number]]: string}>
|
|
15
15
|
getDeviceId(): Promise<{ deviceId: string }>
|
|
16
16
|
|
|
17
17
|
// 获取设备唯一标识。
|
package/types/index.d.ts
CHANGED
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
/// <reference path="./prompt.d.ts" />
|
|
13
13
|
/// <reference path="./device.d.ts" />
|
|
14
14
|
/// <reference path="./brightness.d.ts" />
|
|
15
|
+
/// <reference path="./messagechannel.d.ts" />
|
|
16
|
+
/// <reference path="./server.d.ts" />
|
|
17
|
+
|
|
15
18
|
|
|
16
19
|
|
|
17
20
|
type ComputedResults<C, D> = {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare module "@system.messageChannel" {
|
|
2
|
+
interface MessageFactory {
|
|
3
|
+
subscribe(cb: (msg: string)=> void);
|
|
4
|
+
unsubscribe();
|
|
5
|
+
send(options: {
|
|
6
|
+
to: string,
|
|
7
|
+
receiver?: string,
|
|
8
|
+
message: string,
|
|
9
|
+
topic: string,
|
|
10
|
+
} | {
|
|
11
|
+
to?: string,
|
|
12
|
+
receiver: string,
|
|
13
|
+
message: string,
|
|
14
|
+
topic: string,
|
|
15
|
+
}):Promise<void>;
|
|
16
|
+
sendOnlyTest?(options: {
|
|
17
|
+
to: string,
|
|
18
|
+
receiver?: string,
|
|
19
|
+
message: string,
|
|
20
|
+
topic: string,
|
|
21
|
+
} | {
|
|
22
|
+
to?: string,
|
|
23
|
+
receiver: string,
|
|
24
|
+
message: string,
|
|
25
|
+
topic: string,
|
|
26
|
+
}):Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const messageFactory: MessageFactory;
|
|
30
|
+
export default messageFactory;
|
|
31
|
+
}
|
|
32
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare module "@system.server" {
|
|
2
|
+
interface ServerFactory {
|
|
3
|
+
start(): Promise<{code: number, msg: string, data: string}>
|
|
4
|
+
create(): ServerInstance
|
|
5
|
+
exec(name: string, params: any): Promise<void>
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ServerInstance{
|
|
9
|
+
route(name: string, cb: (...args: any)=> void)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const serverFactory: ServerFactory;
|
|
13
|
+
export default serverFactory;
|
|
14
|
+
}
|
|
15
|
+
|