Skip to content

Commit 71f3628

Browse files
committed
Fix import
1 parent 2c13db3 commit 71f3628

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

@types/namespace.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ import { Provider as TProvideService } from "./interface.ts";
6565
import { Location as TLocationService } from "./services/location/location.js";
6666
import { AnimateService as TAnimateService } from "./animations/interface.ts";
6767
import { StorageBackend as TStorageBackend } from "./services/storage/interface.ts";
68+
import { StreamConnectionConfig as TStreamConnectionConfig } from "./services/stream/interface.ts";
6869
declare global {
6970
interface Function {
7071
$inject?: readonly string[] | undefined;
@@ -130,5 +131,6 @@ declare global {
130131
| (abstract new (...args: any[]) => any),
131132
> = TInjectable<T>;
132133
type StorageBackend = TStorageBackend;
134+
type StreamConnectionConfig = TStreamConnectionConfig;
133135
}
134136
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export interface StreamConnectionConfig {
2+
/** Called when the connection opens */
3+
onOpen?: (event: Event) => void;
4+
/** Called when a message is received */
5+
onMessage?: (data: any, event: Event) => void;
6+
/** Called when an error occurs */
7+
onError?: (err: any) => void;
8+
/** Called when a reconnect attempt happens */
9+
onReconnect?: (attempt: number) => void;
10+
/** Delay between reconnect attempts in milliseconds */
11+
retryDelay?: number;
12+
/** Maximum number of reconnect attempts */
13+
maxRetries?: number;
14+
/** Timeout in milliseconds to detect heartbeat inactivity */
15+
heartbeatTimeout?: number;
16+
/** Function to transform incoming messages */
17+
transformMessage?: (data: any) => any;
18+
}

src/namespace.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ import { Provider as TProvideService } from "./interface.ts";
6969
import { Location as TLocationService } from "./services/location/location.js";
7070
import { AnimateService as TAnimateService } from "./animations/interface.ts";
7171
import { StorageBackend as TStorageBackend } from "./services/storage/interface.ts";
72-
import { StreamConnectionConfig as TStreamConnectionConfig } from "./services/stream/stream";
72+
import { StreamConnectionConfig as TStreamConnectionConfig } from "./services/stream/interface.ts";
7373

7474
/* ────────────────────────────────────────────────
7575
Runtime global initialization

src/services/stream/interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
interface StreamConnectionConfig {
1+
export interface StreamConnectionConfig {
22
/** Called when the connection opens */
33
onOpen?: (event: Event) => void;
44

0 commit comments

Comments
 (0)