[upd] plankton

This commit is contained in:
roydfalk 2024-04-26 11:02:32 +02:00
parent 2df4008ab0
commit 208aa12fd9
2 changed files with 30 additions and 9 deletions

View file

@ -1,15 +1,15 @@
/** /**
* @author fenris * @author fenris
*/ */
declare type int = number; type int = number;
/** /**
* @author fenris * @author fenris
*/ */
declare type float = number; type float = number;
/** /**
* @author fenris * @author fenris
*/ */
declare type type_date = { type type_date = {
year: int; year: int;
month: int; month: int;
day: int; day: int;
@ -17,7 +17,7 @@ declare type type_date = {
/** /**
* @author fenris * @author fenris
*/ */
declare type type_time = { type type_time = {
hour: int; hour: int;
minute: int; minute: int;
second: int; second: int;
@ -25,7 +25,7 @@ declare type type_time = {
/** /**
* @author fenris * @author fenris
*/ */
declare type type_datetimeobject = { type type_datetimeobject = {
date: type_date; date: type_date;
time: type_time; time: type_time;
}; };
@ -44,7 +44,7 @@ declare namespace lib_plankton.base {
/** /**
* @author fenris * @author fenris
*/ */
declare type type_pseudopointer<type_value> = { type type_pseudopointer<type_value> = {
value: type_value; value: type_value;
}; };
/** /**
@ -692,6 +692,10 @@ declare namespace lib_plankton.call {
}>; }>;
} }
declare namespace lib_plankton.file { declare namespace lib_plankton.file {
/**
* @author fenris
*/
function exists(path: string): Promise<boolean>;
/** /**
* @author fenris * @author fenris
*/ */
@ -1488,7 +1492,7 @@ declare namespace lib_plankton.storage.memory {
clear(): Promise<void>; clear(): Promise<void>;
write(key: any, value: any): Promise<boolean>; write(key: any, value: any): Promise<boolean>;
delete(key: any): Promise<void>; delete(key: any): Promise<void>;
read(key: any): Promise<type_item>; read(key: any): Promise<Awaited<type_item>>;
search(term: any): Promise<{ search(term: any): Promise<{
key: string; key: string;
preview: string; preview: string;

View file

@ -1554,6 +1554,23 @@ var lib_plankton;
(function (lib_plankton) { (function (lib_plankton) {
var file; var file;
(function (file) { (function (file) {
/**
* @author fenris
*/
function exists(path) {
var nm_fs = require("fs");
return (new Promise(function (resolve, reject) {
nm_fs.stat(path, function (error, stats) {
if (error) {
resolve(false);
}
else {
resolve(true);
}
});
}));
}
file.exists = exists;
/** /**
* @author fenris * @author fenris
*/ */
@ -4040,7 +4057,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function verb(n) { return function (v) { return step([n, v]); }; } function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) { function step(op) {
if (f) throw new TypeError("Generator is already executing."); if (f) throw new TypeError("Generator is already executing.");
while (_) try { while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value]; if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) { switch (op[0]) {
@ -7694,7 +7711,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
function verb(n) { return function (v) { return step([n, v]); }; } function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) { function step(op) {
if (f) throw new TypeError("Generator is already executing."); if (f) throw new TypeError("Generator is already executing.");
while (_) try { while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value]; if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) { switch (op[0]) {