Camera module imports intval class properly.

This commit is contained in:
mmcwilliams 2019-06-14 11:59:47 -04:00
parent b5fbe0153b
commit 5b418aeccd
10 changed files with 49 additions and 14 deletions

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const Intval = require("intval"); const intval_1 = require("intval");
const Log = require("log");
/** class representing camera functions **/ /** class representing camera functions **/
class Camera { class Camera {
/** /**
@ -28,6 +27,7 @@ class Camera {
* *
**/ **/
async init() { async init() {
const Log = require('log');
this.log = await Log({ label: this.id }); this.log = await Log({ label: this.id });
this.ipc = require('electron').ipcMain; this.ipc = require('electron').ipcMain;
this.listen(); this.listen();
@ -129,7 +129,7 @@ class Camera {
async connectIntval(event, arg) { async connectIntval(event, arg) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (arg.connect) { if (arg.connect) {
this.intval = new Intval(arg.url); this.intval = new intval_1.Intval(arg.url);
this.intval.connect((err, ms, state) => { this.intval.connect((err, ms, state) => {
if (err) { if (err) {
this.ui.send('intval', { connected: false }); this.ui.send('intval', { connected: false });

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const Intval = require("intval"); const intval_1 = require("intval");
const Log = require("log");
/** class representing camera functions **/ /** class representing camera functions **/
class Camera { class Camera {
/** /**
@ -28,6 +27,7 @@ class Camera {
* *
**/ **/
async init() { async init() {
const Log = require('log');
this.log = await Log({ label: this.id }); this.log = await Log({ label: this.id });
this.ipc = require('electron').ipcMain; this.ipc = require('electron').ipcMain;
this.listen(); this.listen();
@ -129,7 +129,7 @@ class Camera {
async connectIntval(event, arg) { async connectIntval(event, arg) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (arg.connect) { if (arg.connect) {
this.intval = new Intval(arg.url); this.intval = new intval_1.Intval(arg.url);
this.intval.connect((err, ms, state) => { this.intval.connect((err, ms, state) => {
if (err) { if (err) {
this.ui.send('intval', { connected: false }); this.ui.send('intval', { connected: false });

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const Intval = require("intval"); const intval_1 = require("intval");
const Log = require("log");
/** class representing camera functions **/ /** class representing camera functions **/
class Camera { class Camera {
/** /**
@ -28,6 +27,7 @@ class Camera {
* *
**/ **/
async init() { async init() {
const Log = require('log');
this.log = await Log({ label: this.id }); this.log = await Log({ label: this.id });
this.ipc = require('electron').ipcMain; this.ipc = require('electron').ipcMain;
this.listen(); this.listen();
@ -129,7 +129,7 @@ class Camera {
async connectIntval(event, arg) { async connectIntval(event, arg) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (arg.connect) { if (arg.connect) {
this.intval = new Intval(arg.url); this.intval = new intval_1.Intval(arg.url);
this.intval.connect((err, ms, state) => { this.intval.connect((err, ms, state) => {
if (err) { if (err) {
this.ui.send('intval', { connected: false }); this.ui.send('intval', { connected: false });

File diff suppressed because one or more lines are too long

33
package-lock.json generated
View File

@ -4,6 +4,12 @@
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@types/caseless": {
"version": "0.12.2",
"resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.2.tgz",
"integrity": "sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w==",
"dev": true
},
"@types/electron": { "@types/electron": {
"version": "1.6.10", "version": "1.6.10",
"resolved": "https://registry.npmjs.org/@types/electron/-/electron-1.6.10.tgz", "resolved": "https://registry.npmjs.org/@types/electron/-/electron-1.6.10.tgz",
@ -13,6 +19,15 @@
"electron": "*" "electron": "*"
} }
}, },
"@types/form-data": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz",
"integrity": "sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ==",
"dev": true,
"requires": {
"@types/node": "*"
}
},
"@types/fs-extra": { "@types/fs-extra": {
"version": "7.0.0", "version": "7.0.0",
"resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-7.0.0.tgz", "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-7.0.0.tgz",
@ -28,6 +43,24 @@
"integrity": "sha512-wa09itaLE8L705aXd8F80jnFpxz3Y1/KRHfKsYL2bPc0XF+wEWu8sR9n5bmeu8Ba1N9z2GRNzm/YdHcghLkLKg==", "integrity": "sha512-wa09itaLE8L705aXd8F80jnFpxz3Y1/KRHfKsYL2bPc0XF+wEWu8sR9n5bmeu8Ba1N9z2GRNzm/YdHcghLkLKg==",
"dev": true "dev": true
}, },
"@types/request": {
"version": "2.48.1",
"resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.1.tgz",
"integrity": "sha512-ZgEZ1TiD+KGA9LiAAPPJL68Id2UWfeSO62ijSXZjFJArVV+2pKcsVHmrcu+1oiE3q6eDGiFiSolRc4JHoerBBg==",
"dev": true,
"requires": {
"@types/caseless": "*",
"@types/form-data": "*",
"@types/node": "*",
"@types/tough-cookie": "*"
}
},
"@types/tough-cookie": {
"version": "2.3.5",
"resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.5.tgz",
"integrity": "sha512-SCcK7mvGi3+ZNz833RRjFIxrn4gI1PPR3NtuIS+6vMkvmsGjosqTJwRt5bAEFLRz+wtJMWv8+uOnZf2hi2QXTg==",
"dev": true
},
"@types/uuid": { "@types/uuid": {
"version": "3.4.4", "version": "3.4.4",
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.4.tgz", "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.4.tgz",

View File

@ -28,6 +28,7 @@
"@types/electron": "^1.6.10", "@types/electron": "^1.6.10",
"@types/fs-extra": "^7.0.0", "@types/fs-extra": "^7.0.0",
"@types/node": "^11.10.4", "@types/node": "^11.10.4",
"@types/request": "^2.48.1",
"@types/uuid": "^3.4.4", "@types/uuid": "^3.4.4",
"jsdoc-to-markdown": "^4.0.1", "jsdoc-to-markdown": "^4.0.1",
"typescript": "^3.3.3333" "typescript": "^3.3.3333"

View File

@ -1,7 +1,6 @@
'use strict'; 'use strict';
import Intval = require('intval'); import { Intval } from 'intval';
import Log = require('log');
import { delay } from 'delay'; import { delay } from 'delay';
/** class representing camera functions **/ /** class representing camera functions **/
@ -36,6 +35,7 @@ class Camera {
* *
**/ **/
private async init () { private async init () {
const Log = require('log');
this.log = await Log({ label : this.id }); this.log = await Log({ label : this.id });
this.ipc = require('electron').ipcMain; this.ipc = require('electron').ipcMain;
this.listen(); this.listen();

1
src/globals.d.ts vendored
View File

@ -8,6 +8,7 @@ declare module 'exec';
declare module 'spawn'; declare module 'spawn';
declare module 'systeminformation'; declare module 'systeminformation';
declare module 'exit'; declare module 'exit';
declare module 'request';
interface Device { interface Device {
arduino : string; arduino : string;