@types/hotwired__turbo-rails
v8.0.0
Published
TypeScript definitions for @hotwired/turbo-rails
Readme
Installation
npm install --save @types/hotwired__turbo-rails
Summary
This package contains type definitions for @hotwired/turbo-rails (https://github.com/hotwired/turbo-rails).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hotwired__turbo-rails.
index.d.ts
import * as Turbo from "@hotwired/turbo";
import { BaseMixin, ChannelNameWithParams, Consumer, Subscription } from "@rails/actioncable";
export { Turbo };
export namespace cable {
function getConsumer(): Promise<Consumer>;
function setConsumer(newConsumer: Consumer): Consumer;
function createConsumer(): Promise<Consumer>;
function subscribeTo<M extends BaseMixin = {}>(
channel: string | ChannelNameWithParams,
mixin?: M & ThisType<Subscription & M>,
): Promise<Subscription & M>;
}
declare class TurboCableStreamSourceElement extends HTMLElement {
static readonly observedAttributes: string[];
connectedCallback(): Promise<void>;
disconnectedCallback(): void;
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
dispatchMessageEvent(data: string): boolean;
subscriptionConnected(): void;
subscriptionDisconnected(): void;
readonly channel: ChannelNameWithParams;
subscription: Subscription | undefined;
}
declare global {
interface HTMLElementTagNameMap {
"turbo-cable-stream-source": TurboCableStreamSourceElement;
}
}
Additional Details
- Last updated: Fri, 06 Mar 2026 02:55:52 GMT
- Dependencies: @types/hotwired__turbo, @types/rails__actioncable
Credits
These definitions were written by Alexander Brandon Coles, and Gareth Jones.
