forked from JaylyDev/ScriptAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
55 lines (55 loc) · 2.14 KB
/
index.d.ts
File metadata and controls
55 lines (55 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* A simple database for storing data in a Minecraft world, using scoreboard.
*/
declare class JaylyDB implements Map<string, string | number | boolean> {
/**
* @param id An identifier for the database
* @param encrypted whether this database is encrypted or not, note that encryption state cannot be changed after creation
*/
constructor(id: string, encrypted?: boolean);
/**
* @returns the number of elements in the database.
*/
get size(): number;
/**
* Clears every element in the database.
*/
clear(): void;
/**
* @returns — true if an element in the database exists and has been removed, false otherwise.
*/
delete(key: string): boolean;
/**
* Executes a provided function once per each key/value pair in the database, in insertion order.
*/
forEach(callbackfn: (value: string | number | boolean, key: string, jaylydb: this) => void): void;
/**
* Returns a specified element from the database.
* @param key The key of the element to return.
* @returns Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.
*/
get(key: string): string | number | boolean | undefined;
/**
* @returns boolean indicating whether an element with the specified key exists or not in jaylydb.
*/
has(key: string): boolean;
/**
* Adds a new element with a specified key and value to the database. If an element with the same key already exists, the element will be updated.
*/
set(key: string, value: string | number | boolean): this;
/**
* Returns an iterable of key, value pairs for every entry in the database.
*/
entries(): IterableIterator<[string, string | number | boolean]>;
/**
* Returns an iterable of keys in the database
*/
keys(): IterableIterator<string>;
/**
* Returns an iterable of values in the map
*/
values(): IterableIterator<string | number | boolean>;
[Symbol.iterator](): IterableIterator<[string, string | number | boolean]>;
[Symbol.toStringTag]: string;
}
export { JaylyDB };