Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Commit f2c7386

Browse files
committed
types(subscribe): Fix subscription & stream validateOptions types.
1 parent 5b3224a commit f2c7386

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

src/subscribe/index.ts

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,25 @@ export class Subscription extends Emitter {
2929
/** @internal */
3030
client: StreamrClient
3131
/** @internal */
32-
options: Todo
32+
options: ReturnType<typeof validateOptions> & {
33+
id?: string
34+
}
3335
/** @internal */
34-
key: Todo
36+
key
3537
/** @internal */
36-
id: Todo
38+
id
3739
/** @internal */
38-
_onDone: Todo
40+
_onDone: ReturnType<typeof Defer>
3941
/** @internal */
40-
_onFinally: Todo
42+
_onFinally
4143
/** @internal */
42-
pipeline: Todo
44+
pipeline
4345
/** @internal */
44-
msgStream: Todo
46+
msgStream
4547
/** @internal */
4648
iterated?: Todo
49+
/** @internal */
50+
debug
4751

4852
constructor(client: StreamrClient, opts: Todo, onFinally = defaultOnFinally) {
4953
super()
@@ -194,11 +198,16 @@ function multiEmit(emitters: Todo, ...args: Todo[]) {
194198
*/
195199

196200
class SubscriptionSession extends Emitter {
197-
201+
id
202+
debug
198203
client: StreamrClient
199-
options: Todo
200-
validate: Todo
201-
subscriptions: Set<Todo>
204+
options: ReturnType<typeof validateOptions> & {
205+
id: string
206+
subscribe: typeof subscribe
207+
unsubscribe: typeof unsubscribe
208+
}
209+
validate
210+
subscriptions: Set<Subscription>
202211
deletedSubscriptions: Set<Todo>
203212
step?: Todo
204213
_subscribe

src/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ export function Defer<T>(executor: (...args: Parameters<Promise<T>['then']>) =>
272272
}
273273
}
274274

275-
function handleErrBack(err: Error) {
275+
function handleErrBack(err?: Error) {
276276
if (err) {
277277
reject(err)
278278
} else {

0 commit comments

Comments
 (0)