Resolves #73. Delay is exported in .ts file so it is non-ambient

This commit is contained in:
Matt McWilliams 2023-03-01 13:35:45 -05:00
parent d23eb290d9
commit 512f6c86ad
10 changed files with 24 additions and 9 deletions

View File

@ -0,0 +1,8 @@
/**
* Delay in an async/await function
*
* @param {integer} ms Milliseconds to delay for
*
* @returns {Promise} Promise to resolve after timeout
**/
export declare function delay(ms: number): Promise<unknown>;

View File

@ -1,4 +1,6 @@
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
exports.delay = void 0;
/**
* Delay in an async/await function
*
@ -11,5 +13,6 @@ function delay(ms) {
return setTimeout(resolve, ms);
});
}
module.exports.delay = delay;
exports.delay = delay;
module.exports = { delay };
//# sourceMappingURL=index.js.map

View File

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/delay/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;;;;IAMI;AAEJ,SAAS,KAAK,CAAE,EAAW;IAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAa,EAAE,EAAE;QACpC,OAAO,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC"}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/delay/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAEb;;;;;;IAMI;AAEJ,SAAgB,KAAK,CAAE,EAAW;IACjC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAa,EAAE,EAAE;QACpC,OAAO,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACJ,CAAC;AAJD,sBAIC;AAED,MAAM,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,CAAC"}

View File

@ -1,7 +1,11 @@
'use strict';
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Log = require("log");
const electron_1 = require("electron");
const delay_1 = __importDefault(require("delay"));
/** @module lib/sequencer **/
let seq;
class Sequencer {
@ -160,7 +164,7 @@ class Sequencer {
}
//UI initiates pause, not planned
while (this.paused) {
await delay(42);
await delay_1.default(42);
}
if (typeof this.arr[y] === 'undefined') {
continue;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -40,7 +40,6 @@ class Timing {
let proj;
let pad;
for (let key of keys) {
console.log(key);
if (key === 'label') {
continue;
}

View File

@ -1 +1 @@
{"version":3,"file":"timing.js","sourceRoot":"","sources":["../../src/lib/ui/timing.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,IAAI,MAAe,CAAC;AAMpB,MAAM,MAAM;IAoCX;QAnCO,SAAI,GAAgB,EAE1B,CAAA;QAEO,gBAAW,GAAS;YAC3B,GAAG,EAAG,KAAK;YACR,GAAG,EAAG,MAAM;YACZ,GAAG,EAAG,MAAM;YACZ,GAAG,EAAG,OAAO;YAChB,GAAG,EAAG,MAAM;YACT,GAAG,EAAG,OAAO;YAChB,GAAG,EAAG,OAAO;SACb,CAAA;QAEO,YAAO,GAAU;YACxB,IAAI,EAAG,KAAK;YACZ,IAAI,EAAG,KAAK;YACZ,IAAI,EAAG,OAAO;YACX,IAAI,EAAG,OAAO;YACd,KAAK,EAAE,MAAM;YACb,KAAK,EAAE,MAAM;YACb,KAAK,EAAG,MAAM;YACd,KAAK,EAAG,MAAM;YACd,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,MAAM;YACjB,IAAI,EAAG,MAAM;YACb,IAAI,EAAG,MAAM;YACb,KAAK,EAAG,OAAO;YACf,KAAK,EAAG,OAAO;YACf,KAAK,EAAG,OAAO;YACf,KAAK,EAAG,OAAO;YACf,MAAM,EAAG,OAAO;YAChB,MAAM,EAAG,OAAO;SAChB,CAAA;IAID,CAAC;IAEM,KAAK,CAAE,OAAa;QAC1B,MAAM,IAAI,G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delay (ms : number) {
export function delay (ms : number) {
return new Promise((resolve : any) => {
return setTimeout(resolve, ms);
});
}
module.exports.delay = delay;
module.exports = { delay };

View File

@ -3,6 +3,7 @@
import { v4 as uuid } from 'uuid';
import Log = require('log');
import { powerSaveBlocker } from 'electron'
import delay from 'delay';
/** @module lib/sequencer **/