Commit 7667906
committed
refactor(P060): tighten BridgeResult.error.code to a typed union
Bridge-owned codes (bad_input, bridge_disposed, iframe_not_ready,
missing_result, timeout) are now literal types; iframe-forwarded codes
(bad_request:*, forbidden:*, etc.) pass through via `string & {}` so
arbitrary strings still compile. The `& {}` idiom preserves IDE
autocomplete for the bridge-owned literals — typos like
`code: 'iframe_not_redy'` show up in suggestions; bridge-emitted code
is now self-documenting at the type level. Narrowing on a specific
iframe code stays the consumer's responsibility.
Exports BridgeErrorCode from the embed-bridge barrel so future
adapter / consumer code can reference the type if it ever needs to.1 parent 735945a commit 7667906
2 files changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
4 | 14 | | |
5 | 15 | | |
6 | | - | |
| 16 | + | |
7 | 17 | | |
8 | 18 | | |
9 | 19 | | |
| |||
0 commit comments