@typerighter/rpc-client 0.24.0 → 0.25.0
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/dist/core/client.d.ts +54 -0
- package/dist/core/client.js +195 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +2 -0
- package/dist/core/types.d.ts +53 -0
- package/dist/core/types.js +67 -0
- package/dist/index.d.ts +134 -0
- package/dist/index.js +114 -0
- package/package.json +7 -7
- package/src/core/client.ts +260 -0
- package/src/core/index.ts +10 -0
- package/src/core/types.ts +104 -0
- package/src/index.ts +252 -0
- package/tsconfig.json +15 -0
- package/src/typedown_server.d.ts +0 -272
- package/src/typedown_server.js +0 -9
- package/src/typedown_server_bg.js +0 -782
- package/src/typedown_server_bg.wasm +0 -0
- package/src/typedown_server_bg.wasm.d.ts +0 -42
package/src/typedown_server.d.ts
DELETED
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* A single diagnostic item with location and message
|
|
5
|
-
*/
|
|
6
|
-
export interface TdDiagnosticItem {
|
|
7
|
-
/**
|
|
8
|
-
* File path relative to the vault root
|
|
9
|
-
*/
|
|
10
|
-
filepath: string;
|
|
11
|
-
/**
|
|
12
|
-
* 1-based line number
|
|
13
|
-
*/
|
|
14
|
-
line: number;
|
|
15
|
-
/**
|
|
16
|
-
* 1-based column number
|
|
17
|
-
*/
|
|
18
|
-
column: number;
|
|
19
|
-
/**
|
|
20
|
-
* \"error\" or \"warning\
|
|
21
|
-
*/
|
|
22
|
-
severity: string;
|
|
23
|
-
/**
|
|
24
|
-
* Kebab-case diagnostic code (e.g. \"duplicate-key\", \"missing-required-field\")
|
|
25
|
-
*/
|
|
26
|
-
code: string;
|
|
27
|
-
/**
|
|
28
|
-
* Human-readable message
|
|
29
|
-
*/
|
|
30
|
-
message: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Content file event: A resource file was created, changed, or deleted
|
|
35
|
-
*/
|
|
36
|
-
export interface TdContentNotification {
|
|
37
|
-
content: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* File metadata
|
|
42
|
-
*/
|
|
43
|
-
export interface TdFileMetadata {
|
|
44
|
-
/**
|
|
45
|
-
* Last modification time as seconds since UNIX epoch
|
|
46
|
-
*/
|
|
47
|
-
mtime: number;
|
|
48
|
-
/**
|
|
49
|
-
* Creation time as seconds since UNIX epoch
|
|
50
|
-
*/
|
|
51
|
-
ctime: number;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Heading extracted from page content
|
|
56
|
-
*/
|
|
57
|
-
export interface TdHeading {
|
|
58
|
-
level: number;
|
|
59
|
-
title: string;
|
|
60
|
-
slug: string;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Lightweight sidebar item (no header/content/excerpt)
|
|
65
|
-
*/
|
|
66
|
-
export interface TdSidebarItem {
|
|
67
|
-
filepath: string;
|
|
68
|
-
schema?: string;
|
|
69
|
-
schemaLabel?: string;
|
|
70
|
-
label?: string;
|
|
71
|
-
icon?: TdIcon;
|
|
72
|
-
metadata: TdFileMetadata;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Lightweight summary of a content file (no body content)
|
|
77
|
-
*/
|
|
78
|
-
export interface TdContentSummary {
|
|
79
|
-
/**
|
|
80
|
-
* File path relative to the vault root
|
|
81
|
-
*/
|
|
82
|
-
filepath: string;
|
|
83
|
-
/**
|
|
84
|
-
* Schema type name
|
|
85
|
-
*/
|
|
86
|
-
schema?: string;
|
|
87
|
-
/**
|
|
88
|
-
* Human-readable schema label
|
|
89
|
-
*/
|
|
90
|
-
schemaLabel?: string;
|
|
91
|
-
/**
|
|
92
|
-
* Display label
|
|
93
|
-
*/
|
|
94
|
-
label?: string;
|
|
95
|
-
/**
|
|
96
|
-
* Page icon
|
|
97
|
-
*/
|
|
98
|
-
icon?: TdIcon;
|
|
99
|
-
/**
|
|
100
|
-
* Frontmatter header as JSON
|
|
101
|
-
*/
|
|
102
|
-
header: Record<string, any>;
|
|
103
|
-
/**
|
|
104
|
-
* First paragraph of the body content
|
|
105
|
-
*/
|
|
106
|
-
excerpt?: string;
|
|
107
|
-
/**
|
|
108
|
-
* File metadata
|
|
109
|
-
*/
|
|
110
|
-
metadata: TdFileMetadata;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Navigation link from typedown.yaml
|
|
115
|
-
*/
|
|
116
|
-
export interface TdNavItem {
|
|
117
|
-
title: string;
|
|
118
|
-
link: string;
|
|
119
|
-
icon?: string;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Page icon
|
|
124
|
-
*/
|
|
125
|
-
export interface TdIcon {
|
|
126
|
-
/**
|
|
127
|
-
* Lucide icon name
|
|
128
|
-
*/
|
|
129
|
-
name: string;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Result of checking all vault files for diagnostics
|
|
134
|
-
*/
|
|
135
|
-
export interface TdDiagnosticReport {
|
|
136
|
-
diagnostics: TdDiagnosticItem[];
|
|
137
|
-
fileCount: number;
|
|
138
|
-
errorCount: number;
|
|
139
|
-
warningCount: number;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Result of formatting a single file
|
|
144
|
-
*/
|
|
145
|
-
export interface TdFormatResult {
|
|
146
|
-
/**
|
|
147
|
-
* Full formatted file content (frontmatter + body)
|
|
148
|
-
*/
|
|
149
|
-
content: string;
|
|
150
|
-
/**
|
|
151
|
-
* Whether the content changed
|
|
152
|
-
*/
|
|
153
|
-
changed: boolean;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Schema file event: A schema file was created, changed, or deleted
|
|
158
|
-
*/
|
|
159
|
-
export interface TdSchemaNotification {
|
|
160
|
-
schema: string;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Schema metadata
|
|
165
|
-
*/
|
|
166
|
-
export interface TdSchemaInfo {
|
|
167
|
-
schema: string;
|
|
168
|
-
label: string;
|
|
169
|
-
properties: Record<string, any>;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Site-wide configuration derived from typedown.yaml
|
|
174
|
-
*/
|
|
175
|
-
export interface TdSiteConfig {
|
|
176
|
-
version: string;
|
|
177
|
-
/**
|
|
178
|
-
* URL base path (e.g. \"/\" or \"/docs\")
|
|
179
|
-
*/
|
|
180
|
-
basePath: string;
|
|
181
|
-
/**
|
|
182
|
-
* Vault root directory path relative to the project root
|
|
183
|
-
*/
|
|
184
|
-
rootDir: string;
|
|
185
|
-
/**
|
|
186
|
-
* Site title from typedown.yaml
|
|
187
|
-
*/
|
|
188
|
-
siteTitle: string;
|
|
189
|
-
/**
|
|
190
|
-
* Site description from typedown.yaml
|
|
191
|
-
*/
|
|
192
|
-
siteDescription: string;
|
|
193
|
-
/**
|
|
194
|
-
* Repository URL from typedown.yaml
|
|
195
|
-
*/
|
|
196
|
-
repo: string | undefined;
|
|
197
|
-
/**
|
|
198
|
-
* Site author from typedown.yaml
|
|
199
|
-
*/
|
|
200
|
-
author: string | undefined;
|
|
201
|
-
/**
|
|
202
|
-
* License name from typedown.yaml
|
|
203
|
-
*/
|
|
204
|
-
license: string | undefined;
|
|
205
|
-
publicDir: string;
|
|
206
|
-
nav: TdNavItem[];
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Structured build result: header (frontmatter), HTML content, and extracted headings
|
|
211
|
-
*/
|
|
212
|
-
export interface TdBuiltResource {
|
|
213
|
-
schema?: string;
|
|
214
|
-
/**
|
|
215
|
-
* Human-readable schema label
|
|
216
|
-
*/
|
|
217
|
-
schemaLabel?: string;
|
|
218
|
-
/**
|
|
219
|
-
* Display label
|
|
220
|
-
*/
|
|
221
|
-
label?: string;
|
|
222
|
-
/**
|
|
223
|
-
* Page icon
|
|
224
|
-
*/
|
|
225
|
-
icon?: TdIcon;
|
|
226
|
-
header: Record<string, any>;
|
|
227
|
-
/**
|
|
228
|
-
* HTML body with placeholders for code/math post-processing
|
|
229
|
-
*/
|
|
230
|
-
content: string;
|
|
231
|
-
/**
|
|
232
|
-
* Headings extracted during HTML emission
|
|
233
|
-
*/
|
|
234
|
-
headings: TdHeading[];
|
|
235
|
-
/**
|
|
236
|
-
* Page title extracted from the first h1
|
|
237
|
-
*/
|
|
238
|
-
title?: string;
|
|
239
|
-
/**
|
|
240
|
-
* File metadata
|
|
241
|
-
*/
|
|
242
|
-
metadata: TdFileMetadata;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
export function RPC_CANCELLED_CODE(): number;
|
|
247
|
-
|
|
248
|
-
export class RpcClient {
|
|
249
|
-
private constructor();
|
|
250
|
-
free(): void;
|
|
251
|
-
[Symbol.dispose](): void;
|
|
252
|
-
checkVault(): Promise<TdDiagnosticReport>;
|
|
253
|
-
close(): void;
|
|
254
|
-
static connect(addr: string, port: number): Promise<RpcClient>;
|
|
255
|
-
formatFile(path: string): Promise<TdFormatResult>;
|
|
256
|
-
getConfig(): Promise<TdSiteConfig>;
|
|
257
|
-
getSchema(schema: string): Promise<TdSchemaInfo>;
|
|
258
|
-
listFilesGroupedBySchema(): Promise<any>;
|
|
259
|
-
listSchemas(): Promise<string[]>;
|
|
260
|
-
listSidebar(): Promise<TdSidebarItem[]>;
|
|
261
|
-
listVault(): Promise<string[]>;
|
|
262
|
-
onConfigChanged(callback: Function): void;
|
|
263
|
-
onContentChanged(callback: Function): void;
|
|
264
|
-
onContentCreated(callback: Function): void;
|
|
265
|
-
onContentDeleted(callback: Function): void;
|
|
266
|
-
onDisconnect(callback: Function): void;
|
|
267
|
-
onSchemaChanged(callback: Function): void;
|
|
268
|
-
onSchemaCreated(callback: Function): void;
|
|
269
|
-
onSchemaDeleted(callback: Function): void;
|
|
270
|
-
requestFile(path: string): Promise<TdBuiltResource>;
|
|
271
|
-
requestFiles(paths: string[]): Promise<TdBuiltResource[]>;
|
|
272
|
-
}
|
package/src/typedown_server.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/* @ts-self-types="./typedown_server.d.ts" */
|
|
2
|
-
import * as wasm from "./typedown_server_bg.wasm";
|
|
3
|
-
import { __wbg_set_wasm } from "./typedown_server_bg.js";
|
|
4
|
-
|
|
5
|
-
__wbg_set_wasm(wasm);
|
|
6
|
-
wasm.__wbindgen_start();
|
|
7
|
-
export {
|
|
8
|
-
RPC_CANCELLED_CODE, RpcClient
|
|
9
|
-
} from "./typedown_server_bg.js";
|