You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: blog/2025-02-14-typescript-sdk-release.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -147,7 +147,7 @@ export interface Main {
147
147
}
148
148
```
149
149
150
-
Notice how the `$type` property is defined as optional (`?:`) here. This is due to the fact that lexicons can define schemas that can be referenced from other places than open unions. In those places, there might not be any ambiguity as to how the data should be interpreted. For example, an embed that represents a "Record With Media" has a `record` property that expects an `app.bsky.embed.record` object:
150
+
Notice how the `$type` property is defined as optional (`?:`) here. This is due to the fact that lexicons can define schemas that can be referenced in places other than open unions. In those places, there might not be any ambiguity as to how the data should be interpreted. For example, an embed that represents a "Record With Media" has a `record` property that expects an `app.bsky.embed.record` object:
151
151
152
152
```typescript
153
153
exportinterfaceMain {
@@ -247,8 +247,8 @@ export function isMain(value: unknown): values is Main {
247
247
248
248
That implementation of the discriminator is invalid.
249
249
250
-
-Fist because a `$type` is not allowed to end with `#main` ([as per AT Protocol specification](https://atproto.com/specs/lexicon#lexicon-files)).
251
-
- Second because the `isMain` function does not actually check the structure of the object, only its `$type` property.
250
+
-First, because a `$type` is not allowed to end with `#main` ([as per AT Protocol specification](https://atproto.com/specs/lexicon#lexicon-files)).
251
+
- Second, because the `isMain` function does not actually check the structure of the object, only its `$type` property.
252
252
253
253
This invalid behavior could yield runtime errors that could otherwise have been avoided during development:
254
254
@@ -280,11 +280,11 @@ Because this release introduces other breaking changes, and because adapting our
280
280
281
281
:::tip
282
282
283
-
In lots of cases where data needs to be discriminated, this change in the signature of the `is*` function will actually not cause any issue when upgrading the version of the SDK.
283
+
In many cases where data needs to be discriminated, this change in the signature of the `is*` function won't actually cause any issues when upgrading the version of the SDK.
284
284
285
285
:::
286
286
287
-
For example, this is the case when working with data obtained from the API. Because an API is a "contract" between a server and a client, the data returned by the server is "guaranteed" to be valid. In these cases, the `is*` utility methods provide a convenient way to discriminate between valid values.
287
+
For example, this is the case when working with data obtained from the API. Because an API is a "contract" between a server and a client, **the data returned by Bluesky's server APIs is "guaranteed" to be valid.** In these cases, the `is*` utility methods provide a convenient way to discriminate between valid values.
288
288
289
289
```typescript
290
290
import { AppBskyEmbedImages } from'@atproto/api'
@@ -333,7 +333,7 @@ import { AppBskyEmbedImages } from '@atproto/api'
0 commit comments