scriptable-testlab
Version:
A lightweight, efficient tool designed to manage and update scripts for Scriptable.
62 lines (59 loc) • 1.21 kB
text/typescript
import { AbsKeychain } from 'scriptable-abstract';
interface KeychainState {
items: Map<string, string>;
accessGroups: string[];
lastAccess: Date | null;
}
/**
* Mock implementation of Scriptable's Keychain global variable
* @implements Keychain
*/
declare class MockKeychain extends AbsKeychain<KeychainState> {
static get instance(): MockKeychain;
constructor();
/**
* @inheritdoc
*/
set(key: string, value: string): void;
/**
* @inheritdoc
*/
get(key: string): string;
/**
* @inheritdoc
*/
remove(key: string): void;
/**
* @inheritdoc
*/
contains(key: string): boolean;
/**
* @inheritdoc
*/
get accessGroup(): string | null;
/**
* @inheritdoc
*/
set accessGroup(group: string | null);
/**
* @additional
* Get all stored keys
*/
getKeys(): string[];
/**
* @additional
* Get all access groups
*/
getAccessGroups(): string[];
/**
* @additional
* Get last access time
*/
getLastAccess(): Date | null;
/**
* @additional
* Clear all stored items
*/
clear(): void;
}
export { MockKeychain };