lunibee 0.2.3 → 0.2.4
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/LICENSE +21 -21
- package/README.md +225 -225
- package/dist/builders/attachment.d.ts +8 -0
- package/dist/builders/commands.d.ts +122 -65
- package/dist/builders/components.d.ts +10 -31
- package/dist/builders/embed.d.ts +66 -33
- package/dist/builders/index.js +97 -131
- package/dist/builders/index.js.map +8 -8
- package/dist/collection/cache.d.ts +13 -6
- package/dist/collection/index.d.ts +90 -17
- package/dist/collection/index.js +442 -266
- package/dist/collection/index.js.map +4 -4
- package/dist/core/index.d.ts +8 -0
- package/dist/core/index.js +607 -352
- package/dist/core/index.js.map +47 -47
- package/dist/core/permissions.d.ts +7 -3
- package/dist/formatters/index.js +9 -5
- package/dist/formatters/index.js.map +3 -3
- package/dist/handlers/index.js +5 -10
- package/dist/handlers/index.js.map +3 -3
- package/dist/index.js +769 -587
- package/dist/index.js.map +65 -65
- package/dist/managers/base.d.ts +22 -14
- package/dist/managers/index.d.ts +2 -1
- package/dist/managers/index.js +445 -276
- package/dist/managers/index.js.map +26 -26
- package/dist/managers/message.d.ts +7 -3
- package/dist/rest/errors.d.ts +14 -7
- package/dist/rest/index.d.ts +24 -12
- package/dist/rest/index.js +54 -17
- package/dist/rest/index.js.map +14 -14
- package/dist/rest/redis.d.ts +1 -1
- package/dist/rest/route.d.ts +8 -4
- package/dist/rest/routes.d.ts +102 -48
- package/dist/rest/transport.d.ts +10 -5
- package/dist/rest/webhook.d.ts +9 -5
- package/dist/sharding/bus.d.ts +34 -17
- package/dist/sharding/index.d.ts +34 -17
- package/dist/sharding/index.js +64 -32
- package/dist/sharding/index.js.map +17 -17
- package/dist/structures/base.d.ts +19 -10
- package/dist/structures/channels.d.ts +28 -14
- package/dist/structures/index.js +9 -59
- package/dist/structures/index.js.map +19 -18
- package/dist/structures/interactions.d.ts +96 -48
- package/dist/structures/resources.d.ts +88 -44
- package/dist/types/gateway.d.ts +1 -1
- package/dist/types/index.js +20 -22
- package/dist/types/index.js.map +4 -4
- package/dist/utils/index.js.map +2 -2
- package/dist/voice/index.d.ts +12 -4
- package/dist/voice/index.js +14 -18
- package/dist/voice/index.js.map +3 -3
- package/dist/ws/decoder.d.ts +6 -2
- package/dist/ws/index.d.ts +25 -13
- package/dist/ws/index.js +63 -31
- package/dist/ws/index.js.map +14 -14
- package/dist/ws/protocol.d.ts +10 -2
- package/dist/ws/session.d.ts +14 -4
- package/dist/ws/state.d.ts +22 -11
- package/package.json +15 -14
package/dist/managers/base.d.ts
CHANGED
|
@@ -6,9 +6,12 @@ export declare function splitReason<T extends {
|
|
|
6
6
|
/** Generic cache manager. @typeParam K Cache key type. @typeParam V Cached value type. */
|
|
7
7
|
export declare class Manager<K, V> {
|
|
8
8
|
#private;
|
|
9
|
-
/** Authoritative resource state. Entries never expire: see {@link Manager.set}. */
|
|
10
|
-
|
|
11
|
-
/**
|
|
9
|
+
/** Authoritative resource state. Entries never expire: see {@link Manager.set}. */
|
|
10
|
+
readonly cache: Collection<K, V>;
|
|
11
|
+
/** Gets a cached value. @param id Cache key. @returns Cached value. */
|
|
12
|
+
get(id: K): V | undefined;
|
|
13
|
+
/** Checks whether a value is cached. @param id Cache key. @returns True when cached. */
|
|
14
|
+
has(id: K): boolean;
|
|
12
15
|
/**
|
|
13
16
|
* Runs a REST load for one key. Concurrent loads of that key share a
|
|
14
17
|
* single request. If the key is written (e.g. by a Gateway update) or
|
|
@@ -18,17 +21,22 @@ export declare class Manager<K, V> {
|
|
|
18
21
|
* @param store Stores a fresh result and returns the canonical instance.
|
|
19
22
|
*/
|
|
20
23
|
protected fetchOnce(id: K, load: () => Promise<V>, store?: (value: V) => V): Promise<V>;
|
|
21
|
-
/** Stores a resource with `setWithoutTTL()`, so it leaves only on an explicit delete (e.g. a Gateway `*_DELETE`), never through TTL. @param id Cache key. @param value Value. @returns This manager. */
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
/** Stores a resource with `setWithoutTTL()`, so it leaves only on an explicit delete (e.g. a Gateway `*_DELETE`), never through TTL. @param id Cache key. @param value Value. @returns This manager. */
|
|
25
|
+
set(id: K, value: V): this;
|
|
26
|
+
/** Deletes a cached value. @param id Cache key. @returns True when deleted. */
|
|
27
|
+
delete(id: K): boolean;
|
|
28
|
+
/** Clears the cache. @returns Nothing. */
|
|
29
|
+
clear(): void;
|
|
30
|
+
/** Gets cache size. @returns Number of cached values. */
|
|
31
|
+
get size(): number;
|
|
32
|
+
/** Gets the first cached value. @returns First value. */
|
|
33
|
+
first(): V | undefined;
|
|
34
|
+
/** Returns cached values. @returns Array of values. */
|
|
35
|
+
values(): V[];
|
|
36
|
+
/** Finds a cached value. @param predicate Predicate. @returns Matching value. */
|
|
37
|
+
find(predicate: (value: V, key: K) => boolean): V | undefined;
|
|
38
|
+
/** Iterates cached entries. @returns Cache iterator. */
|
|
39
|
+
[Symbol.iterator](): IterableIterator<[K, V]>;
|
|
32
40
|
}
|
|
33
41
|
/** Generic REST-backed resource manager. @typeParam K Resource key type. @typeParam V Resource type. */
|
|
34
42
|
export declare class ResourceManager<K, V> extends Manager<K, V> {
|
package/dist/managers/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { Manager, ResourceManager } from "./base.js";
|
|
|
3
3
|
/** Discord.js-familiar alias for {@link ResourceManager}. */
|
|
4
4
|
export { ResourceManager as CachedManager } from "./base.js";
|
|
5
5
|
import { REST } from "@lunibee/rest";
|
|
6
|
+
import type { AllowedMentions } from "@lunibee/types";
|
|
6
7
|
import { Channel, Message, User } from "@lunibee/structures";
|
|
7
8
|
import { MessageManager, type MessageCacheOptions, type MessageCreateOptions as ManagerMessageCreateOptions } from "./message.js";
|
|
8
9
|
import { ThreadManager } from "./thread.js";
|
|
@@ -53,7 +54,7 @@ export declare class ChannelManager extends Manager<string, Channel> {
|
|
|
53
54
|
*/
|
|
54
55
|
constructor(rest: REST, options?: {
|
|
55
56
|
messageCache?: MessageCacheOptions;
|
|
56
|
-
allowedMentions?:
|
|
57
|
+
allowedMentions?: AllowedMentions;
|
|
57
58
|
});
|
|
58
59
|
messages(channelId: string): MessageManager;
|
|
59
60
|
/** Permission overwrite manager for a channel. */
|