Skip to content

Commit 58c8133

Browse files
authored
🤖 Merge PR DefinitelyTyped#73916 fix missing actioncable adapters api by @dsh0416
1 parent 8c02c3b commit 58c8133

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

types/rails__actioncable/index.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ export interface ChannelNameWithParams {
55
[key: string]: any;
66
}
77

8+
/**
9+
* @see https://github.com/rails/rails/blob/8-0-stable/actioncable/app/javascript/action_cable/adapters.js
10+
*/
11+
export const adapters: {
12+
logger: Console;
13+
WebSocket: typeof WebSocket;
14+
};
15+
816
/**
917
* @see https://github.com/rails/rails/blob/8-0-stable/actioncable/app/javascript/action_cable/consumer.js
1018
*/

types/rails__actioncable/rails__actioncable-tests.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { createConsumer, logger } from "@rails/actioncable";
1+
import { adapters, createConsumer, logger } from "@rails/actioncable";
2+
3+
adapters.logger = window.console;
4+
adapters.WebSocket = window.WebSocket;
25

36
logger.enabled = true;
47

0 commit comments

Comments
 (0)