doric-js:debug source file update

This commit is contained in:
pengfeizhou 2021-02-19 17:33:10 +08:00 committed by osborn
parent 915f840cd7
commit 60b61f66ca
8 changed files with 2561 additions and 2063 deletions

View File

@ -665,6 +665,7 @@ function gravity() {
return new Gravity;
}
exports.LayoutSpec = void 0;
(function (LayoutSpec) {
/**
* Depends on what's been set on width or height.
@ -1300,10 +1301,12 @@ var __values$3 = (undefined && undefined.__values) || function(o) {
}; }
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
exports.RepeatMode = void 0;
(function (RepeatMode) {
RepeatMode[RepeatMode["RESTART"] = 1] = "RESTART";
RepeatMode[RepeatMode["REVERSE"] = 2] = "REVERSE";
})(exports.RepeatMode || (exports.RepeatMode = {}));
exports.FillMode = void 0;
(function (FillMode) {
/**
* The receiver is removed from the presentation when the animation is completed.
@ -1322,6 +1325,7 @@ var __values$3 = (undefined && undefined.__values) || function(o) {
*/
FillMode[FillMode["Both"] = 3] = "Both";
})(exports.FillMode || (exports.FillMode = {}));
exports.TimingFunction = void 0;
(function (TimingFunction) {
/**
* The system default timing function. Use this function to ensure that the timing of your animations matches that of most system animations.
@ -1691,6 +1695,7 @@ var Color = /** @class */ (function () {
Color.TRANSPARENT = new Color(0);
return Color;
}());
exports.GradientOrientation = void 0;
(function (GradientOrientation) {
/** draw the gradient from the top to the bottom */
GradientOrientation[GradientOrientation["TOP_BOTTOM"] = 0] = "TOP_BOTTOM";
@ -1732,6 +1737,7 @@ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators,
var __metadata$3 = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") { return Reflect.metadata(k, v); }
};
exports.TruncateAt = void 0;
(function (TruncateAt) {
TruncateAt[TruncateAt["End"] = 0] = "End";
TruncateAt[TruncateAt["Middle"] = 1] = "Middle";
@ -1832,6 +1838,7 @@ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators,
var __metadata$4 = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") { return Reflect.metadata(k, v); }
};
exports.ScaleType = void 0;
(function (ScaleType) {
ScaleType[ScaleType["ScaleToFill"] = 0] = "ScaleToFill";
ScaleType[ScaleType["ScaleAspectFit"] = 1] = "ScaleAspectFit";
@ -2398,12 +2405,14 @@ var FlexTypedValue = /** @class */ (function () {
FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto);
return FlexTypedValue;
}());
exports.FlexDirection = void 0;
(function (FlexDirection) {
FlexDirection[FlexDirection["COLUMN"] = 0] = "COLUMN";
FlexDirection[FlexDirection["COLUMN_REVERSE"] = 1] = "COLUMN_REVERSE";
FlexDirection[FlexDirection["ROW"] = 2] = "ROW";
FlexDirection[FlexDirection["ROW_REVERSE"] = 3] = "ROW_REVERSE";
})(exports.FlexDirection || (exports.FlexDirection = {}));
exports.Align = void 0;
(function (Align) {
Align[Align["AUTO"] = 0] = "AUTO";
Align[Align["FLEX_START"] = 1] = "FLEX_START";
@ -2414,6 +2423,7 @@ var FlexTypedValue = /** @class */ (function () {
Align[Align["SPACE_BETWEEN"] = 6] = "SPACE_BETWEEN";
Align[Align["SPACE_AROUND"] = 7] = "SPACE_AROUND";
})(exports.Align || (exports.Align = {}));
exports.Justify = void 0;
(function (Justify) {
Justify[Justify["FLEX_START"] = 0] = "FLEX_START";
Justify[Justify["CENTER"] = 1] = "CENTER";
@ -2422,25 +2432,30 @@ var FlexTypedValue = /** @class */ (function () {
Justify[Justify["SPACE_AROUND"] = 4] = "SPACE_AROUND";
Justify[Justify["SPACE_EVENLY"] = 5] = "SPACE_EVENLY";
})(exports.Justify || (exports.Justify = {}));
exports.Direction = void 0;
(function (Direction) {
Direction[Direction["INHERIT"] = 0] = "INHERIT";
Direction[Direction["LTR"] = 1] = "LTR";
Direction[Direction["RTL"] = 2] = "RTL";
})(exports.Direction || (exports.Direction = {}));
exports.PositionType = void 0;
(function (PositionType) {
PositionType[PositionType["RELATIVE"] = 0] = "RELATIVE";
PositionType[PositionType["ABSOLUTE"] = 1] = "ABSOLUTE";
})(exports.PositionType || (exports.PositionType = {}));
exports.Wrap = void 0;
(function (Wrap) {
Wrap[Wrap["NO_WRAP"] = 0] = "NO_WRAP";
Wrap[Wrap["WRAP"] = 1] = "WRAP";
Wrap[Wrap["WRAP_REVERSE"] = 2] = "WRAP_REVERSE";
})(exports.Wrap || (exports.Wrap = {}));
exports.OverFlow = void 0;
(function (OverFlow) {
OverFlow[OverFlow["VISIBLE"] = 0] = "VISIBLE";
OverFlow[OverFlow["HIDDEN"] = 1] = "HIDDEN";
OverFlow[OverFlow["SCROLL"] = 2] = "SCROLL";
})(exports.OverFlow || (exports.OverFlow = {}));
exports.Display = void 0;
(function (Display) {
Display[Display["FLEX"] = 0] = "FLEX";
Display[Display["NONE"] = 1] = "NONE";
@ -2717,6 +2732,7 @@ var Input = /** @class */ (function (_super) {
], Input.prototype, "password", void 0);
return Input;
}(View));
exports.InputType = void 0;
(function (InputType) {
InputType[InputType["Default"] = 0] = "Default";
InputType[InputType["Number"] = 1] = "Number";
@ -3296,6 +3312,7 @@ function notification(context) {
};
}
exports.StatusBarMode = void 0;
(function (StatusBarMode) {
StatusBarMode[StatusBarMode["LIGHT"] = 0] = "LIGHT";
StatusBarMode[StatusBarMode["DARK"] = 1] = "DARK";

View File

@ -561,6 +561,7 @@ function gravity() {
return new Gravity;
}
exports.LayoutSpec = void 0;
(function (LayoutSpec) {
/**
* Depends on what's been set on width or height.
@ -981,10 +982,12 @@ __decorate$2([
* See the License for the specific language governing permissions and
* limitations under the License.
*/
exports.RepeatMode = void 0;
(function (RepeatMode) {
RepeatMode[RepeatMode["RESTART"] = 1] = "RESTART";
RepeatMode[RepeatMode["REVERSE"] = 2] = "REVERSE";
})(exports.RepeatMode || (exports.RepeatMode = {}));
exports.FillMode = void 0;
(function (FillMode) {
/**
* The receiver is removed from the presentation when the animation is completed.
@ -1003,6 +1006,7 @@ __decorate$2([
*/
FillMode[FillMode["Both"] = 3] = "Both";
})(exports.FillMode || (exports.FillMode = {}));
exports.TimingFunction = void 0;
(function (TimingFunction) {
/**
* The system default timing function. Use this function to ensure that the timing of your animations matches that of most system animations.
@ -1282,6 +1286,7 @@ Color.YELLOW = new Color(0xFFFFFF00);
Color.CYAN = new Color(0xFF00FFFF);
Color.MAGENTA = new Color(0xFFFF00FF);
Color.TRANSPARENT = new Color(0);
exports.GradientOrientation = void 0;
(function (GradientOrientation) {
/** draw the gradient from the top to the bottom */
GradientOrientation[GradientOrientation["TOP_BOTTOM"] = 0] = "TOP_BOTTOM";
@ -1310,6 +1315,7 @@ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators,
var __metadata$3 = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
exports.TruncateAt = void 0;
(function (TruncateAt) {
TruncateAt[TruncateAt["End"] = 0] = "End";
TruncateAt[TruncateAt["Middle"] = 1] = "Middle";
@ -1392,6 +1398,7 @@ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators,
var __metadata$4 = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
exports.ScaleType = void 0;
(function (ScaleType) {
ScaleType[ScaleType["ScaleToFill"] = 0] = "ScaleToFill";
ScaleType[ScaleType["ScaleAspectFit"] = 1] = "ScaleAspectFit";
@ -1849,12 +1856,14 @@ class FlexTypedValue {
}
}
FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto);
exports.FlexDirection = void 0;
(function (FlexDirection) {
FlexDirection[FlexDirection["COLUMN"] = 0] = "COLUMN";
FlexDirection[FlexDirection["COLUMN_REVERSE"] = 1] = "COLUMN_REVERSE";
FlexDirection[FlexDirection["ROW"] = 2] = "ROW";
FlexDirection[FlexDirection["ROW_REVERSE"] = 3] = "ROW_REVERSE";
})(exports.FlexDirection || (exports.FlexDirection = {}));
exports.Align = void 0;
(function (Align) {
Align[Align["AUTO"] = 0] = "AUTO";
Align[Align["FLEX_START"] = 1] = "FLEX_START";
@ -1865,6 +1874,7 @@ FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto);
Align[Align["SPACE_BETWEEN"] = 6] = "SPACE_BETWEEN";
Align[Align["SPACE_AROUND"] = 7] = "SPACE_AROUND";
})(exports.Align || (exports.Align = {}));
exports.Justify = void 0;
(function (Justify) {
Justify[Justify["FLEX_START"] = 0] = "FLEX_START";
Justify[Justify["CENTER"] = 1] = "CENTER";
@ -1873,25 +1883,30 @@ FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto);
Justify[Justify["SPACE_AROUND"] = 4] = "SPACE_AROUND";
Justify[Justify["SPACE_EVENLY"] = 5] = "SPACE_EVENLY";
})(exports.Justify || (exports.Justify = {}));
exports.Direction = void 0;
(function (Direction) {
Direction[Direction["INHERIT"] = 0] = "INHERIT";
Direction[Direction["LTR"] = 1] = "LTR";
Direction[Direction["RTL"] = 2] = "RTL";
})(exports.Direction || (exports.Direction = {}));
exports.PositionType = void 0;
(function (PositionType) {
PositionType[PositionType["RELATIVE"] = 0] = "RELATIVE";
PositionType[PositionType["ABSOLUTE"] = 1] = "ABSOLUTE";
})(exports.PositionType || (exports.PositionType = {}));
exports.Wrap = void 0;
(function (Wrap) {
Wrap[Wrap["NO_WRAP"] = 0] = "NO_WRAP";
Wrap[Wrap["WRAP"] = 1] = "WRAP";
Wrap[Wrap["WRAP_REVERSE"] = 2] = "WRAP_REVERSE";
})(exports.Wrap || (exports.Wrap = {}));
exports.OverFlow = void 0;
(function (OverFlow) {
OverFlow[OverFlow["VISIBLE"] = 0] = "VISIBLE";
OverFlow[OverFlow["HIDDEN"] = 1] = "HIDDEN";
OverFlow[OverFlow["SCROLL"] = 2] = "SCROLL";
})(exports.OverFlow || (exports.OverFlow = {}));
exports.Display = void 0;
(function (Display) {
Display[Display["FLEX"] = 0] = "FLEX";
Display[Display["NONE"] = 1] = "NONE";
@ -2105,6 +2120,7 @@ __decorate$a([
Property,
__metadata$a("design:type", Boolean)
], Input.prototype, "password", void 0);
exports.InputType = void 0;
(function (InputType) {
InputType[InputType["Default"] = 0] = "Default";
InputType[InputType["Number"] = 1] = "Number";
@ -2560,6 +2576,7 @@ function notification(context) {
};
}
exports.StatusBarMode = void 0;
(function (StatusBarMode) {
StatusBarMode[StatusBarMode["LIGHT"] = 0] = "LIGHT";
StatusBarMode[StatusBarMode["DARK"] = 1] = "DARK";

File diff suppressed because it is too large Load Diff

View File

@ -1535,6 +1535,8 @@ var doric = (function (exports) {
exports.jsRegisterModule = jsRegisterModule;
exports.jsReleaseContext = jsReleaseContext;
Object.defineProperty(exports, '__esModule', { value: true });
return exports;
}({}));

View File

@ -3,6 +3,14 @@
Object.defineProperty(exports, '__esModule', { value: true });
var WebSocket = require('ws');
var fs = require('fs');
var path = require('path');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var WebSocket__default = /*#__PURE__*/_interopDefaultLegacy(WebSocket);
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
/*
* Copyright [2019] [Doric.Pub]
@ -2050,6 +2058,7 @@ function gravity() {
return new Gravity;
}
exports.LayoutSpec = void 0;
(function (LayoutSpec) {
/**
* Depends on what's been set on width or height.
@ -2470,10 +2479,12 @@ __decorate$2([
* See the License for the specific language governing permissions and
* limitations under the License.
*/
exports.RepeatMode = void 0;
(function (RepeatMode) {
RepeatMode[RepeatMode["RESTART"] = 1] = "RESTART";
RepeatMode[RepeatMode["REVERSE"] = 2] = "REVERSE";
})(exports.RepeatMode || (exports.RepeatMode = {}));
exports.FillMode = void 0;
(function (FillMode) {
/**
* The receiver is removed from the presentation when the animation is completed.
@ -2492,6 +2503,7 @@ __decorate$2([
*/
FillMode[FillMode["Both"] = 3] = "Both";
})(exports.FillMode || (exports.FillMode = {}));
exports.TimingFunction = void 0;
(function (TimingFunction) {
/**
* The system default timing function. Use this function to ensure that the timing of your animations matches that of most system animations.
@ -2771,6 +2783,7 @@ Color.YELLOW = new Color(0xFFFFFF00);
Color.CYAN = new Color(0xFF00FFFF);
Color.MAGENTA = new Color(0xFFFF00FF);
Color.TRANSPARENT = new Color(0);
exports.GradientOrientation = void 0;
(function (GradientOrientation) {
/** draw the gradient from the top to the bottom */
GradientOrientation[GradientOrientation["TOP_BOTTOM"] = 0] = "TOP_BOTTOM";
@ -2799,6 +2812,7 @@ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators,
var __metadata$3 = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
exports.TruncateAt = void 0;
(function (TruncateAt) {
TruncateAt[TruncateAt["End"] = 0] = "End";
TruncateAt[TruncateAt["Middle"] = 1] = "Middle";
@ -2881,6 +2895,7 @@ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators,
var __metadata$4 = (undefined && undefined.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
exports.ScaleType = void 0;
(function (ScaleType) {
ScaleType[ScaleType["ScaleToFill"] = 0] = "ScaleToFill";
ScaleType[ScaleType["ScaleAspectFit"] = 1] = "ScaleAspectFit";
@ -3338,12 +3353,14 @@ class FlexTypedValue {
}
}
FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto);
exports.FlexDirection = void 0;
(function (FlexDirection) {
FlexDirection[FlexDirection["COLUMN"] = 0] = "COLUMN";
FlexDirection[FlexDirection["COLUMN_REVERSE"] = 1] = "COLUMN_REVERSE";
FlexDirection[FlexDirection["ROW"] = 2] = "ROW";
FlexDirection[FlexDirection["ROW_REVERSE"] = 3] = "ROW_REVERSE";
})(exports.FlexDirection || (exports.FlexDirection = {}));
exports.Align = void 0;
(function (Align) {
Align[Align["AUTO"] = 0] = "AUTO";
Align[Align["FLEX_START"] = 1] = "FLEX_START";
@ -3354,6 +3371,7 @@ FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto);
Align[Align["SPACE_BETWEEN"] = 6] = "SPACE_BETWEEN";
Align[Align["SPACE_AROUND"] = 7] = "SPACE_AROUND";
})(exports.Align || (exports.Align = {}));
exports.Justify = void 0;
(function (Justify) {
Justify[Justify["FLEX_START"] = 0] = "FLEX_START";
Justify[Justify["CENTER"] = 1] = "CENTER";
@ -3362,25 +3380,30 @@ FlexTypedValue.Auto = new FlexTypedValue(ValueType.Auto);
Justify[Justify["SPACE_AROUND"] = 4] = "SPACE_AROUND";
Justify[Justify["SPACE_EVENLY"] = 5] = "SPACE_EVENLY";
})(exports.Justify || (exports.Justify = {}));
exports.Direction = void 0;
(function (Direction) {
Direction[Direction["INHERIT"] = 0] = "INHERIT";
Direction[Direction["LTR"] = 1] = "LTR";
Direction[Direction["RTL"] = 2] = "RTL";
})(exports.Direction || (exports.Direction = {}));
exports.PositionType = void 0;
(function (PositionType) {
PositionType[PositionType["RELATIVE"] = 0] = "RELATIVE";
PositionType[PositionType["ABSOLUTE"] = 1] = "ABSOLUTE";
})(exports.PositionType || (exports.PositionType = {}));
exports.Wrap = void 0;
(function (Wrap) {
Wrap[Wrap["NO_WRAP"] = 0] = "NO_WRAP";
Wrap[Wrap["WRAP"] = 1] = "WRAP";
Wrap[Wrap["WRAP_REVERSE"] = 2] = "WRAP_REVERSE";
})(exports.Wrap || (exports.Wrap = {}));
exports.OverFlow = void 0;
(function (OverFlow) {
OverFlow[OverFlow["VISIBLE"] = 0] = "VISIBLE";
OverFlow[OverFlow["HIDDEN"] = 1] = "HIDDEN";
OverFlow[OverFlow["SCROLL"] = 2] = "SCROLL";
})(exports.OverFlow || (exports.OverFlow = {}));
exports.Display = void 0;
(function (Display) {
Display[Display["FLEX"] = 0] = "FLEX";
Display[Display["NONE"] = 1] = "NONE";
@ -3594,6 +3617,7 @@ __decorate$a([
Property,
__metadata$a("design:type", Boolean)
], Input.prototype, "password", void 0);
exports.InputType = void 0;
(function (InputType) {
InputType[InputType["Default"] = 0] = "Default";
InputType[InputType["Number"] = 1] = "Number";
@ -4049,6 +4073,7 @@ function notification(context) {
};
}
exports.StatusBarMode = void 0;
(function (StatusBarMode) {
StatusBarMode[StatusBarMode["LIGHT"] = 0] = "LIGHT";
StatusBarMode[StatusBarMode["DARK"] = 1] = "DARK";
@ -4208,10 +4233,8 @@ class VMPanel extends Panel {
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const WebSocketClient = require('ws');
const fs = require('fs');
let context = process.cwd() + '/build/context';
const contextId = fs.readFileSync(context, { encoding: 'utf8' });
const contextFile = path__default['default'].resolve(process.cwd(), 'build', 'context');
const contextId = fs__default['default'].readFileSync(contextFile, { encoding: 'utf8' });
console.log("debugging context id: " + contextId);
let global$2 = new Function('return this')();
global$2.setTimeout = global$2.doricSetTimeout;
@ -4221,19 +4244,8 @@ global$2.clearInterval = global$2.doricClearInterval;
global$2.doric = doric;
global$2.context = jsObtainContext(contextId);
global$2.Entry = jsObtainEntry(contextId);
// dev kit client
const devClient = new WebSocketClient('ws://localhost:7777');
devClient.on('open', function open() {
console.log('dev kit connected on 7777');
});
devClient.on('message', function incoming(data) {
console.log(data);
});
devClient.on('error', function incoming(error) {
console.log(error);
});
// debug server
const debugServer = new WebSocket.Server({ port: 2080 });
const debugServer = new WebSocket__default['default'].Server({ port: 2080 });
debugServer.on('connection', function connection(ws) {
console.log('connected');
ws.on('message', function incoming(message) {
@ -4327,6 +4339,22 @@ global$2.sendToNative = () => {
};
global$2.receiveFromNative = () => {
};
global$2.nativeLog = (type, msg) => {
switch (type) {
case "w": {
console.warn(msg);
break;
}
case "e": {
console.error(msg);
break;
}
default: {
console.log(msg);
break;
}
}
};
exports.AnimationSet = AnimationSet;
exports.BOTTOM = BOTTOM;

View File

@ -14,12 +14,11 @@
* limitations under the License.
*/
import * as doric from './src/runtime/sandbox'
import * as WebSocket from 'ws'
const WebSocketClient = require('ws')
const fs = require('fs')
let context = process.cwd() + '/build/context'
const contextId = fs.readFileSync(context, { encoding: 'utf8' })
import WebSocket from "ws"
import fs from "fs"
import path from 'path'
const contextFile = path.resolve(process.cwd(), 'build', 'context');
const contextId = fs.readFileSync(contextFile, { encoding: 'utf8' })
console.log("debugging context id: " + contextId)
let global = new Function('return this')()
@ -32,18 +31,6 @@ global.doric = doric
global.context = doric.jsObtainContext(contextId)
global.Entry = doric.jsObtainEntry(contextId)
// dev kit client
const devClient = new WebSocketClient('ws://localhost:7777')
devClient.on('open', function open() {
console.log('dev kit connected on 7777')
})
devClient.on('message', function incoming(data: any) {
console.log(data)
})
devClient.on('error', function incoming(error: any) {
console.log(error)
})
// debug server
const debugServer = new WebSocket.Server({ port: 2080 })
debugServer.on('connection', function connection(ws) {
@ -137,5 +124,21 @@ global.sendToNative = () => {
global.receiveFromNative = () => {
}
global.nativeLog = (type: string, msg: string) => {
switch (type) {
case "w": {
console.warn(msg);
break;
}
case "e": {
console.error(msg);
break;
}
default: {
console.log(msg);
break;
}
}
}
export * from './index'

View File

@ -14,11 +14,11 @@
* limitations under the License.
*/
import * as doric from './src/runtime/sandbox';
import * as WebSocket from 'ws';
const WebSocketClient = require('ws');
const fs = require('fs');
let context = process.cwd() + '/build/context';
const contextId = fs.readFileSync(context, { encoding: 'utf8' });
import WebSocket from "ws";
import fs from "fs";
import path from 'path';
const contextFile = path.resolve(process.cwd(), 'build', 'context');
const contextId = fs.readFileSync(contextFile, { encoding: 'utf8' });
console.log("debugging context id: " + contextId);
let global = new Function('return this')();
global.setTimeout = global.doricSetTimeout;
@ -28,17 +28,6 @@ global.clearInterval = global.doricClearInterval;
global.doric = doric;
global.context = doric.jsObtainContext(contextId);
global.Entry = doric.jsObtainEntry(contextId);
// dev kit client
const devClient = new WebSocketClient('ws://localhost:7777');
devClient.on('open', function open() {
console.log('dev kit connected on 7777');
});
devClient.on('message', function incoming(data) {
console.log(data);
});
devClient.on('error', function incoming(error) {
console.log(error);
});
// debug server
const debugServer = new WebSocket.Server({ port: 2080 });
debugServer.on('connection', function connection(ws) {
@ -134,4 +123,20 @@ global.sendToNative = () => {
};
global.receiveFromNative = () => {
};
global.nativeLog = (type, msg) => {
switch (type) {
case "w": {
console.warn(msg);
break;
}
case "e": {
console.error(msg);
break;
}
default: {
console.log(msg);
break;
}
}
};
export * from './index';

View File

@ -24,13 +24,13 @@
"dependencies": {
"@types/ws": "^7.2.6",
"core-js": "^3.6.5",
"dts-bundle": "^0.7.3",
"proxy-polyfill": "^0.3.2",
"reflect-metadata": "^0.1.13",
"rollup": "^2.23.0",
"tslib": "^2.0.0",
"typescript": "^3.9.7",
"ws": "^7.3.1"
"ws": "^7.3.1",
"dts-bundle": "^0.7.3"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"