@ctrl/shared-torrent 6.1.0 → 6.2.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/dist/index.d.ts +40 -11
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
@@ -1,16 +1,41 @@
|
|
1
1
|
export interface TorrentClient {
|
2
|
-
config:
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
2
|
+
config: TorrentClientConfig;
|
3
|
+
state: TorrentClientState;
|
4
|
+
/**
|
5
|
+
* Create a new client instance from an existing state.
|
6
|
+
*/
|
7
|
+
createFromState(config: TorrentClientConfig, state: TorrentClientState): TorrentClient;
|
8
|
+
/**
|
9
|
+
* Export the current state of the client. Can be restored with `createFromState`.
|
10
|
+
*/
|
11
|
+
exportState(): TorrentClientState;
|
12
|
+
/**
|
13
|
+
* Returns all torrent data. Data has been normalized
|
14
|
+
*/
|
15
|
+
getAllData(): Promise<AllClientData>;
|
16
|
+
getTorrent(id: any): Promise<NormalizedTorrent>;
|
17
|
+
pauseTorrent(id: any): Promise<unknown>;
|
18
|
+
resumeTorrent(id: any): Promise<unknown>;
|
19
|
+
removeTorrent(id: any, removeData?: boolean): Promise<unknown>;
|
20
|
+
queueUp(id: any): Promise<unknown>;
|
21
|
+
queueDown(id: any): Promise<unknown>;
|
22
|
+
addTorrent(torrent: string | Uint8Array, options?: any): Promise<unknown>;
|
23
|
+
normalizedAddTorrent(torrent: string | Uint8Array, options?: Partial<AddTorrentOptions>): Promise<NormalizedTorrent>;
|
24
|
+
}
|
25
|
+
/**
|
26
|
+
* A JSON serializable object that stores the state of the client.
|
27
|
+
*/
|
28
|
+
export interface TorrentClientState {
|
29
|
+
/**
|
30
|
+
* Authentication credentials
|
31
|
+
*/
|
32
|
+
auth?: Record<string, unknown>;
|
33
|
+
/**
|
34
|
+
* Client version information
|
35
|
+
*/
|
36
|
+
version?: Record<string, unknown>;
|
12
37
|
}
|
13
|
-
export interface
|
38
|
+
export interface TorrentClientConfig {
|
14
39
|
/**
|
15
40
|
* ex - `http://localhost:4444/
|
16
41
|
*/
|
@@ -35,6 +60,10 @@ export interface TorrentSettings {
|
|
35
60
|
*/
|
36
61
|
timeout?: number;
|
37
62
|
}
|
63
|
+
/**
|
64
|
+
* @deprecated Use `TorrentClientConfig` instead.
|
65
|
+
*/
|
66
|
+
export type TorrentSettings = TorrentClientConfig;
|
38
67
|
export declare enum TorrentState {
|
39
68
|
downloading = "downloading",
|
40
69
|
seeding = "seeding",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ctrl/shared-torrent",
|
3
|
-
"version": "6.
|
3
|
+
"version": "6.2.0",
|
4
4
|
"description": "shared types and interfaces between torrent clients",
|
5
5
|
"author": "Scott Cooper <scttcper@gmail.com>",
|
6
6
|
"license": "MIT",
|
@@ -26,11 +26,11 @@
|
|
26
26
|
"dependencies": {},
|
27
27
|
"devDependencies": {
|
28
28
|
"@biomejs/biome": "1.9.4",
|
29
|
-
"@ctrl/eslint-config-biome": "4.
|
30
|
-
"@sindresorhus/tsconfig": "
|
31
|
-
"@types/node": "22.
|
32
|
-
"typescript": "5.
|
33
|
-
"undici": "^
|
29
|
+
"@ctrl/eslint-config-biome": "4.3.1",
|
30
|
+
"@sindresorhus/tsconfig": "7.0.0",
|
31
|
+
"@types/node": "22.10.2",
|
32
|
+
"typescript": "5.7.2",
|
33
|
+
"undici": "^7.2.0"
|
34
34
|
},
|
35
35
|
"publishConfig": {
|
36
36
|
"access": "public",
|