Skip to content

Commit eab66d4

Browse files
authored
🤖 Merge PR DefinitelyTyped#73967 feat(rails__actioncable): Add Subscription.send() method by @shunichi
1 parent 58c8133 commit eab66d4

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

‎types/rails__actioncable/index.d.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export class Subscription<M extends BaseMixin = BaseMixin> {
4141

4242
constructor(consumer: Consumer, params: ChannelNameWithParams, mixin: M);
4343
perform(action: string, data?: object): boolean;
44+
send(data: any): boolean;
4445
unsubscribe(): this;
4546
}
4647

‎types/rails__actioncable/rails__actioncable-tests.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ consumer.disconnect(); // $ExpectType void
5353
subscription.away();
5454
subscription.perform("action"); // $ExpectType boolean
5555
subscription.perform("action", {}); // $ExpectType boolean
56+
subscription.send({ hello: "world" }); // $ExpectType boolean
5657
subscription.unsubscribe();
5758

5859
// @ts-expect-error (typo)

0 commit comments

Comments
 (0)