Skip to content

Commit 04ea009

Browse files
committed
docs(typed-channel): update auto-generated DSL reference
1 parent fe67840 commit 04ea009

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

documentation/dsls/DSL-AshTypescript.TypedChannel.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ This file was generated by Spark. Do not edit it by hand.
66
Spark DSL extension for defining typed Phoenix channel event subscriptions.
77

88
Declares which Ash PubSub publications a channel intercepts. For each declared
9-
event, AshTypescript reads the publication's `returns` Ash.Type and generates
10-
a typed TypeScript payload type. An event map and typed subscription helper
11-
are also generated for the channel.
9+
event, AshTypescript reads the publication's `returns` type and generates a
10+
typed TypeScript payload type. An event map and typed subscription helper are
11+
also generated for the channel.
12+
13+
The recommended way to get typed payloads is to use `transform :some_calc` on
14+
publications, pointing to a resource calculation with `:auto` typing. Ash
15+
auto-derives the `returns` type from the calculation expression. You can also
16+
use explicit `returns:` with an anonymous function transform.
1217

1318
## Usage
1419

@@ -86,8 +91,9 @@ publish event
8691
Declare a PubSub event to intercept on this channel.
8792

8893
The event name must match the `event` option (or action name fallback) of
89-
a publication on the resource. The publication must have `returns` set for
90-
TypeScript type generation.
94+
a publication on the resource. The publication must have a `returns` type
95+
for TypeScript type generation — either auto-derived via `transform :calc`
96+
or explicitly set via `returns:`.
9197

9298

9399

0 commit comments

Comments
 (0)