@solarpunkltd/swarm-chat-js 0.0.1

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.
@@ -0,0 +1,2 @@
1
+ export declare function sleep(delay: number): Promise<unknown>;
2
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/utils/common.ts"],"names":[],"mappings":"AAKA,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,oBAIlC"}
@@ -0,0 +1,11 @@
1
+ type Listener<T = any> = (data: T) => void;
2
+ export declare class EventEmitter {
3
+ private events;
4
+ constructor();
5
+ on<T = any>(event: string, listener: Listener<T>): void;
6
+ off<T = any>(event: string, listener: Listener<T>): void;
7
+ cleanAll(): void;
8
+ emit<T = any>(event: string, data: T): void;
9
+ }
10
+ export {};
11
+ //# sourceMappingURL=eventEmitter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventEmitter.d.ts","sourceRoot":"","sources":["../../src/utils/eventEmitter.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;AAM3C,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAc;;IASrB,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAOvD,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAQxD,QAAQ,IAAI,IAAI;IAIhB,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI;CAInD"}
@@ -0,0 +1,21 @@
1
+ type Task = () => void | Promise<void>;
2
+ export declare class Queue {
3
+ private tasks;
4
+ private isProcessing;
5
+ private isWaiting;
6
+ private clearWaitTime;
7
+ private handleError;
8
+ constructor(settings: {
9
+ clearWaitTime?: number;
10
+ } | undefined, handleError: (errObject: {
11
+ error: Error;
12
+ context: string;
13
+ throw: boolean;
14
+ }) => void);
15
+ private processQueue;
16
+ enqueue(task: Task): void;
17
+ clearQueue(): Promise<void>;
18
+ waitForProcessing(): Promise<boolean>;
19
+ }
20
+ export {};
21
+ //# sourceMappingURL=queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/utils/queue.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,GAAG,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEvC,qBAAa,KAAK;IAChB,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,WAAW,CAAyE;gBAG1F,QAAQ,EAAE;QACR,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,YAAK,EACN,WAAW,EAAE,CAAC,SAAS,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI;YAMvE,YAAY;IA0BnB,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAKnB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAO3B,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC;CAYnD"}
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@solarpunkltd/swarm-chat-js",
3
+ "version": "0.0.1",
4
+ "description": "JS library for chatting on Swarm",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.esm.js",
7
+ "types": "dist/index.d.ts",
8
+ "license": "Apache-2.0",
9
+ "keywords": [
10
+ "swarm",
11
+ "js",
12
+ "streaming"
13
+ ],
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/Solar-Punk-Ltd/swarm-chat-js"
17
+ },
18
+ "bugs": {
19
+ "url": "https://github.com/Solar-Punk-Ltd/swarm-chat-js/issues"
20
+ },
21
+ "author": "levente.kiss@solarpunk.buzz",
22
+ "scripts": {
23
+ "build": "tsc && vite build",
24
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
25
+ "lint:fix": "npm run lint -- --fix",
26
+ "prepare": "npm run build"
27
+ },
28
+ "dependencies": {
29
+ "@ethersphere/bee-js": "^8.1.0",
30
+ "@solarpunkltd/gsoc": "^0.2.3",
31
+ "ethers": "^6.13.3",
32
+ "uuid": "^11.0.3"
33
+ },
34
+ "devDependencies": {
35
+ "@types/node": "^22.7.5",
36
+ "@typescript-eslint/eslint-plugin": "^6.14.0",
37
+ "@typescript-eslint/parser": "^6.14.0",
38
+ "eslint": "^8.55.0",
39
+ "eslint-config-prettier": "^8.10.0",
40
+ "eslint-plugin-import": "^2.29.1",
41
+ "eslint-plugin-prettier": "^4.2.1",
42
+ "eslint-plugin-react-refresh": "^0.4.5",
43
+ "eslint-plugin-simple-import-sort": "^10.0.0",
44
+ "prettier": "^2.8.8",
45
+ "typescript": "^5.2.2",
46
+ "vite": "^5.0.8",
47
+ "vite-plugin-dts": "^4.2.4",
48
+ "vite-plugin-node-polyfills": "^0.19.0"
49
+ },
50
+ "files": [
51
+ "dist",
52
+ "README.md"
53
+ ],
54
+ "exports": {
55
+ ".": {
56
+ "import": "./dist/index.esm.js",
57
+ "require": "./dist/index.js",
58
+ "types": "./dist/index.d.ts"
59
+ }
60
+ },
61
+ "browserslist": {
62
+ "production": [
63
+ ">0.2%",
64
+ "not dead",
65
+ "not op_mini all"
66
+ ]
67
+ }
68
+ }