@shisho/plugin-sdk 0.0.21

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 ADDED
@@ -0,0 +1,119 @@
1
+ # @shisho/plugin-sdk
2
+
3
+ TypeScript SDK for [Shisho](https://github.com/shishobooks/shisho) plugin development. Provides IDE autocompletion and type checking for the `shisho.*` host APIs, hook contexts, metadata structures, and manifest schema.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install --save-dev @shisho/plugin-sdk
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ The types provide autocompletion for:
14
+
15
+ - **`shisho.*`** - Host APIs (log, config, http, fs, archive, xml, ffmpeg)
16
+ - **`plugin`** - Hook structure (inputConverter, fileParser, metadataEnricher, outputGenerator)
17
+ - **Hook contexts** - Typed `context` parameters for each hook method
18
+ - **Return types** - `ParsedMetadata`, `ConvertResult`, `SearchResponse`, etc.
19
+
20
+ ### TypeScript
21
+
22
+ If you write your plugin in TypeScript (and compile to JavaScript for deployment), import the types directly:
23
+
24
+ ```typescript
25
+ import type {
26
+ FileParserContext,
27
+ ParsedMetadata,
28
+ SearchContext,
29
+ SearchResponse,
30
+ ShishoPlugin,
31
+ } from "@shisho/plugin-sdk";
32
+
33
+ const plugin: ShishoPlugin = {
34
+ fileParser: {
35
+ parse(context: FileParserContext): ParsedMetadata {
36
+ const content = shisho.fs.readTextFile(context.filePath);
37
+ return {
38
+ title: "My Book",
39
+ authors: [{ name: "Author Name", role: "writer" }],
40
+ identifiers: [{ type: "isbn_13", value: "9781234567890" }],
41
+ };
42
+ },
43
+ },
44
+
45
+ metadataEnricher: {
46
+ search(context: SearchContext): SearchResponse {
47
+ const apiKey = shisho.config.get("apiKey");
48
+ const resp = shisho.http.fetch(
49
+ `https://api.example.com/search?q=${context.query}`,
50
+ { method: "GET" },
51
+ );
52
+ const data = resp.json() as {
53
+ results: Array<{ title: string; description: string }>;
54
+ };
55
+ return {
56
+ results: data.results.map((r) => ({
57
+ title: r.title,
58
+ description: r.description,
59
+ })),
60
+ };
61
+ },
62
+ },
63
+ };
64
+ ```
65
+
66
+ ### JavaScript with JSDoc
67
+
68
+ Add a triple-slash reference at the top of your `main.js` and use JSDoc annotations for type checking:
69
+
70
+ ```javascript
71
+ /// <reference types="@shisho/plugin-sdk" />
72
+
73
+ var plugin = (function () {
74
+ return {
75
+ fileParser: {
76
+ /** @param {FileParserContext} context @returns {ParsedMetadata} */
77
+ parse: function (context) {
78
+ var content = shisho.fs.readTextFile(context.filePath);
79
+ return {
80
+ title: "My Book",
81
+ authors: [{ name: "Author Name" }],
82
+ };
83
+ },
84
+ },
85
+
86
+ metadataEnricher: {
87
+ /** @param {SearchContext} context @returns {SearchResponse} */
88
+ search: function (context) {
89
+ var apiKey = shisho.config.get("apiKey");
90
+ var resp = shisho.http.fetch(
91
+ "https://api.example.com/search?q=" + context.query,
92
+ { method: "GET" },
93
+ );
94
+ var data = resp.json();
95
+ return {
96
+ results: data.results.map(function (r) {
97
+ return { title: r.title, description: r.description };
98
+ }),
99
+ };
100
+ },
101
+ },
102
+ };
103
+ })();
104
+ ```
105
+
106
+ ## What's Included
107
+
108
+ | File | Contents |
109
+ | --------------- | --------------------------------------------------------------------- |
110
+ | `global.d.ts` | Global `shisho` and `plugin` variable declarations |
111
+ | `host-api.d.ts` | `ShishoHostAPI` and all namespace interfaces |
112
+ | `hooks.d.ts` | Hook context/result types and `ShishoPlugin` interface |
113
+ | `metadata.d.ts` | `ParsedMetadata`, `ParsedAuthor`, `ParsedIdentifier`, `ParsedChapter` |
114
+ | `manifest.d.ts` | `PluginManifest`, `Capabilities`, `ConfigSchema` |
115
+
116
+ ## Links
117
+
118
+ - [Plugin Development Guide](https://github.com/shishobooks/shisho/blob/master/docs/plugins.md)
119
+ - [Shisho Repository](https://github.com/shishobooks/shisho)
package/global.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import { ShishoPlugin } from "./hooks";
2
+ import { ShishoHostAPI } from "./host-api";
3
+
4
+ declare global {
5
+ /** Host API object providing logging, config, HTTP, URL utilities, filesystem, archive, XML, FFmpeg, and shell access. */
6
+ var shisho: ShishoHostAPI;
7
+ /** Plugin object that defines hook implementations. */
8
+ var plugin: ShishoPlugin;
9
+ }
package/hooks.d.ts ADDED
@@ -0,0 +1,130 @@
1
+ import { ParsedMetadata } from "./metadata";
2
+
3
+ /** Context passed to inputConverter.convert(). */
4
+ export interface InputConverterContext {
5
+ /** Path to the input file. */
6
+ sourcePath: string;
7
+ /** Directory where the converted output should be written. */
8
+ targetDir: string;
9
+ }
10
+
11
+ /** Result returned from inputConverter.convert(). */
12
+ export interface ConvertResult {
13
+ /** Whether conversion succeeded. */
14
+ success: boolean;
15
+ /** Path to the converted output file. */
16
+ targetPath: string;
17
+ }
18
+
19
+ /** Context passed to fileParser.parse(). */
20
+ export interface FileParserContext {
21
+ /** Path to the file being parsed. */
22
+ filePath: string;
23
+ /** File extension (e.g., "pdf", "epub"). */
24
+ fileType: string;
25
+ }
26
+
27
+ /** Context passed to metadataEnricher.search(). */
28
+ export interface SearchContext {
29
+ /** Search query — title or free-text. Always present. */
30
+ query: string;
31
+ /** Author name to narrow results. Optional. */
32
+ author?: string;
33
+ /** Structured identifiers for direct lookup (ISBN, ASIN, etc.). Optional. */
34
+ identifiers?: Array<{ type: string; value: string }>;
35
+ /** Read-only file metadata for matching hints. Not user-editable. */
36
+ file?: {
37
+ /** File type extension (e.g., "epub", "cbz", "m4b", "pdf"). */
38
+ fileType?: string;
39
+ /** Audiobook duration in seconds. */
40
+ duration?: number;
41
+ /** Number of pages (CBZ/PDF). */
42
+ pageCount?: number;
43
+ /** File size in bytes. */
44
+ filesizeBytes?: number;
45
+ };
46
+ }
47
+
48
+ /** Result returned from metadataEnricher.search(). */
49
+ export interface SearchResponse {
50
+ results: ParsedMetadata[];
51
+ }
52
+
53
+ /** Context passed to outputGenerator.generate(). */
54
+ export interface OutputGeneratorContext {
55
+ /** Path to the source book file. */
56
+ sourcePath: string;
57
+ /** Path where the output file should be written. */
58
+ destPath: string;
59
+ /** Book metadata. */
60
+ book: {
61
+ title?: string;
62
+ authors?: Array<{ name: string; role?: string }>;
63
+ series?: string;
64
+ seriesNumber?: number;
65
+ publisher?: string;
66
+ description?: string;
67
+ genres?: string[];
68
+ tags?: string[];
69
+ identifiers?: Array<{ type: string; value: string }>;
70
+ };
71
+ /** File metadata. */
72
+ file: {
73
+ fileType?: string;
74
+ filePath?: string;
75
+ };
76
+ }
77
+
78
+ /** Context passed to outputGenerator.fingerprint(). */
79
+ export interface FingerprintContext {
80
+ /** Book metadata. */
81
+ book: {
82
+ title?: string;
83
+ authors?: Array<{ name: string; role?: string }>;
84
+ series?: string;
85
+ seriesNumber?: number;
86
+ publisher?: string;
87
+ };
88
+ /** File metadata. */
89
+ file: {
90
+ fileType?: string;
91
+ filePath?: string;
92
+ };
93
+ }
94
+
95
+ /** Input converter hook. */
96
+ export interface InputConverterHook {
97
+ convert(context: InputConverterContext): ConvertResult;
98
+ }
99
+
100
+ /** File parser hook. */
101
+ export interface FileParserHook {
102
+ parse(context: FileParserContext): ParsedMetadata;
103
+ }
104
+
105
+ /** Metadata enricher hook. */
106
+ export interface MetadataEnricherHook {
107
+ /** Search for candidate results from external sources. */
108
+ search(context: SearchContext): SearchResponse;
109
+ }
110
+
111
+ /** Output generator hook. */
112
+ export interface OutputGeneratorHook {
113
+ generate(context: OutputGeneratorContext): void;
114
+ fingerprint(context: FingerprintContext): string;
115
+ }
116
+
117
+ /** The plugin object exported by main.js via IIFE. */
118
+ export interface ShishoPlugin {
119
+ inputConverter?: InputConverterHook;
120
+ fileParser?: FileParserHook;
121
+ metadataEnricher?: MetadataEnricherHook;
122
+ outputGenerator?: OutputGeneratorHook;
123
+
124
+ /**
125
+ * Optional lifecycle hook called before the plugin is uninstalled.
126
+ * Use this to clean up resources (revoke tokens, delete caches, close connections).
127
+ * Errors in this hook do not prevent uninstall.
128
+ */
129
+ onUninstalling?: () => void;
130
+ }
package/host-api.d.ts ADDED
@@ -0,0 +1,408 @@
1
+ /** Logging methods. */
2
+ export interface ShishoLog {
3
+ debug(msg: string): void;
4
+ info(msg: string): void;
5
+ warn(msg: string): void;
6
+ error(msg: string): void;
7
+ }
8
+
9
+ /** Plugin configuration access. */
10
+ export interface ShishoConfig {
11
+ /** Get a single config value by key. Returns undefined if not set. */
12
+ get(key: string): string | undefined;
13
+ /** Get all config values as a key-value map. */
14
+ getAll(): Record<string, string>;
15
+ }
16
+
17
+ /** Options for shisho.http.fetch(). */
18
+ export interface FetchOptions {
19
+ /** HTTP method (default: "GET"). */
20
+ method?: string;
21
+ /** Request headers. */
22
+ headers?: Record<string, string>;
23
+ /** Request body string. */
24
+ body?: string;
25
+ }
26
+
27
+ /** Response from shisho.http.fetch(). */
28
+ export interface FetchResponse {
29
+ /** Whether the status code is 2xx. */
30
+ ok: boolean;
31
+ /** HTTP status code. */
32
+ status: number;
33
+ /** HTTP status text. */
34
+ statusText: string;
35
+ /** Response headers (lowercase keys). */
36
+ headers: Record<string, string>;
37
+ /** Get response body as string. */
38
+ text(): string;
39
+ /** Get response body as ArrayBuffer. */
40
+ arrayBuffer(): ArrayBuffer;
41
+ /** Parse response body as JSON. */
42
+ json(): unknown;
43
+ }
44
+
45
+ /**
46
+ * HTTP client with domain whitelisting.
47
+ *
48
+ * Domain patterns in manifest httpAccess.domains:
49
+ * - Exact match: "example.com" only allows "example.com"
50
+ * - Wildcard: "*.example.com" allows "example.com", "api.example.com", "a.b.example.com"
51
+ */
52
+ export interface ShishoHTTP {
53
+ /**
54
+ * Fetch a URL. Domain must be declared in manifest httpAccess.domains.
55
+ * Supports wildcard patterns like "*.example.com" for subdomains.
56
+ */
57
+ fetch(url: string, options?: FetchOptions): FetchResponse;
58
+ }
59
+
60
+ /** Parsed URL components from shisho.url.parse(). */
61
+ export interface ParsedURL {
62
+ /** The original URL string. */
63
+ href: string;
64
+ /** URL scheme without ":" (e.g., "https"). */
65
+ protocol: string;
66
+ /** Host including port if present (e.g., "example.com:8080"). */
67
+ host: string;
68
+ /** Hostname without port (e.g., "example.com"). */
69
+ hostname: string;
70
+ /** Port number as string, or empty if not specified. */
71
+ port: string;
72
+ /** Path component (e.g., "/path/to/resource"). */
73
+ pathname: string;
74
+ /** Query string with leading "?" or empty string. */
75
+ search: string;
76
+ /** Fragment with leading "#" or empty string. */
77
+ hash: string;
78
+ /** Username from URL, or empty string. */
79
+ username: string;
80
+ /** Password from URL, or empty string. */
81
+ password: string;
82
+ /** Parsed query parameters. Single values are strings, repeated keys are arrays. */
83
+ query: Record<string, string | string[]>;
84
+ }
85
+
86
+ /**
87
+ * URL utilities that aren't available in Goja's ES5.1 runtime.
88
+ * Provides functionality similar to browser URLSearchParams and URL APIs.
89
+ */
90
+ export interface ShishoURL {
91
+ /**
92
+ * Encode a string for use in URL query parameters.
93
+ * Similar to JavaScript's encodeURIComponent().
94
+ */
95
+ encodeURIComponent(str: string): string;
96
+
97
+ /**
98
+ * Decode a URL-encoded string.
99
+ * Similar to JavaScript's decodeURIComponent().
100
+ */
101
+ decodeURIComponent(str: string): string;
102
+
103
+ /**
104
+ * Convert an object to a URL query string.
105
+ * Keys are sorted alphabetically for deterministic output.
106
+ * Array values create multiple key=value pairs.
107
+ * Null/undefined values are skipped.
108
+ *
109
+ * @example
110
+ * shisho.url.searchParams({ q: "test", page: 1 }) // "page=1&q=test"
111
+ * shisho.url.searchParams({ tags: ["a", "b"] }) // "tags=a&tags=b"
112
+ */
113
+ searchParams(params: Record<string, unknown>): string;
114
+
115
+ /**
116
+ * Parse a URL string into its components.
117
+ *
118
+ * @example
119
+ * const url = shisho.url.parse("https://api.example.com/search?q=test");
120
+ * url.hostname // "api.example.com"
121
+ * url.pathname // "/search"
122
+ * url.query.q // "test"
123
+ */
124
+ parse(url: string): ParsedURL;
125
+ }
126
+
127
+ /** Filesystem operations (sandboxed). */
128
+ export interface ShishoFS {
129
+ /** Read file contents as ArrayBuffer. */
130
+ readFile(path: string): ArrayBuffer;
131
+ /** Read file contents as UTF-8 string. */
132
+ readTextFile(path: string): string;
133
+ /** Write ArrayBuffer data to a file. */
134
+ writeFile(path: string, data: ArrayBuffer): void;
135
+ /** Write string content to a file. */
136
+ writeTextFile(path: string, content: string): void;
137
+ /** Check if a path exists. */
138
+ exists(path: string): boolean;
139
+ /** Create a directory (and parents). */
140
+ mkdir(path: string): void;
141
+ /** List directory entries (file/dir names). */
142
+ listDir(path: string): string[];
143
+ /** Get a temporary directory path (auto-cleaned after hook returns). */
144
+ tempDir(): string;
145
+ }
146
+
147
+ /** ZIP archive operations. */
148
+ export interface ShishoArchive {
149
+ /** Extract all entries from a ZIP archive to a directory. */
150
+ extractZip(archivePath: string, destDir: string): void;
151
+ /** Create a ZIP archive from a directory's contents. */
152
+ createZip(srcDir: string, destPath: string): void;
153
+ /** Read a specific entry from a ZIP archive as ArrayBuffer. */
154
+ readZipEntry(archivePath: string, entryPath: string): ArrayBuffer;
155
+ /** List all entry paths in a ZIP archive. */
156
+ listZipEntries(archivePath: string): string[];
157
+ }
158
+
159
+ /** A parsed XML element. */
160
+ export interface XMLElement {
161
+ /** Element tag name (local part). */
162
+ tag: string;
163
+ /** Element namespace URI. */
164
+ namespace: string;
165
+ /** Direct text content. */
166
+ text: string;
167
+ /** Element attributes. */
168
+ attributes: Record<string, string>;
169
+ /** Child elements. */
170
+ children: XMLElement[];
171
+ }
172
+
173
+ /** XML parsing and querying. */
174
+ export interface ShishoXML {
175
+ /** Parse an XML string into an element tree. */
176
+ parse(content: string): XMLElement;
177
+ /** Find the first element matching a selector. Supports "prefix|tag" namespace syntax. */
178
+ querySelector(
179
+ doc: XMLElement,
180
+ selector: string,
181
+ namespaces?: Record<string, string>,
182
+ ): XMLElement | null;
183
+ /** Find all elements matching a selector. Supports "prefix|tag" namespace syntax. */
184
+ querySelectorAll(
185
+ doc: XMLElement,
186
+ selector: string,
187
+ namespaces?: Record<string, string>,
188
+ ): XMLElement[];
189
+ }
190
+
191
+ /** A parsed HTML element returned by shisho.html queries. */
192
+ export interface HtmlElement {
193
+ /** Element tag name (e.g., "div", "meta", "script"). */
194
+ tag: string;
195
+ /** Element attributes as key-value pairs. */
196
+ attributes: Record<string, string>;
197
+ /** Recursive inner text content (all text nodes concatenated). */
198
+ text: string;
199
+ /** Raw inner HTML string. Useful for script tags (JSON-LD) or rich content. */
200
+ innerHTML: string;
201
+ /** Direct child elements. */
202
+ children: HtmlElement[];
203
+ }
204
+
205
+ /** HTML parsing with CSS selector support. Uses a two-step parse-then-query pattern. */
206
+ export interface ShishoHTML {
207
+ /**
208
+ * Parse an HTML string into an element tree.
209
+ * Returns the root element with stored node references for efficient querying.
210
+ *
211
+ * @example
212
+ * var doc = shisho.html.parse(htmlString);
213
+ * var title = shisho.html.querySelector(doc, "title");
214
+ */
215
+ parse(html: string): HtmlElement;
216
+
217
+ /**
218
+ * Find the first element matching a CSS selector.
219
+ * Supports full CSS selector syntax (attribute selectors, combinators, pseudo-classes).
220
+ * The doc argument must be a parsed element from shisho.html.parse() or a previous query result.
221
+ *
222
+ * @example
223
+ * var doc = shisho.html.parse(html);
224
+ * var meta = shisho.html.querySelector(doc, 'meta[name="description"]');
225
+ * var description = meta ? meta.attributes.content : "";
226
+ */
227
+ querySelector(doc: HtmlElement, selector: string): HtmlElement | null;
228
+
229
+ /**
230
+ * Find all elements matching a CSS selector.
231
+ * The doc argument must be a parsed element from shisho.html.parse() or a previous query result.
232
+ *
233
+ * @example
234
+ * var doc = shisho.html.parse(html);
235
+ * var scripts = shisho.html.querySelectorAll(doc, 'script[type="application/ld+json"]');
236
+ * var jsonLd = JSON.parse(scripts[0].text);
237
+ */
238
+ querySelectorAll(doc: HtmlElement, selector: string): HtmlElement[];
239
+ }
240
+
241
+ /** Result from shisho.ffmpeg.transcode(). */
242
+ export interface TranscodeResult {
243
+ /** Process exit code (0 = success). */
244
+ exitCode: number;
245
+ /** Standard output. */
246
+ stdout: string;
247
+ /** Standard error. */
248
+ stderr: string;
249
+ }
250
+
251
+ /** Result from shisho.ffmpeg.probe(). */
252
+ export interface ProbeResult {
253
+ format: ProbeFormat;
254
+ streams: ProbeStream[];
255
+ chapters: ProbeChapter[];
256
+ /** Standard error output (for debugging). */
257
+ stderr: string;
258
+ /** JSON parse error message if ffprobe output could not be parsed. Empty string if parsing succeeded. */
259
+ parseError: string;
260
+ }
261
+
262
+ /** Format information from ffprobe. */
263
+ export interface ProbeFormat {
264
+ filename: string;
265
+ nb_streams: number;
266
+ nb_programs: number;
267
+ format_name: string;
268
+ format_long_name: string;
269
+ start_time: string;
270
+ duration: string;
271
+ size: string;
272
+ bit_rate: string;
273
+ probe_score: number;
274
+ tags?: Record<string, string>;
275
+ }
276
+
277
+ /** Stream information from ffprobe. */
278
+ export interface ProbeStream {
279
+ index: number;
280
+ codec_name?: string;
281
+ codec_long_name?: string;
282
+ codec_type: "video" | "audio" | "subtitle" | "data" | "attachment";
283
+ codec_tag_string?: string;
284
+ codec_tag?: string;
285
+
286
+ // Video-specific
287
+ width?: number;
288
+ height?: number;
289
+ coded_width?: number;
290
+ coded_height?: number;
291
+ closed_captions?: number;
292
+ has_b_frames?: number;
293
+ sample_aspect_ratio?: string;
294
+ display_aspect_ratio?: string;
295
+ pix_fmt?: string;
296
+ level?: number;
297
+ color_range?: string;
298
+ color_space?: string;
299
+ color_transfer?: string;
300
+ color_primaries?: string;
301
+ chroma_location?: string;
302
+ field_order?: string;
303
+ refs?: number;
304
+
305
+ // Audio-specific
306
+ sample_fmt?: string;
307
+ sample_rate?: string;
308
+ channels?: number;
309
+ channel_layout?: string;
310
+ bits_per_sample?: number;
311
+
312
+ // Common (optional since not all stream types have these)
313
+ r_frame_rate?: string;
314
+ avg_frame_rate?: string;
315
+ time_base?: string;
316
+ start_pts?: number;
317
+ start_time?: string;
318
+ duration_ts?: number;
319
+ duration?: string;
320
+ bit_rate?: string;
321
+ bits_per_raw_sample?: string;
322
+ nb_frames?: string;
323
+ disposition?: ProbeDisposition;
324
+ tags?: Record<string, string>;
325
+ }
326
+
327
+ /** Stream disposition flags from ffprobe. */
328
+ export interface ProbeDisposition {
329
+ default: number;
330
+ dub: number;
331
+ original: number;
332
+ comment: number;
333
+ lyrics: number;
334
+ karaoke: number;
335
+ forced: number;
336
+ hearing_impaired: number;
337
+ visual_impaired: number;
338
+ clean_effects: number;
339
+ attached_pic: number;
340
+ timed_thumbnails: number;
341
+ }
342
+
343
+ /** Chapter information from ffprobe. */
344
+ export interface ProbeChapter {
345
+ id: number;
346
+ time_base: string;
347
+ start: number;
348
+ start_time: string;
349
+ end: number;
350
+ end_time: string;
351
+ tags?: Record<string, string>;
352
+ }
353
+
354
+ /** Result from shisho.ffmpeg.version(). */
355
+ export interface VersionResult {
356
+ /** FFmpeg version string (e.g., "7.0"). */
357
+ version: string;
358
+ /** Build configuration flags (e.g., ["--enable-libx264", "--enable-gpl"]). */
359
+ configuration: string[];
360
+ /** Library versions (e.g., { libavcodec: "60.31.102", ... }). */
361
+ libraries: Record<string, string>;
362
+ }
363
+
364
+ /** FFmpeg subprocess execution. */
365
+ export interface ShishoFFmpeg {
366
+ /** Transcode files with FFmpeg. Requires ffmpegAccess capability. */
367
+ transcode(args: string[]): TranscodeResult;
368
+ /** Probe file metadata with ffprobe. Returns parsed JSON. Requires ffmpegAccess capability. */
369
+ probe(args: string[]): ProbeResult;
370
+ /** Get FFmpeg version and configuration. Requires ffmpegAccess capability. */
371
+ version(): VersionResult;
372
+ }
373
+
374
+ /** Result from shisho.shell.exec(). */
375
+ export interface ExecResult {
376
+ /** Process exit code (0 = success). */
377
+ exitCode: number;
378
+ /** Standard output. */
379
+ stdout: string;
380
+ /** Standard error. */
381
+ stderr: string;
382
+ }
383
+
384
+ /** Shell command execution (with allowlist). */
385
+ export interface ShishoShell {
386
+ /**
387
+ * Execute an allowed command with arguments.
388
+ * Command must be declared in manifest shellAccess.commands.
389
+ * Uses exec directly (no shell) to prevent injection.
390
+ */
391
+ exec(command: string, args: string[]): ExecResult;
392
+ }
393
+
394
+ /** Top-level host API object available as the global `shisho` variable. */
395
+ export interface ShishoHostAPI {
396
+ /** Persistent data directory for this plugin. Created lazily on first access. */
397
+ readonly dataDir: string;
398
+ log: ShishoLog;
399
+ config: ShishoConfig;
400
+ http: ShishoHTTP;
401
+ url: ShishoURL;
402
+ fs: ShishoFS;
403
+ archive: ShishoArchive;
404
+ xml: ShishoXML;
405
+ html: ShishoHTML;
406
+ ffmpeg: ShishoFFmpeg;
407
+ shell: ShishoShell;
408
+ }
package/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import "./global";
2
+
3
+ export * from "./metadata";
4
+ export * from "./manifest";
5
+ export * from "./host-api";
6
+ export * from "./hooks";