@6qat/tcp-connection 0.2.2 → 0.2.3
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 +1 -1
- package/dist/tcp-connection.d.ts +33 -0
- package/dist/tcp-connection.test.d.ts +1 -0
- package/dist/tcp-stream.d.ts +1 -1
- package/package.json +8 -6
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './tcp-stream';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Effect, Stream, Duration } from 'effect';
|
|
2
|
+
import type { TimeoutException } from 'effect/Cause';
|
|
3
|
+
declare const TcpConnectionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
4
|
+
readonly _tag: "TcpConnectionError";
|
|
5
|
+
} & Readonly<A>;
|
|
6
|
+
export declare class TcpConnectionError extends TcpConnectionError_base {
|
|
7
|
+
readonly errorType?: string | undefined;
|
|
8
|
+
constructor(errorType?: string | undefined);
|
|
9
|
+
}
|
|
10
|
+
export declare class BunError extends TcpConnectionError {
|
|
11
|
+
readonly message: string;
|
|
12
|
+
readonly errorType = "BunError";
|
|
13
|
+
constructor(message: string);
|
|
14
|
+
}
|
|
15
|
+
export interface TcpStreamConfig {
|
|
16
|
+
readonly host: string;
|
|
17
|
+
readonly port: number;
|
|
18
|
+
readonly bufferSize?: number;
|
|
19
|
+
readonly connectTimeout?: Duration.DurationInput;
|
|
20
|
+
}
|
|
21
|
+
export declare class TcpStream {
|
|
22
|
+
private readonly incomingQueue;
|
|
23
|
+
private readonly outgoingQueue;
|
|
24
|
+
private readonly performShutdown;
|
|
25
|
+
private constructor();
|
|
26
|
+
static connect(config: TcpStreamConfig): Effect.Effect<TcpStream, TcpConnectionError | TimeoutException>;
|
|
27
|
+
get incomingStream(): Stream.Stream<Uint8Array, TcpConnectionError>;
|
|
28
|
+
write(data: Uint8Array): Effect.Effect<boolean, TcpConnectionError>;
|
|
29
|
+
writeText(data: string): Effect.Effect<boolean, TcpConnectionError>;
|
|
30
|
+
close(): Effect.Effect<void>;
|
|
31
|
+
static managedStream(config: TcpStreamConfig): Stream.Stream<Uint8Array, TcpConnectionError | TimeoutException>;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/tcp-stream.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@6qat/tcp-connection",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "TCP connection library with Effect.js integration",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,11 +8,13 @@
|
|
|
8
8
|
"type": "module",
|
|
9
9
|
"files": ["dist", "README.md"],
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "bun build --minify-syntax --minify-whitespace ./src/index.ts --outdir ./dist --target node --format esm",
|
|
11
|
+
"build:main": "bun build --minify-syntax --minify-whitespace ./src/index.ts --outdir ./dist --target node --format esm",
|
|
12
12
|
"build:types": "bun tsc --emitDeclarationOnly --outDir dist",
|
|
13
|
-
"build
|
|
14
|
-
"prepublishOnly": "bun run build
|
|
15
|
-
"test": "bun test"
|
|
13
|
+
"build": "bun run build:main && bun run build:types",
|
|
14
|
+
"prepublishOnly": "bun run build",
|
|
15
|
+
"test": "bun test",
|
|
16
|
+
"format": "biome format --write ./src",
|
|
17
|
+
"lint": "biome lint ."
|
|
16
18
|
},
|
|
17
19
|
"keywords": ["tcp", "connection", "effect", "bun"],
|
|
18
20
|
"author": "Your Name",
|
|
@@ -22,7 +24,7 @@
|
|
|
22
24
|
"typescript": "^5.8.3"
|
|
23
25
|
},
|
|
24
26
|
"peerDependencies": {
|
|
25
|
-
"effect": "3.14.
|
|
27
|
+
"effect": "^3.14.21"
|
|
26
28
|
},
|
|
27
29
|
"publishConfig": {
|
|
28
30
|
"access": "public"
|