sliftutils 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitignore +38 -0
- package/assets/icon128.png +0 -0
- package/assets/icon16.png +0 -0
- package/assets/icon48.png +0 -0
- package/build-electron/assets/icon128.png +0 -0
- package/build-electron/assets/icon16.png +0 -0
- package/build-electron/assets/icon48.png +0 -0
- package/build-electron/electron/electronIndex.html +12 -0
- package/build-electron/electronMain.js +5185 -0
- package/build-electron/electronRenderer.js +20852 -0
- package/build-extension/assets/icon128.png +0 -0
- package/build-extension/assets/icon16.png +0 -0
- package/build-extension/assets/icon48.png +0 -0
- package/build-extension/extBackground.js +5246 -0
- package/build-extension/extContentScript.js +5243 -0
- package/build-extension/manifest.json +29 -0
- package/build-nodejs/server.js +198610 -0
- package/build-web/assets/icon128.png +0 -0
- package/build-web/assets/icon16.png +0 -0
- package/build-web/assets/icon48.png +0 -0
- package/build-web/browser.js +199266 -0
- package/build-web/web/index.html +32 -0
- package/builders/dist/electronBuild.ts.cache +105 -0
- package/builders/dist/extensionBuild.ts.cache +146 -0
- package/builders/dist/generateIndexDts.ts.cache +74 -0
- package/builders/dist/hotReload.ts.cache +93 -0
- package/builders/dist/nodeJSBuild.ts.cache +29 -0
- package/builders/dist/watch.ts.cache +163 -0
- package/builders/dist/webBuild.ts.cache +81 -0
- package/builders/generateIndexDts.ts +1 -1
- package/bundler/dist/bundleEntry.ts.cache +48 -0
- package/bundler/dist/bundleEntryCaller.ts.cache +18 -0
- package/bundler/dist/bundleRequire.ts.cache +246 -0
- package/bundler/dist/bundleWrapper.ts.cache +101 -0
- package/bundler/dist/bundler.ts.cache +66 -0
- package/bundler/dist/sourceMaps.ts.cache +210 -0
- package/dist/electronMain.ts.cache +27 -0
- package/dist/electronRenderer.tsx.cache +62 -0
- package/electron/dist/electronMain.ts.cache +26 -0
- package/electron/dist/electronRenderer.tsx.cache +64 -0
- package/extension/dist/extBackground.ts.cache +20 -0
- package/extension/dist/extContentScript.ts.cache +17 -0
- package/index.d.ts +478 -0
- package/misc/dist/environment.ts.cache +50 -0
- package/misc/dist/fs.ts.cache +29 -0
- package/nodejs/dist/exampleFile.ts.cache +11 -0
- package/nodejs/dist/server.ts.cache +15 -0
- package/package.json +5 -1
- package/render-utils/dist/observer.tsx.cache +33 -0
- package/storage/CachedStorage.d.ts +2 -0
- package/storage/DelayedStorage.d.ts +14 -0
- package/storage/DiskCollection.d.ts +99 -0
- package/storage/FileFolderAPI.d.ts +71 -0
- package/storage/IStorage.d.ts +38 -0
- package/storage/IndexedDBFileFolderAPI.d.ts +6 -0
- package/storage/JSONStorage.d.ts +16 -0
- package/storage/PendingManager.d.ts +6 -0
- package/storage/PendingStorage.d.ts +18 -0
- package/storage/PrivateFileSystemStorage.d.ts +23 -0
- package/storage/StorageObservable.d.ts +32 -0
- package/storage/TransactionStorage.d.ts +46 -0
- package/storage/dist/CachedStorage.ts.cache +31 -0
- package/storage/dist/DelayedStorage.ts.cache +35 -0
- package/storage/dist/DiskCollection.ts.cache +241 -0
- package/storage/dist/FileFolderAPI.tsx.cache +345 -0
- package/storage/dist/IndexedDBFileFolderAPI.ts.cache +142 -0
- package/storage/dist/JSONStorage.ts.cache +38 -0
- package/storage/dist/PendingManager.tsx.cache +73 -0
- package/storage/dist/PendingStorage.ts.cache +49 -0
- package/storage/dist/PrivateFileSystemStorage.ts.cache +178 -0
- package/storage/dist/StorageObservable.ts.cache +120 -0
- package/storage/dist/TransactionStorage.ts.cache +421 -0
- package/storage/dist/fileSystemPointer.ts.cache +77 -0
- package/storage/fileSystemPointer.d.ts +11 -0
- package/tsconfig.declarations.json +3 -1
- package/web/dist/browser.tsx.cache +66 -0
- package/yarn.lock +1752 -0
package/index.d.ts
CHANGED
|
@@ -376,3 +376,481 @@ declare module "sliftutils/render-utils/observer" {
|
|
|
376
376
|
} & T;
|
|
377
377
|
|
|
378
378
|
}
|
|
379
|
+
|
|
380
|
+
declare module "sliftutils/storage/CachedStorage" {
|
|
381
|
+
import { StorageSync } from "./StorageObservable";
|
|
382
|
+
export declare function newCachedStrStorage<T>(folder: string, getValue: (key: string) => Promise<T>): StorageSync<T>;
|
|
383
|
+
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
declare module "sliftutils/storage/DelayedStorage" {
|
|
387
|
+
import { IStorage } from "./IStorage";
|
|
388
|
+
export declare class DelayedStorage<T> implements IStorage<T> {
|
|
389
|
+
private storage;
|
|
390
|
+
constructor(storage: Promise<IStorage<T>>);
|
|
391
|
+
get(key: string): Promise<T | undefined>;
|
|
392
|
+
set(key: string, value: T): Promise<void>;
|
|
393
|
+
remove(key: string): Promise<void>;
|
|
394
|
+
getKeys(): Promise<string[]>;
|
|
395
|
+
getInfo(key: string): Promise<{
|
|
396
|
+
size: number;
|
|
397
|
+
lastModified: number;
|
|
398
|
+
} | undefined>;
|
|
399
|
+
reset(): Promise<void>;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
declare module "sliftutils/storage/DiskCollection" {
|
|
405
|
+
/// <reference types="node" />
|
|
406
|
+
/// <reference types="node" />
|
|
407
|
+
import { IStorage, IStorageSync } from "./IStorage";
|
|
408
|
+
import { StorageSync } from "./StorageObservable";
|
|
409
|
+
import { TransactionStorage } from "./TransactionStorage";
|
|
410
|
+
export declare class DiskCollection<T> implements IStorageSync<T> {
|
|
411
|
+
private collectionName;
|
|
412
|
+
private writeDelay?;
|
|
413
|
+
constructor(collectionName: string, writeDelay?: number | undefined);
|
|
414
|
+
transactionStorage: TransactionStorage | undefined;
|
|
415
|
+
initStorage(): Promise<IStorage<T>>;
|
|
416
|
+
baseStorage: Promise<IStorage<T>>;
|
|
417
|
+
private synced;
|
|
418
|
+
get(key: string): T | undefined;
|
|
419
|
+
getPromise(key: string): Promise<T | undefined>;
|
|
420
|
+
set(key: string, value: T): void;
|
|
421
|
+
remove(key: string): void;
|
|
422
|
+
getKeys(): string[];
|
|
423
|
+
getKeysPromise(): Promise<string[]>;
|
|
424
|
+
getEntries(): [string, T][];
|
|
425
|
+
getValues(): T[];
|
|
426
|
+
getValuesPromise(): Promise<T[]>;
|
|
427
|
+
getInfo(key: string): {
|
|
428
|
+
size: number;
|
|
429
|
+
lastModified: number;
|
|
430
|
+
} | undefined;
|
|
431
|
+
reset(): Promise<void>;
|
|
432
|
+
}
|
|
433
|
+
export declare class DiskCollectionBrowser<T> implements IStorageSync<T> {
|
|
434
|
+
private collectionName;
|
|
435
|
+
private writeDelay?;
|
|
436
|
+
constructor(collectionName: string, writeDelay?: number | undefined);
|
|
437
|
+
transactionStorage: TransactionStorage | undefined;
|
|
438
|
+
initStorage(): Promise<IStorage<T>>;
|
|
439
|
+
baseStorage: Promise<IStorage<T>>;
|
|
440
|
+
private synced;
|
|
441
|
+
get(key: string): T | undefined;
|
|
442
|
+
getPromise(key: string): Promise<T | undefined>;
|
|
443
|
+
set(key: string, value: T): void;
|
|
444
|
+
remove(key: string): void;
|
|
445
|
+
getKeys(): string[];
|
|
446
|
+
getKeysPromise(): Promise<string[]>;
|
|
447
|
+
getEntries(): [string, T][];
|
|
448
|
+
getValues(): T[];
|
|
449
|
+
getValuesPromise(): Promise<T[]>;
|
|
450
|
+
getInfo(key: string): {
|
|
451
|
+
size: number;
|
|
452
|
+
lastModified: number;
|
|
453
|
+
} | undefined;
|
|
454
|
+
reset(): Promise<void>;
|
|
455
|
+
}
|
|
456
|
+
export declare class DiskCollectionPromise<T> implements IStorage<T> {
|
|
457
|
+
private collectionName;
|
|
458
|
+
private writeDelay?;
|
|
459
|
+
constructor(collectionName: string, writeDelay?: number | undefined);
|
|
460
|
+
initStorage(): Promise<IStorage<T>>;
|
|
461
|
+
private synced;
|
|
462
|
+
get(key: string): Promise<T | undefined>;
|
|
463
|
+
set(key: string, value: T): Promise<void>;
|
|
464
|
+
remove(key: string): Promise<void>;
|
|
465
|
+
getKeys(): Promise<string[]>;
|
|
466
|
+
getInfo(key: string): Promise<{
|
|
467
|
+
size: number;
|
|
468
|
+
lastModified: number;
|
|
469
|
+
} | undefined>;
|
|
470
|
+
reset(): Promise<void>;
|
|
471
|
+
}
|
|
472
|
+
export declare class DiskCollectionRaw implements IStorage<Buffer> {
|
|
473
|
+
private collectionName;
|
|
474
|
+
constructor(collectionName: string);
|
|
475
|
+
initStorage(): Promise<IStorage<Buffer>>;
|
|
476
|
+
private synced;
|
|
477
|
+
get(key: string): Promise<Buffer | undefined>;
|
|
478
|
+
set(key: string, value: Buffer): Promise<void>;
|
|
479
|
+
remove(key: string): Promise<void>;
|
|
480
|
+
getKeys(): Promise<string[]>;
|
|
481
|
+
getInfo(key: string): Promise<{
|
|
482
|
+
size: number;
|
|
483
|
+
lastModified: number;
|
|
484
|
+
} | undefined>;
|
|
485
|
+
reset(): Promise<void>;
|
|
486
|
+
}
|
|
487
|
+
export declare class DiskCollectionRawBrowser {
|
|
488
|
+
private collectionName;
|
|
489
|
+
constructor(collectionName: string);
|
|
490
|
+
initStorage(): Promise<IStorage<Buffer>>;
|
|
491
|
+
private synced;
|
|
492
|
+
get(key: string): Buffer | undefined;
|
|
493
|
+
getPromise(key: string): Promise<Buffer | undefined>;
|
|
494
|
+
set(key: string, value: Buffer): void;
|
|
495
|
+
getKeys(): Promise<string[]>;
|
|
496
|
+
getInfo(key: string): Promise<{
|
|
497
|
+
size: number;
|
|
498
|
+
lastModified: number;
|
|
499
|
+
} | undefined>;
|
|
500
|
+
reset(): Promise<void>;
|
|
501
|
+
}
|
|
502
|
+
export declare function newFileStorageBufferSyncer(folder?: string): StorageSync<Buffer>;
|
|
503
|
+
export declare function newFileStorageJSONSyncer<T>(folder?: string): StorageSync<T>;
|
|
504
|
+
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
declare module "sliftutils/storage/FileFolderAPI" {
|
|
508
|
+
/// <reference types="node" />
|
|
509
|
+
/// <reference types="node" />
|
|
510
|
+
import { IStorageRaw } from "./IStorage";
|
|
511
|
+
type FileWrapper = {
|
|
512
|
+
getFile(): Promise<{
|
|
513
|
+
size: number;
|
|
514
|
+
lastModified: number;
|
|
515
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
516
|
+
}>;
|
|
517
|
+
createWritable(config?: {
|
|
518
|
+
keepExistingData?: boolean;
|
|
519
|
+
}): Promise<{
|
|
520
|
+
seek(offset: number): Promise<void>;
|
|
521
|
+
write(value: Buffer): Promise<void>;
|
|
522
|
+
close(): Promise<void>;
|
|
523
|
+
}>;
|
|
524
|
+
};
|
|
525
|
+
type DirectoryWrapper = {
|
|
526
|
+
removeEntry(key: string, options?: {
|
|
527
|
+
recursive?: boolean;
|
|
528
|
+
}): Promise<void>;
|
|
529
|
+
getFileHandle(key: string, options?: {
|
|
530
|
+
create?: boolean;
|
|
531
|
+
}): Promise<FileWrapper>;
|
|
532
|
+
getDirectoryHandle(key: string, options?: {
|
|
533
|
+
create?: boolean;
|
|
534
|
+
}): Promise<DirectoryWrapper>;
|
|
535
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<[
|
|
536
|
+
string,
|
|
537
|
+
{
|
|
538
|
+
kind: "file";
|
|
539
|
+
name: string;
|
|
540
|
+
getFile(): Promise<FileWrapper>;
|
|
541
|
+
} | {
|
|
542
|
+
kind: "directory";
|
|
543
|
+
name: string;
|
|
544
|
+
getDirectoryHandle(key: string, options?: {
|
|
545
|
+
create?: boolean;
|
|
546
|
+
}): Promise<DirectoryWrapper>;
|
|
547
|
+
}
|
|
548
|
+
]>;
|
|
549
|
+
};
|
|
550
|
+
export declare const getDirectoryHandle: {
|
|
551
|
+
(): Promise<DirectoryWrapper>;
|
|
552
|
+
reset(): void;
|
|
553
|
+
set(newValue: Promise<DirectoryWrapper>): void;
|
|
554
|
+
};
|
|
555
|
+
export declare const getFileStorageNested: {
|
|
556
|
+
(key: string): Promise<FileStorage>;
|
|
557
|
+
clear(key: string): void;
|
|
558
|
+
clearAll(): void;
|
|
559
|
+
forceSet(key: string, value: Promise<FileStorage>): void;
|
|
560
|
+
getAllKeys(): string[];
|
|
561
|
+
get(key: string): Promise<FileStorage> | undefined;
|
|
562
|
+
};
|
|
563
|
+
export declare const getFileStorage: {
|
|
564
|
+
(): Promise<FileStorage>;
|
|
565
|
+
reset(): void;
|
|
566
|
+
set(newValue: Promise<FileStorage>): void;
|
|
567
|
+
};
|
|
568
|
+
export declare function resetStorageLocation(): void;
|
|
569
|
+
export type NestedFileStorage = {
|
|
570
|
+
hasKey(key: string): Promise<boolean>;
|
|
571
|
+
getStorage(key: string): Promise<FileStorage>;
|
|
572
|
+
removeStorage(key: string): Promise<void>;
|
|
573
|
+
getKeys(): Promise<string[]>;
|
|
574
|
+
};
|
|
575
|
+
export type FileStorage = IStorageRaw & {
|
|
576
|
+
folder: NestedFileStorage;
|
|
577
|
+
};
|
|
578
|
+
export {};
|
|
579
|
+
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
declare module "sliftutils/storage/IStorage" {
|
|
583
|
+
/// <reference types="node" />
|
|
584
|
+
/// <reference types="node" />
|
|
585
|
+
export type IStorageSync<T> = {
|
|
586
|
+
get(key: string): T | undefined;
|
|
587
|
+
set(key: string, value: T): void;
|
|
588
|
+
remove(key: string): void;
|
|
589
|
+
getKeys(): string[];
|
|
590
|
+
getValues(): T[];
|
|
591
|
+
getEntries(): [string, T][];
|
|
592
|
+
getInfo(key: string): {
|
|
593
|
+
size: number;
|
|
594
|
+
lastModified: number;
|
|
595
|
+
} | undefined;
|
|
596
|
+
reset(): Promise<void>;
|
|
597
|
+
};
|
|
598
|
+
export type IStorage<T> = {
|
|
599
|
+
get(key: string): Promise<T | undefined>;
|
|
600
|
+
set(key: string, value: T): Promise<void>;
|
|
601
|
+
remove(key: string): Promise<void>;
|
|
602
|
+
getKeys(): Promise<string[]>;
|
|
603
|
+
getInfo(key: string): Promise<undefined | {
|
|
604
|
+
size: number;
|
|
605
|
+
lastModified: number;
|
|
606
|
+
}>;
|
|
607
|
+
reset(): Promise<void>;
|
|
608
|
+
};
|
|
609
|
+
export type IStorageRaw = {
|
|
610
|
+
get(key: string): Promise<Buffer | undefined>;
|
|
611
|
+
append(key: string, value: Buffer): Promise<void>;
|
|
612
|
+
set(key: string, value: Buffer): Promise<void>;
|
|
613
|
+
remove(key: string): Promise<void>;
|
|
614
|
+
getKeys(): Promise<string[]>;
|
|
615
|
+
getInfo(key: string): Promise<undefined | {
|
|
616
|
+
size: number;
|
|
617
|
+
lastModified: number;
|
|
618
|
+
}>;
|
|
619
|
+
reset(): Promise<void>;
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
declare module "sliftutils/storage/IndexedDBFileFolderAPI" {
|
|
625
|
+
import { FileStorage } from "./FileFolderAPI";
|
|
626
|
+
export declare const getFileStorageIndexDB: {
|
|
627
|
+
(): Promise<FileStorage>;
|
|
628
|
+
reset(): void;
|
|
629
|
+
set(newValue: Promise<FileStorage>): void;
|
|
630
|
+
};
|
|
631
|
+
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
declare module "sliftutils/storage/JSONStorage" {
|
|
635
|
+
/// <reference types="node" />
|
|
636
|
+
/// <reference types="node" />
|
|
637
|
+
import { IStorage } from "./IStorage";
|
|
638
|
+
export declare class JSONStorage<T> implements IStorage<T> {
|
|
639
|
+
private storage;
|
|
640
|
+
constructor(storage: IStorage<Buffer>);
|
|
641
|
+
get(key: string): Promise<T | undefined>;
|
|
642
|
+
set(key: string, value: T): Promise<void>;
|
|
643
|
+
remove(key: string): Promise<void>;
|
|
644
|
+
getKeys(): Promise<string[]>;
|
|
645
|
+
getInfo(key: string): Promise<{
|
|
646
|
+
size: number;
|
|
647
|
+
lastModified: number;
|
|
648
|
+
} | undefined>;
|
|
649
|
+
reset(): Promise<void>;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
declare module "sliftutils/storage/PendingManager" {
|
|
655
|
+
import preact from "preact";
|
|
656
|
+
export declare function setPending(group: string, message: string): void;
|
|
657
|
+
export declare function hasPending(): boolean;
|
|
658
|
+
export declare class PendingDisplay extends preact.Component {
|
|
659
|
+
render(): preact.JSX.Element;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
declare module "sliftutils/storage/PendingStorage" {
|
|
665
|
+
import { IStorage } from "./IStorage";
|
|
666
|
+
export declare class PendingStorage<T> implements IStorage<T> {
|
|
667
|
+
private pendingGroup;
|
|
668
|
+
private storage;
|
|
669
|
+
pending: Map<string, number>;
|
|
670
|
+
constructor(pendingGroup: string, storage: IStorage<T>);
|
|
671
|
+
get(key: string): Promise<T | undefined>;
|
|
672
|
+
set(key: string, value: T): Promise<void>;
|
|
673
|
+
remove(key: string): Promise<void>;
|
|
674
|
+
getKeys(): Promise<string[]>;
|
|
675
|
+
getInfo(key: string): Promise<{
|
|
676
|
+
size: number;
|
|
677
|
+
lastModified: number;
|
|
678
|
+
} | undefined>;
|
|
679
|
+
private watchPending;
|
|
680
|
+
private updatePending;
|
|
681
|
+
reset(): Promise<void>;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
declare module "sliftutils/storage/PrivateFileSystemStorage" {
|
|
687
|
+
/// <reference types="node" />
|
|
688
|
+
/// <reference types="node" />
|
|
689
|
+
import { IStorageRaw } from "./IStorage";
|
|
690
|
+
export declare class PrivateFileSystemStorage implements IStorageRaw {
|
|
691
|
+
private path;
|
|
692
|
+
private rootHandle;
|
|
693
|
+
constructor(path: string);
|
|
694
|
+
private ensureInitialized;
|
|
695
|
+
private directoryExists;
|
|
696
|
+
private getDirectoryHandle;
|
|
697
|
+
private getFileHandle;
|
|
698
|
+
private fileExists;
|
|
699
|
+
get(key: string): Promise<Buffer | undefined>;
|
|
700
|
+
set(key: string, value: Buffer): Promise<void>;
|
|
701
|
+
append(key: string, value: Buffer): Promise<void>;
|
|
702
|
+
remove(key: string): Promise<void>;
|
|
703
|
+
getKeys(): Promise<string[]>;
|
|
704
|
+
getInfo(key: string): Promise<undefined | {
|
|
705
|
+
size: number;
|
|
706
|
+
lastModified: number;
|
|
707
|
+
}>;
|
|
708
|
+
reset(): Promise<void>;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
declare module "sliftutils/storage/StorageObservable" {
|
|
714
|
+
import { IStorage, IStorageSync } from "./IStorage";
|
|
715
|
+
export declare class StorageSync<T> implements IStorageSync<T> {
|
|
716
|
+
storage: IStorage<T>;
|
|
717
|
+
cached: import("mobx").ObservableMap<string, T | undefined>;
|
|
718
|
+
infoCached: import("mobx").ObservableMap<string, {
|
|
719
|
+
size: number;
|
|
720
|
+
lastModified: number;
|
|
721
|
+
} | undefined>;
|
|
722
|
+
keys: Set<string>;
|
|
723
|
+
synced: {
|
|
724
|
+
keySeqNum: number;
|
|
725
|
+
};
|
|
726
|
+
constructor(storage: IStorage<T>);
|
|
727
|
+
get(key: string): T | undefined;
|
|
728
|
+
set(key: string, value: T): void;
|
|
729
|
+
remove(key: string): void;
|
|
730
|
+
private loadedKeys;
|
|
731
|
+
getKeys(): string[];
|
|
732
|
+
getInfo(key: string): {
|
|
733
|
+
size: number;
|
|
734
|
+
lastModified: number;
|
|
735
|
+
} | undefined;
|
|
736
|
+
getValues(): T[];
|
|
737
|
+
getEntries(): [string, T][];
|
|
738
|
+
getPromise(key: string): Promise<T | undefined>;
|
|
739
|
+
private pendingGetKeys;
|
|
740
|
+
getKeysPromise(): Promise<string[]>;
|
|
741
|
+
reload(): void;
|
|
742
|
+
reloadKeys(): void;
|
|
743
|
+
reloadKey(key: string): void;
|
|
744
|
+
reset(): Promise<void>;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
declare module "sliftutils/storage/TransactionStorage" {
|
|
750
|
+
/// <reference types="node" />
|
|
751
|
+
/// <reference types="node" />
|
|
752
|
+
import { IStorage, IStorageRaw } from "./IStorage";
|
|
753
|
+
interface TransactionEntry {
|
|
754
|
+
key: string;
|
|
755
|
+
value: Buffer | undefined;
|
|
756
|
+
isZipped: boolean;
|
|
757
|
+
time: number;
|
|
758
|
+
}
|
|
759
|
+
export declare class TransactionStorage implements IStorage<Buffer> {
|
|
760
|
+
private rawStorage;
|
|
761
|
+
private debugName;
|
|
762
|
+
private writeDelay;
|
|
763
|
+
cache: Map<string, TransactionEntry>;
|
|
764
|
+
private currentChunk;
|
|
765
|
+
private currentChunkSize;
|
|
766
|
+
private entryCount;
|
|
767
|
+
private static allStorage;
|
|
768
|
+
constructor(rawStorage: IStorageRaw, debugName: string, writeDelay?: number);
|
|
769
|
+
static compressAll(): Promise<void>;
|
|
770
|
+
private init;
|
|
771
|
+
private getChunk;
|
|
772
|
+
get(key: string): Promise<Buffer | undefined>;
|
|
773
|
+
set(key: string, value: Buffer): Promise<void>;
|
|
774
|
+
remove(key: string): Promise<void>;
|
|
775
|
+
getInfo(key: string): Promise<{
|
|
776
|
+
size: number;
|
|
777
|
+
lastModified: number;
|
|
778
|
+
} | undefined>;
|
|
779
|
+
private pendingAppends;
|
|
780
|
+
private extraAppends;
|
|
781
|
+
private pendingWrite;
|
|
782
|
+
pushAppend(entry: TransactionEntry): Promise<void>;
|
|
783
|
+
private updatePendingAppends;
|
|
784
|
+
getKeys(): Promise<string[]>;
|
|
785
|
+
private loadAllTransactions;
|
|
786
|
+
private loadTransactionFile;
|
|
787
|
+
private readTransactionEntry;
|
|
788
|
+
private serializeTransactionEntry;
|
|
789
|
+
private getHeader;
|
|
790
|
+
private chunkBuffers;
|
|
791
|
+
private compressing;
|
|
792
|
+
private compressTransactionLog;
|
|
793
|
+
reset(): Promise<void>;
|
|
794
|
+
}
|
|
795
|
+
export {};
|
|
796
|
+
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
declare module "sliftutils/storage/fileSystemPointer" {
|
|
800
|
+
export type FileSystemPointer = string;
|
|
801
|
+
export declare function storeFileSystemPointer(config: {
|
|
802
|
+
mode: "read" | "readwrite";
|
|
803
|
+
handle: FileSystemFileHandle | FileSystemDirectoryHandle;
|
|
804
|
+
}): Promise<FileSystemPointer>;
|
|
805
|
+
export declare function deleteFileSystemPointer(pointer: FileSystemPointer): Promise<void>;
|
|
806
|
+
export declare function getFileSystemPointer(config: {
|
|
807
|
+
pointer: FileSystemPointer;
|
|
808
|
+
}): Promise<{
|
|
809
|
+
onUserActivation(modeOverride?: "read" | "readwrite"): Promise<FileSystemFileHandle | FileSystemDirectoryHandle>;
|
|
810
|
+
} | undefined>;
|
|
811
|
+
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
declare module "sliftutils/storage/storage" {
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
declare module "node-forge" {
|
|
818
|
+
declare type Ed25519PublicKey = {
|
|
819
|
+
publicKeyBytes: Buffer;
|
|
820
|
+
} & Buffer;
|
|
821
|
+
declare type Ed25519PrivateKey = {
|
|
822
|
+
privateKeyBytes: Buffer;
|
|
823
|
+
} & Buffer;
|
|
824
|
+
class ed25519 {
|
|
825
|
+
static generateKeyPair(): { publicKey: Ed25519PublicKey, privateKey: Ed25519PrivateKey };
|
|
826
|
+
static privateKeyToPem(key: Ed25519PrivateKey): string;
|
|
827
|
+
static privateKeyFromPem(pem: string): Ed25519PrivateKey;
|
|
828
|
+
static publicKeyToPem(key: Ed25519PublicKey): string;
|
|
829
|
+
static publicKeyFromPem(pem: string): Ed25519PublicKey;
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
interface FileSystemDirectoryHandle {
|
|
835
|
+
[Symbol.asyncIterator](): AsyncIterator<[string, FileSystemFileHandle | FileSystemDirectoryHandle]>;
|
|
836
|
+
requestPermission(config: { mode: "read" | "readwrite" }): Promise<void>;
|
|
837
|
+
}
|
|
838
|
+
interface FileSystemFileHandle {
|
|
839
|
+
getFile(): File;
|
|
840
|
+
createWritable(): FileSystemWritableFileStream;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
interface Window {
|
|
844
|
+
showSaveFilePicker(config?: {
|
|
845
|
+
types: {
|
|
846
|
+
description: string; accept: { [mimeType: string]: string[] }
|
|
847
|
+
}[];
|
|
848
|
+
}): Promise<FileSystemFileHandle>;
|
|
849
|
+
showDirectoryPicker(): Promise<FileSystemDirectoryHandle>;
|
|
850
|
+
showOpenFilePicker(config?: {
|
|
851
|
+
types: {
|
|
852
|
+
description: string; accept: { [mimeType: string]: string[] }
|
|
853
|
+
}[];
|
|
854
|
+
}): Promise<FileSystemFileHandle[]>;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true , configurable: true});
|
|
3
|
+
//exports.isInBrowser = exports.isInBuild = exports.triggerIsInBuild = exports.isInElectron = exports.isInChromeExtensionContentScript = exports.isInChromeExtensionBackground = exports.isInChromeExtension = void 0;
|
|
4
|
+
/// <reference path="../node_modules/@types/chrome/index.d.ts" />
|
|
5
|
+
function isInChromeExtension() {
|
|
6
|
+
return typeof chrome !== "undefined" && chrome.runtime && chrome.runtime.id;
|
|
7
|
+
}
|
|
8
|
+
exports.isInChromeExtension = isInChromeExtension;
|
|
9
|
+
function isInChromeExtensionBackground() {
|
|
10
|
+
if (!isInChromeExtension())
|
|
11
|
+
return false;
|
|
12
|
+
// Manifest V3: Service Worker context (has importScripts but no document)
|
|
13
|
+
if (typeof globalThis.importScripts === "function" && typeof document === "undefined") {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
// Manifest V2: Background page
|
|
17
|
+
if (typeof chrome.extension !== "undefined" && typeof chrome.extension.getBackgroundPage === "function") {
|
|
18
|
+
try {
|
|
19
|
+
return chrome.extension.getBackgroundPage() === window;
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
exports.isInChromeExtensionBackground = isInChromeExtensionBackground;
|
|
28
|
+
function isInChromeExtensionContentScript() {
|
|
29
|
+
return isInChromeExtension() && !isInChromeExtensionBackground();
|
|
30
|
+
}
|
|
31
|
+
exports.isInChromeExtensionContentScript = isInChromeExtensionContentScript;
|
|
32
|
+
function isInElectron() {
|
|
33
|
+
return typeof process !== "undefined" && process.versions && process.versions.electron;
|
|
34
|
+
}
|
|
35
|
+
exports.isInElectron = isInElectron;
|
|
36
|
+
let isInBuildFlag = false;
|
|
37
|
+
function triggerIsInBuild() {
|
|
38
|
+
isInBuildFlag = true;
|
|
39
|
+
}
|
|
40
|
+
exports.triggerIsInBuild = triggerIsInBuild;
|
|
41
|
+
function isInBuild() {
|
|
42
|
+
return isInBuildFlag;
|
|
43
|
+
}
|
|
44
|
+
exports.isInBuild = isInBuild;
|
|
45
|
+
function isInBrowser() {
|
|
46
|
+
return typeof document !== "undefined";
|
|
47
|
+
}
|
|
48
|
+
exports.isInBrowser = isInBrowser;
|
|
49
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW52aXJvbm1lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJlbnZpcm9ubWVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxpRUFBaUU7QUFDakUsU0FBZ0IsbUJBQW1CO0lBQy9CLE9BQU8sT0FBTyxNQUFNLEtBQUssV0FBVyxJQUFJLE1BQU0sQ0FBQyxPQUFPLElBQUksTUFBTSxDQUFDLE9BQU8sQ0FBQyxFQUFFLENBQUM7QUFDaEYsQ0FBQztBQUZELGtEQUVDO0FBQ0QsU0FBZ0IsNkJBQTZCO0lBQ3pDLElBQUksQ0FBQyxtQkFBbUIsRUFBRTtRQUFFLE9BQU8sS0FBSyxDQUFDO0lBRXpDLDBFQUEwRTtJQUMxRSxJQUFJLE9BQVEsVUFBa0IsQ0FBQyxhQUFhLEtBQU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3aW5kb3c7XG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBmYWxzZTtcbn1cbmV4cG9ydCBmdW5jdGlvbiBpc0luQ2hyb21lRXh0ZW5zaW9uQ29udGVudFNjcmlwdCgpIHtcbiAgICByZXR1cm4gaXNJbkNocm9tZUV4dGVuc2lvbigpICYmICFpc0luQ2hyb21lRXh0ZW5zaW9uQmFja2dyb3VuZCgpO1xufVxuZXhwb3J0IGZ1bmN0aW9uIGlzSW5FbGVjdHJvbigpIHtcbiAgICByZXR1cm4gdHlwZW9mIHByb2Nlc3MgIT09IFwidW5kZWZpbmVkXCIgJiYgcHJvY2Vzcy52ZXJzaW9ucyAmJiBwcm9jZXNzLnZlcnNpb25zLmVsZWN0cm9uO1xufVxubGV0IGlzSW5CdWlsZEZsYWcgPSBmYWxzZTtcbmV4cG9ydCBmdW5jdGlvbiB0cmlnZ2VySXNJbkJ1aWxkKCkge1xuICAgIGlzSW5CdWlsZEZsYWcgPSB0cnVlO1xufVxuZXhwb3J0IGZ1bmN0aW9uIGlzSW5CdWlsZCgpIHtcbiAgICByZXR1cm4gaXNJbkJ1aWxkRmxhZztcbn1cbmV4cG9ydCBmdW5jdGlvbiBpc0luQnJvd3NlcigpIHtcbiAgICByZXR1cm4gdHlwZW9mIGRvY3VtZW50ICE9PSBcInVuZGVmaW5lZFwiO1xufSJdfQ==
|
|
50
|
+
/* _JS_SOURCE_HASH = "00e183aa5fcbb1b2f725fb79092153bc802c27df18e93e60d79fd567f7502e12"; */
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule && mod.default) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true , configurable: true});
|
|
6
|
+
//exports.getAllFiles = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
async function* getAllFiles(folder) {
|
|
10
|
+
const files = await fs_1.default.promises.readdir(folder);
|
|
11
|
+
for (const file of files) {
|
|
12
|
+
const filePath = path_1.default.join(folder, file);
|
|
13
|
+
try {
|
|
14
|
+
const stats = await fs_1.default.promises.stat(filePath);
|
|
15
|
+
if (stats.isDirectory()) {
|
|
16
|
+
yield* getAllFiles(filePath);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
yield filePath;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
console.warn(`Failed while accessing path, skipping: ${filePath}`, error);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.getAllFiles = getAllFiles;
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJmcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSw0Q0FBb0I7QUFDcEIsZ0RBQXdCO0FBRWpCLEtBQUssU0FBUyxDQUFDLENBQUMsV0FBVyxDQUFDLE1BQWM7SUFDN0MsTUFBTSxLQUFLLEdBQUcsTUFBTSxZQUFFLENBQUMsUUFBUSxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQztJQUNoRCxLQUFLLE1BQU0sSUFBSSxJQUFJLEtBQUssRUFBRSxDQUFDO1FBQ3ZCLE1BQU0sUUFBUSxHQUFHLGNBQUksQ0FBQyxJQUFJLENBQUMsTUFBTSxFQUFFLElBQUksQ0FBQyxDQUFDO1FBQ3pDLElBQUksQ0FBQztZQUNELE1BQU0sS0FBSyxHQUFHLE1BQU0sWUFBRSxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsUUFBUSx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ICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICAgIGNvbnNvbGUud2FybihgRmFpbGVkIHdoaWxlIGFjY2Vzc2luZyBwYXRoLCBza2lwcGluZzogJHtmaWxlUGF0aH1gLCBlcnJvcik7XG4gICAgICAgIH1cbiAgICB9XG59Il19
|
|
29
|
+
/* _JS_SOURCE_HASH = "24eb29f93f883487ee5dfa0d45c550084abc4077a1c9f6422385c9a305444b33"; */
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true , configurable: true});
|
|
3
|
+
//exports.exampleFunction = void 0;
|
|
4
|
+
// Either set this flag on the files you want to hot reload, or add a file called hotreload.flag and that folder, everything in it and all the child uh files will hot reload.
|
|
5
|
+
module.hotreload = true;
|
|
6
|
+
function exampleFunction() {
|
|
7
|
+
return "Hello from exampleFile.ts";
|
|
8
|
+
}
|
|
9
|
+
exports.exampleFunction = exampleFunction;
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhhbXBsZUZpbGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJleGFtcGxlRmlsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwrS0FBK0s7QUFDL0ssTUFBTSxDQUFDLFNBQVMsR0FBRyxJQUFJLENBQUM7QUFFeEIsU0FBZ0IsZUFBZTtJQUMzQixPQUFPLDJCQUEyQixDQUFDO0FBQ3ZDLENBQUM7QUFGRCwwQ0FFQyIsInNvdXJjZXNDb250ZW50IjpbIi8vIEVpdGhlciBzZXQgdGhpcyBmbGFnIG9uIHRoZSBmaWxlcyB5b3Ugd2FudCB0byBob3QgcmVsb2FkLCBvciBhZGQgYSBmaWxlIGNhbGxlZCBob3RyZWxvYWQuZmxhZyBhbmQgdGhhdCBmb2xkZXIsIGV2ZXJ5dGhpbmcgaW4gaXQgYW5kIGFsbCB0aGUgY2hpbGQgdWggZmlsZXMgd2lsbCBob3QgcmVsb2FkLiBcbm1vZHVsZS5ob3RyZWxvYWQgPSB0cnVlO1xuXG5leHBvcnQgZnVuY3Rpb24gZXhhbXBsZUZ1bmN0aW9uKCkge1xuICAgIHJldHVybiBcIkhlbGxvIGZyb20gZXhhbXBsZUZpbGUudHNcIjtcbn0iXX0=
|
|
11
|
+
/* _JS_SOURCE_HASH = "5ce927e8446d0fc48114e61b3f1481145250a61049c1f754bbf963fbc06fe53e"; */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true , configurable: true});
|
|
3
|
+
const batching_1 = require("socket-function/src/batching");
|
|
4
|
+
const exampleFile_1 = require("./exampleFile");
|
|
5
|
+
const hotReload_1 = require("../builders/hotReload");
|
|
6
|
+
async function main() {
|
|
7
|
+
await (0, hotReload_1.enableHotReloading)();
|
|
8
|
+
while (true) {
|
|
9
|
+
console.log((0, exampleFile_1.exampleFunction)());
|
|
10
|
+
await (0, batching_1.delay)(1000);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
main().catch(console.error);
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2VydmVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsMkRBQXFEO0FBQ3JELCtDQUFnRDtBQUNoRCxxREFBMkQ7QUFFM0QsS0FBSyxVQUFVLElBQUk7SUFDZixNQUFNLElBQUEsOEJBQWtCLEdBQUUsQ0FBQztJQUMzQixPQUFPLElBQUksRUFBRSxDQUFDO1FBQ1YsT0FBTyxDQUFDLEdBQUcsQ0FBQyxJQUFBLDZCQUFlLEdBQUUsQ0FBQyxDQUFDO1FBQy9CLE1BQU0sSUFBQSxnQkFBSyxFQUFDLElBQUksQ0FBQyxDQUFDO0lBQ3RCLENBQUM7QUFDTCxDQUFDO0FBRUQsSUFBSSxFQUFFLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGRlbGF5IH0gZnJvbSBcInNvY2tldC1mdW5jdGlvbi9zcmMvYmF0Y2hpbmdcIjtcbmltcG9ydCB7IGV4YW1wbGVGdW5jdGlvbiB9IGZyb20gXCIuL2V4YW1wbGVGaWxlXCI7XG5pbXBvcnQgeyBlbmFibGVIb3RSZWxvYWRpbmcgfSBmcm9tIFwiLi4vYnVpbGRlcnMvaG90UmVsb2FkXCI7XG5cbmFzeW5jIGZ1bmN0aW9uIG1haW4oKSB7XG4gICAgYXdhaXQgZW5hYmxlSG90UmVsb2FkaW5nKCk7XG4gICAgd2hpbGUgKHRydWUpIHtcbiAgICAgICAgY29uc29sZS5sb2coZXhhbXBsZUZ1bmN0aW9uKCkpO1xuICAgICAgICBhd2FpdCBkZWxheSgxMDAwKTtcbiAgICB9XG59XG5cbm1haW4oKS5jYXRjaChjb25zb2xlLmVycm9yKTtcblxuIl1//9
|
|
15
|
+
/* _JS_SOURCE_HASH = "9d5836fddfa312252033bbc20caa82669811e9ebfcaff9dc2b932bbf657228c1"; */
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sliftutils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"files": [
|
|
7
|
+
"**/*",
|
|
8
|
+
".gitignore"
|
|
9
|
+
],
|
|
6
10
|
"scripts": {
|
|
7
11
|
"type": "yarn tsc --noEmit",
|
|
8
12
|
"update-types": "yarn emit-dts && yarn generate-index-dts",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true , configurable: true});
|
|
3
|
+
//exports.observer = void 0;
|
|
4
|
+
const mobx_1 = require("mobx");
|
|
5
|
+
let globalConstructOrder = 1;
|
|
6
|
+
function observer(Constructor) {
|
|
7
|
+
let name = Constructor.name;
|
|
8
|
+
return class extends Constructor {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.reaction = new mobx_1.Reaction(`render.${name}.${globalConstructOrder++}`, () => {
|
|
12
|
+
super.forceUpdate();
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
static get name() { return Constructor.name; }
|
|
17
|
+
componentWillUnmount() {
|
|
18
|
+
var _a;
|
|
19
|
+
this.reaction.dispose();
|
|
20
|
+
(_a = super.componentWillUnmount) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
21
|
+
}
|
|
22
|
+
render(...args) {
|
|
23
|
+
let output;
|
|
24
|
+
this.reaction.track(() => {
|
|
25
|
+
output = super.render(...args);
|
|
26
|
+
});
|
|
27
|
+
return output;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
exports.observer = observer;
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib2JzZXJ2ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJvYnNlcnZlci50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EsK0JBQTRDO0FBRTVDLElBQUksb0JBQW9CLEdBQUcsQ0FBQyxDQUFDO0FBQzdCLFNBQWdCLFFBQVEsQ0FTcEIsV0FBYztJQUVkLElBQUksSUFBSSxHQUFHLFdBQVcsQ0FBQyxJQUFJLENBQUM7SUFDNUIsT0FBTyxLQUFNLFNBQVEsV0FBVztRQUF6Qjs7WUFHSCxhQUFRLEdBQUcsSUFBSSxlQUFRLENBQUMsVUFBVSxJQUFJLElBQUksb0JBQW9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PzogKCkgPT4gdm9pZCk6IHZvaWQ7XG4gICAgICAgICAgICBjb21wb25lbnRXaWxsVW5tb3VudD8oKTogdm9pZDtcbiAgICAgICAgfVxuICAgIH1cbj4oXG4gICAgQ29uc3RydWN0b3I6IFRcbikge1xuICAgIGxldCBuYW1lID0gQ29uc3RydWN0b3IubmFtZTtcbiAgICByZXR1cm4gY2xhc3MgZXh0ZW5kcyBDb25zdHJ1Y3RvciB7XG4gICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgc3RhdGljIGdldCBuYW1lKCkgeyByZXR1cm4gQ29uc3RydWN0b3IubmFtZTsgfVxuICAgICAgICByZWFjdGlvbiA9IG5ldyBSZWFjdGlvbihgcmVuZGVyLiR7bmFtZX0uJHtnbG9iYWxDb25zdHJ1Y3RPcmRlcisrfWAsICgpID0+IHtcbiAgICAgICAgICAgIHN1cGVyLmZvcmNlVXBkYXRlKCk7XG4gICAgICAgIH0pO1xuICAgICAgICBjb21wb25lbnRXaWxsVW5tb3VudCgpIHtcbiAgICAgICAgICAgIHRoaXMucmVhY3Rpb24uZGlzcG9zZSgpO1xuICAgICAgICAgICAgc3VwZXIuY29tcG9uZW50V2lsbFVubW91bnQ/LigpO1xuICAgICAgICB9XG4gICAgICAgIHJlbmRlciguLi5hcmdzOiBhbnlbXSkge1xuICAgICAgICAgICAgbGV0IG91dHB1dDogcHJlYWN0LkNvbXBvbmVudENoaWxkO1xuICAgICAgICAgICAgdGhpcy5yZWFjdGlvbi50cmFjaygoKSA9PiB7XG4gICAgICAgICAgICAgICAgb3V0cHV0ID0gKHN1cGVyLnJlbmRlciBhcyBhbnkpKC4uLmFyZ3MpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXR1cm4gb3V0cHV0O1xuICAgICAgICB9XG4gICAgfTtcbn0iXX0=
|
|
33
|
+
/* _JS_SOURCE_HASH = "aa8d03d3849c2a27da30d4ba63a17e14c12256a9cf8719a3f9f17af6f7f83c98"; */
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IStorage } from "./IStorage";
|
|
2
|
+
export declare class DelayedStorage<T> implements IStorage<T> {
|
|
3
|
+
private storage;
|
|
4
|
+
constructor(storage: Promise<IStorage<T>>);
|
|
5
|
+
get(key: string): Promise<T | undefined>;
|
|
6
|
+
set(key: string, value: T): Promise<void>;
|
|
7
|
+
remove(key: string): Promise<void>;
|
|
8
|
+
getKeys(): Promise<string[]>;
|
|
9
|
+
getInfo(key: string): Promise<{
|
|
10
|
+
size: number;
|
|
11
|
+
lastModified: number;
|
|
12
|
+
} | undefined>;
|
|
13
|
+
reset(): Promise<void>;
|
|
14
|
+
}
|