@atcute/whitewind 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,9 +1,30 @@
1
1
  # @atcute/whitewind
2
2
 
3
- [WhiteWind](https://whtwnd.com) type definitions for `@atcute/client`, a lightweight and cute API client for AT Protocol.
3
+ [WhiteWind](https://whtwnd.com) type definitions for `@atcute/client`, a lightweight and cute API
4
+ client for AT Protocol.
4
5
 
5
- import the lexicons module to start using it.
6
+ ## usage
7
+
8
+ you'd need to import `@atcute/whitewind/lexicons` into your project, either by adding it into the
9
+ `types` field in `tsconfig.json` or by importing it on your source code.
10
+
11
+ ```jsonc
12
+ // tsconfig.json
13
+ {
14
+ "compilerOptions": {
15
+ "types": ["@atcute/whitewind/lexicons"],
16
+ },
17
+ }
18
+ ```
6
19
 
7
20
  ```ts
21
+ // env.d.ts
22
+ /// <reference types="@atcute/whitewind/lexicons" />
23
+ ```
24
+
25
+ ```ts
26
+ // index.ts
8
27
  import '@atcute/whitewind/lexicons';
9
28
  ```
29
+
30
+ newly added lexicons are augmented to `@atcute/client/lexicons` module
@@ -0,0 +1,145 @@
1
+ /* eslint-disable */
2
+ // This file is automatically generated, do not edit!
3
+
4
+ /**
5
+ * @module
6
+ * Contains type declarations for WhiteWind lexicons
7
+ */
8
+
9
+ import '@atcute/client/lexicons';
10
+
11
+ declare module '@atcute/client/lexicons' {
12
+ namespace ComWhtwndBlogComment {
13
+ /** A declaration of a comment. */
14
+ interface Record {
15
+ $type: 'com.whtwnd.blog.comment';
16
+ /** Maximum string length: 1000 */
17
+ content: string;
18
+ entryUri: At.Uri;
19
+ }
20
+ }
21
+
22
+ namespace ComWhtwndBlogDefs {
23
+ interface BlobMetadata {
24
+ [Brand.Type]?: 'com.whtwnd.blog.defs#blobMetadata';
25
+ blobref: At.Blob;
26
+ name?: string;
27
+ }
28
+ interface BlogEntry {
29
+ [Brand.Type]?: 'com.whtwnd.blog.defs#blogEntry';
30
+ /** Maximum string length: 100000 */
31
+ content: string;
32
+ createdAt?: string;
33
+ }
34
+ interface Comment {
35
+ [Brand.Type]?: 'com.whtwnd.blog.defs#comment';
36
+ /** Maximum string length: 1000 */
37
+ content: string;
38
+ entryUri: At.Uri;
39
+ }
40
+ interface Ogp {
41
+ [Brand.Type]?: 'com.whtwnd.blog.defs#ogp';
42
+ url: string;
43
+ height?: number;
44
+ width?: number;
45
+ }
46
+ }
47
+
48
+ namespace ComWhtwndBlogEntry {
49
+ /** A declaration of a post. */
50
+ interface Record {
51
+ $type: 'com.whtwnd.blog.entry';
52
+ /** Maximum string length: 100000 */
53
+ content: string;
54
+ blobs?: ComWhtwndBlogDefs.BlobMetadata[];
55
+ createdAt?: string;
56
+ /** (DEPRECATED) Marks this entry as draft to tell AppViews not to show it to anyone except for the author */
57
+ isDraft?: boolean;
58
+ ogp?: ComWhtwndBlogDefs.Ogp;
59
+ theme?: 'github-light';
60
+ /** Maximum string length: 1000 */
61
+ title?: string;
62
+ /**
63
+ * Tells the visibility of the article to AppView.
64
+ * @default "public"
65
+ */
66
+ visibility?: 'public' | 'url' | 'author';
67
+ }
68
+ }
69
+
70
+ /** Get blog posts associated to designated author. */
71
+ namespace ComWhtwndBlogGetAuthorPosts {
72
+ interface Params {
73
+ author: At.DID;
74
+ }
75
+ type Input = undefined;
76
+ interface Output {
77
+ post: ComWhtwndBlogDefs.BlogEntry[];
78
+ }
79
+ }
80
+
81
+ /** Get AT URI by blog author and entry name. If there are multiple blog entries associated with the name, return the latest one. */
82
+ namespace ComWhtwndBlogGetEntryMetadataByName {
83
+ interface Params {
84
+ author: string;
85
+ entryTitle: string;
86
+ }
87
+ type Input = undefined;
88
+ interface Output {
89
+ entryUri: At.Uri;
90
+ cid?: At.CID;
91
+ lastUpdate?: string;
92
+ }
93
+ interface Errors {
94
+ NotFound: {};
95
+ }
96
+ }
97
+
98
+ /** Get comments associated to designated post. */
99
+ namespace ComWhtwndBlogGetMentionsByEntry {
100
+ interface Params {
101
+ postUri: At.Uri;
102
+ }
103
+ type Input = undefined;
104
+ interface Output {
105
+ mentions: At.Uri[];
106
+ }
107
+ }
108
+
109
+ /** Notify AppView of existence of new entry and request indexing */
110
+ namespace ComWhtwndBlogNotifyOfNewEntry {
111
+ interface Params {}
112
+ interface Input {
113
+ entryUri: At.Uri;
114
+ }
115
+ interface Output {}
116
+ interface Errors {}
117
+ }
118
+
119
+ interface Records {
120
+ 'com.whtwnd.blog.comment': ComWhtwndBlogComment.Record;
121
+ 'com.whtwnd.blog.entry': ComWhtwndBlogEntry.Record;
122
+ }
123
+
124
+ interface Queries {
125
+ 'com.whtwnd.blog.getAuthorPosts': {
126
+ params: ComWhtwndBlogGetAuthorPosts.Params;
127
+ output: ComWhtwndBlogGetAuthorPosts.Output;
128
+ };
129
+ 'com.whtwnd.blog.getEntryMetadataByName': {
130
+ params: ComWhtwndBlogGetEntryMetadataByName.Params;
131
+ output: ComWhtwndBlogGetEntryMetadataByName.Output;
132
+ };
133
+ 'com.whtwnd.blog.getMentionsByEntry': {
134
+ params: ComWhtwndBlogGetMentionsByEntry.Params;
135
+ output: ComWhtwndBlogGetMentionsByEntry.Output;
136
+ };
137
+ }
138
+
139
+ interface Procedures {
140
+ 'com.whtwnd.blog.notifyOfNewEntry': {
141
+ input: ComWhtwndBlogNotifyOfNewEntry.Input;
142
+ output: ComWhtwndBlogNotifyOfNewEntry.Output;
143
+ };
144
+ }
145
+ }
package/package.json CHANGED
@@ -1,14 +1,18 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@atcute/whitewind",
4
- "version": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "description": "WhiteWind type definitions for atcute",
6
6
  "license": "MIT",
7
7
  "repository": {
8
- "url": "https://codeberg.org/mary-ext/atcute"
8
+ "url": "https://github.com/mary-ext/atcute",
9
+ "directory": "packages/definitions/whitewind"
9
10
  },
10
11
  "files": [
11
- "dist/"
12
+ "dist/",
13
+ "lib/",
14
+ "!lib/**/*.bench.ts",
15
+ "!lib/**/*.test.ts"
12
16
  ],
13
17
  "exports": {
14
18
  "./lexicons": "./dist/lexicons.js"
@@ -17,8 +21,8 @@
17
21
  "@atcute/client": "^1.0.0 || ^2.0.0"
18
22
  },
19
23
  "devDependencies": {
20
- "@atcute/client": "^2.0.0",
21
- "@atcute/lex-cli": "^1.0.0"
24
+ "@atcute/client": "^2.0.4",
25
+ "@atcute/lex-cli": "^1.0.3"
22
26
  },
23
27
  "scripts": {
24
28
  "build": "tsc",