Skip to content

Commit 07307a2

Browse files
more typos
1 parent c5aecf5 commit 07307a2

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

blog/2025-02-14-typescript-sdk-release.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,15 @@ For example, a "Bluesky Like" (`app.bsky.feed.like`) defines the following prope
161161

162162
As can be seen, the `subject` property is defined as a reference to a `com.atproto.repo.strongRef` object. In this case, there is no ambiguity as to how the `subject` of a like should be interpreted, and the `$type` property is not needed.
163163

164-
```javascript
164+
```typescript
165165
const like: AppBskyFeedLike.Record = {
166166
$type: 'app.bsky.feed.like',
167167
createdAt: '2021-09-01T12:34:56Z',
168168
subject: {
169169
// No `$type` property needed here
170170
uri: 'at://did:plc:123/app.bsky.feed.post/456',
171-
cid: '[...]'
172-
}
171+
cid: '[...]',
172+
},
173173
}
174174
```
175175

@@ -196,7 +196,7 @@ export interface Record {
196196

197197
In addition to preventing the _creation_ of invalid data as seen before, this change also allows properly discriminating types when _accessing_ the data. For example, one can now do:
198198

199-
```tsx
199+
```typescript
200200
import { AppBskyFeedPost } from '@atproto/api'
201201

202202
// Say we got some random post somehow (typically
@@ -373,9 +373,12 @@ import { AppBskyEmbedVideo } from '@atproto/api'
373373

374374
const embed: AppBskyEmbedVideo.Main = {
375375
$type: 'app.bsky.embed.video',
376-
video: { /* omitted */ }
376+
video: {
377+
/* omitted */
378+
},
379+
377380
// Notice the typo in `alt`, not resulting in a TypeScript error
378-
atl: 'My video'
381+
atl: 'My video',
379382
}
380383
```
381384

@@ -386,11 +389,15 @@ import { AppBskyEmbedVideo } from '@atproto/api'
386389

387390
const embed: AppBskyEmbedVideo.Main = {
388391
$type: 'app.bsky.embed.video',
389-
video: { /* omitted */ }
392+
video: {
393+
/* omitted */
394+
},
390395

391-
// Next line will result in a TypeScript
392-
// error (a string is expected).
393-
alt: 123,
396+
// Next line will result in the following
397+
// TypeScript error: "Object literal may only
398+
// specify known properties, and 'atl' does not
399+
// exist in type 'Main'"
400+
atl: 'My video',
394401

395402
// Unspecified fields must now be explicitly
396403
// marked as such:

0 commit comments

Comments
 (0)