diff --git a/types/rails__actioncable/index.d.ts b/types/rails__actioncable/index.d.ts index 6acee50f973973..5d5fe1506f5e1d 100644 --- a/types/rails__actioncable/index.d.ts +++ b/types/rails__actioncable/index.d.ts @@ -41,6 +41,7 @@ export class Subscription { constructor(consumer: Consumer, params: ChannelNameWithParams, mixin: M); perform(action: string, data?: object): boolean; + send(data: any): boolean; unsubscribe(): this; } diff --git a/types/rails__actioncable/rails__actioncable-tests.ts b/types/rails__actioncable/rails__actioncable-tests.ts index 06b26fa362c924..f6339916c68d30 100644 --- a/types/rails__actioncable/rails__actioncable-tests.ts +++ b/types/rails__actioncable/rails__actioncable-tests.ts @@ -53,6 +53,7 @@ consumer.disconnect(); // $ExpectType void subscription.away(); subscription.perform("action"); // $ExpectType boolean subscription.perform("action", {}); // $ExpectType boolean + subscription.send({ hello: "world" }); // $ExpectType boolean subscription.unsubscribe(); // @ts-expect-error (typo)