@ctrl/shared-torrent 5.0.0 → 6.1.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +10 -10
  2. package/package.json +14 -8
package/dist/index.d.ts CHANGED
@@ -1,6 +1,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
- import type { Agent } from 'http';
4
1
  export interface TorrentClient {
5
2
  config: TorrentSettings;
6
3
  getAllData: () => Promise<AllClientData>;
@@ -10,8 +7,8 @@ export interface TorrentClient {
10
7
  removeTorrent: (id: any, removeData?: boolean) => Promise<any>;
11
8
  queueUp: (id: any) => Promise<any>;
12
9
  queueDown: (id: any) => Promise<any>;
13
- addTorrent: (torrent: string | Buffer, options?: any) => Promise<any>;
14
- normalizedAddTorrent: (torrent: string | Buffer, options?: Partial<AddTorrentOptions>) => Promise<NormalizedTorrent>;
10
+ addTorrent: (torrent: string | Uint8Array, options?: any) => Promise<any>;
11
+ normalizedAddTorrent: (torrent: string | Uint8Array, options?: Partial<AddTorrentOptions>) => Promise<NormalizedTorrent>;
15
12
  }
16
13
  export interface TorrentSettings {
17
14
  /**
@@ -25,13 +22,16 @@ export interface TorrentSettings {
25
22
  username?: string;
26
23
  password?: string;
27
24
  /**
28
- * pass http agent for proxy
29
- * @link https://github.com/sindresorhus/got/blob/main/documentation/tips.md#proxying
25
+ * Pass proxy agent to ofetch
26
+ * Only supported in Node.js >= 18 using undici
27
+ *
28
+ * @see https://undici.nodejs.org/#/docs/api/Dispatcher
29
+ * @link https://github.com/unjs/ofetch#%EF%B8%8F-adding-https-agent
30
30
  */
31
- agent?: Agent;
31
+ dispatcher?: InstanceType<typeof import('undici').Dispatcher>;
32
32
  /**
33
- * request timeout
34
- * @link https://github.com/sindresorhus/got/blob/main/documentation/6-timeout.md
33
+ * global request timeout
34
+ * @link https://github.com/unjs/ofetch#%EF%B8%8F-timeout
35
35
  */
36
36
  timeout?: number;
37
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctrl/shared-torrent",
3
- "version": "5.0.0",
3
+ "version": "6.1.0",
4
4
  "description": "shared types and interfaces between torrent clients",
5
5
  "author": "Scott Cooper <scttcper@gmail.com>",
6
6
  "license": "MIT",
@@ -14,17 +14,23 @@
14
14
  "sideEffects": false,
15
15
  "keywords": [],
16
16
  "scripts": {
17
- "lint": "eslint --ext .ts .",
18
- "lint:fix": "eslint --fix --ext .ts .",
17
+ "lint": "pnpm run '/^(lint:biome|lint:eslint)$/'",
18
+ "lint:biome": "biome check .",
19
+ "lint:eslint": "eslint .",
20
+ "lint:fix": "pnpm run '/^(lint:biome|lint:eslint):fix$/'",
21
+ "lint:eslint:fix": "eslint . --fix",
22
+ "lint:biome:fix": "biome check . --write",
19
23
  "prepare": "npm run build",
20
24
  "build": "tsc"
21
25
  },
22
26
  "dependencies": {},
23
27
  "devDependencies": {
24
- "@ctrl/eslint-config": "4.0.6",
25
- "@sindresorhus/tsconfig": "4.0.0",
26
- "@types/node": "20.6.0",
27
- "typescript": "5.2.2"
28
+ "@biomejs/biome": "1.9.4",
29
+ "@ctrl/eslint-config-biome": "4.2.11",
30
+ "@sindresorhus/tsconfig": "6.0.0",
31
+ "@types/node": "22.9.0",
32
+ "typescript": "5.6.3",
33
+ "undici": "^6.20.1"
28
34
  },
29
35
  "publishConfig": {
30
36
  "access": "public",
@@ -36,6 +42,6 @@
36
42
  ]
37
43
  },
38
44
  "engines": {
39
- "node": ">=16"
45
+ "node": ">=18"
40
46
  }
41
47
  }