initial
This commit is contained in:
2
dist/index.d.ts
vendored
Normal file
2
dist/index.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './smartdrive.classes.localdrivelist';
|
||||
export * from './smartdrive.interfaces';
|
7
dist/index.js
vendored
Normal file
7
dist/index.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__export(require("./smartdrive.classes.localdrivelist"));
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUVBLHlEQUFtRCJ9
|
6
dist/smartdrive.classes.localdrivelist.d.ts
vendored
Normal file
6
dist/smartdrive.classes.localdrivelist.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { IDrive } from './smartdrive.interfaces';
|
||||
export declare class LocalDriveList {
|
||||
private _list;
|
||||
getList(): Promise<IDrive[]>;
|
||||
getUpdatedList(): Promise<IDrive[]>;
|
||||
}
|
33
dist/smartdrive.classes.localdrivelist.js
vendored
Normal file
33
dist/smartdrive.classes.localdrivelist.js
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const plugins = require("./smartdrive.plugins");
|
||||
let promisifiedDrivelist = plugins.smartq.promisify(plugins.drivelist.list);
|
||||
class LocalDriveList {
|
||||
constructor() {
|
||||
this._list = null;
|
||||
}
|
||||
getList() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (!this._list) {
|
||||
this._list = yield promisifiedDrivelist();
|
||||
}
|
||||
return this._list;
|
||||
});
|
||||
}
|
||||
getUpdatedList() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
this._list = null;
|
||||
return yield this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.LocalDriveList = LocalDriveList;
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRkcml2ZS5jbGFzc2VzLmxvY2FsZHJpdmVsaXN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRkcml2ZS5jbGFzc2VzLmxvY2FsZHJpdmVsaXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSxnREFBK0M7QUFHL0MsSUFBSSxvQkFBb0IsR0FBRyxPQUFPLENBQUMsTUFBTSxDQUFDLFNBQVMsQ0FBTSxPQUFPLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxDQUFBO0FBRWhGO0lBQUE7UUFDVSxVQUFLLEdBQWEsSUFBSSxDQUFBO0lBYWhDLENBQUM7SUFYTyxPQUFPOztZQUNYLEVBQUUsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUM7Z0JBQ2hCLElBQUksQ0FBQyxLQUFLLEdBQUcsTUFBTSxvQkFBb0IsRUFBRSxDQUFBO1lBQzNDLENBQUM7WUFDRCxNQUFNLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQTtRQUNuQixDQUFDO0tBQUE7SUFFSyxjQUFjOztZQUNsQixJQUFJLENBQUMsS0FBSyxHQUFHLElBQUksQ0FBQTtZQUNqQixNQUFNLENBQUMsTUFBTSxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUE7UUFDN0IsQ0FBQztLQUFBO0NBQ0Y7QUFkRCx3Q0FjQyJ9
|
12
dist/smartdrive.interfaces.d.ts
vendored
Normal file
12
dist/smartdrive.interfaces.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
export interface IDrive {
|
||||
device: string;
|
||||
description: string;
|
||||
size: number;
|
||||
mountpoints: IMountpoint[];
|
||||
raw: string;
|
||||
protected: boolean;
|
||||
system: boolean;
|
||||
}
|
||||
export interface IMountpoint {
|
||||
path: string;
|
||||
}
|
3
dist/smartdrive.interfaces.js
vendored
Normal file
3
dist/smartdrive.interfaces.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRkcml2ZS5pbnRlcmZhY2VzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRkcml2ZS5pbnRlcmZhY2VzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
|
4
dist/smartdrive.plugins.d.ts
vendored
Normal file
4
dist/smartdrive.plugins.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import 'typings-global';
|
||||
import * as drivelist from 'drivelist';
|
||||
import * as smartq from 'smartq';
|
||||
export { drivelist, smartq };
|
8
dist/smartdrive.plugins.js
vendored
Normal file
8
dist/smartdrive.plugins.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
require("typings-global");
|
||||
const drivelist = require("drivelist");
|
||||
exports.drivelist = drivelist;
|
||||
const smartq = require("smartq");
|
||||
exports.smartq = smartq;
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRkcml2ZS5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRkcml2ZS5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsMEJBQXVCO0FBQ3ZCLHVDQUFzQztBQUlwQyw4QkFBUztBQUhYLGlDQUFnQztBQUk5Qix3QkFBTSJ9
|
Reference in New Issue
Block a user