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

Commit 0f30ab2

Browse files
committed
types(client): Explicitly type top-level groupkey handling methods.
1 parent 7c7c7d1 commit 0f30ab2

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/StreamrClient.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { BigNumber } from '@ethersproject/bignumber'
2323
import { getAddress } from '@ethersproject/address'
2424
import { Contract } from '@ethersproject/contracts'
2525
import { StreamPartDefinition } from './stream'
26+
import type { GroupKey } from './stream/Encryption'
2627

2728
// TODO get metadata type from streamr-protocol-js project (it doesn't export the type definitions yet)
2829
export type OnMessageCallback = MaybeAsync<(message: any, metadata: any) => void>
@@ -160,7 +161,7 @@ function Plugin(targetInstance: any, srcInstance: any) {
160161
}
161162

162163
// these are mixed in via Plugin function above
163-
export interface StreamrClient extends StreamEndpoints, LoginEndpoints {}
164+
export interface StreamrClient extends StreamEndpoints, LoginEndpoints, ReturnType<typeof Publisher>, Subscriber {}
164165

165166
/**
166167
* @category Important
@@ -340,16 +341,16 @@ export class StreamrClient extends EventEmitter { // eslint-disable-line no-rede
340341
return getUserId(this)
341342
}
342343

343-
setNextGroupKey(...args: Todo) {
344-
return this.publisher.setNextGroupKey(...args)
344+
setNextGroupKey(streamId: string, newKey: GroupKey) {
345+
return this.publisher.setNextGroupKey(streamId, newKey)
345346
}
346347

347-
rotateGroupKey(...args: Todo) {
348-
return this.publisher.rotateGroupKey(...args)
348+
rotateGroupKey(streamId: string) {
349+
return this.publisher.rotateGroupKey(streamId)
349350
}
350351

351-
rekey(...args: Todo) {
352-
return this.publisher.rekey(...args)
352+
rekey(streamId: string) {
353+
return this.publisher.rekey(streamId)
353354
}
354355

355356
/**

0 commit comments

Comments
 (0)