+50
-8
packages/definitions/bluemoji/README.md
+50
-8
packages/definitions/bluemoji/README.md
···
1
1
# @atcute/bluemoji
2
2
3
-
[Bluemoji](https://github.com/aendra-rininsland/bluemoji) type definitions for `@atcute/client`, a
4
-
lightweight and cute API client for AT Protocol.
3
+
[Bluemoji](https://github.com/aendra-rininsland/bluemoji) (blue.moji.\*) schema definitions
5
4
6
5
## usage
7
6
8
-
you'd need to import `@atcute/bluemoji/lexicons` into your project, either by adding it into the
9
-
`types` field in `tsconfig.json` or by importing it on your source code.
7
+
```ts
8
+
import { BlueMojiCollectionItem } from '@atcute/bluemoji';
9
+
import { is } from '@atcute/lexicons';
10
+
11
+
const record: BlueMojiCollectionItem.Main = {
12
+
$type: 'blue.moji.collection.item',
13
+
name: 'nyoron',
14
+
alt: '',
15
+
createdAt: '2024-08-18T15:20:49.297Z',
16
+
formats: {
17
+
$type: 'blue.moji.collection.item#formats_v0',
18
+
png_128: {
19
+
$type: 'blob',
20
+
ref: {
21
+
$link: 'bafkreif32i7xs4ltlattqepkodgsqt5o7j44bfwdigjdz3u7vrgim4xwwm',
22
+
},
23
+
mimeType: 'image/png',
24
+
size: 11624,
25
+
},
26
+
original: {
27
+
$type: 'blob',
28
+
ref: {
29
+
$link: 'bafkreif32i7xs4ltlattqepkodgsqt5o7j44bfwdigjdz3u7vrgim4xwwm',
30
+
},
31
+
mimeType: 'image/png',
32
+
size: 11624,
33
+
},
34
+
webp_128: {
35
+
$type: 'blob',
36
+
ref: {
37
+
$link: 'bafkreichujvpqyapxnke5uj7mc7p6k5kqprtxbfssstoj6xjh36kcetjoe',
38
+
},
39
+
mimeType: 'image/webp',
40
+
size: 8294,
41
+
},
42
+
},
43
+
};
44
+
45
+
is(BlueMojiCollectionItem.mainSchema, record);
46
+
// -> true
47
+
```
48
+
49
+
### with `@atcute/client`
50
+
51
+
pick either one of these 3 options to register the ambient declarations
10
52
11
53
```jsonc
12
54
// tsconfig.json
13
55
{
14
56
"compilerOptions": {
15
-
"types": ["@atcute/bluemoji/lexicons"],
57
+
"types": ["@atcute/bluemoji"],
16
58
},
17
59
}
18
60
```
19
61
20
62
```ts
21
63
// env.d.ts
22
-
/// <reference types="@atcute/bluemoji/lexicons" />
64
+
/// <reference types="@atcute/bluemoji" />
23
65
```
24
66
25
67
```ts
26
68
// index.ts
27
-
import '@atcute/bluemoji/lexicons';
69
+
import type {} from '@atcute/bluemoji';
28
70
```
29
71
30
-
newly added lexicons are augmented to `@atcute/client/lexicons` module
72
+
now all the XRPC operations should be visible in the client
+2
-1
packages/definitions/bluemoji/package.json
+2
-1
packages/definitions/bluemoji/package.json
···
2
2
"type": "module",
3
3
"name": "@atcute/bluemoji",
4
4
"version": "2.0.0",
5
-
"description": "Bluemoji type definitions for atcute",
5
+
"description": "Bluemoji (blue.moji.*) schema definitions",
6
6
"license": "MIT",
7
7
"repository": {
8
8
"url": "https://github.com/mary-ext/atcute",
···
29
29
"@atcute/lexicons": "workspace:^"
30
30
},
31
31
"devDependencies": {
32
+
"@atcute/bluemoji": "file:",
32
33
"@atcute/lex-cli": "workspace:^"
33
34
}
34
35
}
+12
pnpm-lock.yaml
+12
pnpm-lock.yaml
···
233
233
specifier: workspace:^
234
234
version: link:../../core/lexicons
235
235
devDependencies:
236
+
'@atcute/bluemoji':
237
+
specifier: 'file:'
238
+
version: file:packages/definitions/bluemoji
236
239
'@atcute/lex-cli':
237
240
specifier: workspace:^
238
241
version: link:../../core/lex-cli
···
551
554
552
555
'@atcute/atproto@file:packages/definitions/atproto':
553
556
resolution: {directory: packages/definitions/atproto, type: directory}
557
+
558
+
'@atcute/bluemoji@file:packages/definitions/bluemoji':
559
+
resolution: {directory: packages/definitions/bluemoji, type: directory}
554
560
555
561
'@atcute/bluesky@file:packages/definitions/bluesky':
556
562
resolution: {directory: packages/definitions/bluesky, type: directory}
···
3266
3272
3267
3273
'@atcute/atproto@file:packages/definitions/atproto':
3268
3274
dependencies:
3275
+
'@atcute/lexicons': link:packages/core/lexicons
3276
+
3277
+
'@atcute/bluemoji@file:packages/definitions/bluemoji':
3278
+
dependencies:
3279
+
'@atcute/atproto': link:packages/definitions/atproto
3280
+
'@atcute/bluesky': link:packages/definitions/bluesky
3269
3281
'@atcute/lexicons': link:packages/core/lexicons
3270
3282
3271
3283
'@atcute/bluesky@file:packages/definitions/bluesky':