@shisho/plugin-sdk 0.0.52 → 0.1.1
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/host-api.d.ts +16 -2
- package/metadata.d.ts +4 -1
- package/package.json +1 -1
package/host-api.d.ts
CHANGED
|
@@ -130,9 +130,23 @@ export interface ShishoFS {
|
|
|
130
130
|
readFile(path: string): ArrayBuffer;
|
|
131
131
|
/** Read file contents as UTF-8 string. */
|
|
132
132
|
readTextFile(path: string): string;
|
|
133
|
-
/**
|
|
133
|
+
/**
|
|
134
|
+
* Write ArrayBuffer data to a file.
|
|
135
|
+
*
|
|
136
|
+
* A new file is created with mode 0600 inside the plugin's own directory,
|
|
137
|
+
* `shisho.dataDir`, or `tempDir()`, and 0644 at any other permitted path
|
|
138
|
+
* (hook-provided paths and paths allowed by `fileAccess: "readwrite"`).
|
|
139
|
+
* The umask still applies. Overwriting an existing file keeps its mode.
|
|
140
|
+
*/
|
|
134
141
|
writeFile(path: string, data: ArrayBuffer): void;
|
|
135
|
-
/**
|
|
142
|
+
/**
|
|
143
|
+
* Write string content to a file as UTF-8.
|
|
144
|
+
*
|
|
145
|
+
* New files get the same mode as `writeFile`: 0600 inside the plugin's own
|
|
146
|
+
* directory, `shisho.dataDir`, or `tempDir()`, and 0644 at any other
|
|
147
|
+
* permitted path. The umask still applies. Overwriting an existing file
|
|
148
|
+
* keeps its mode.
|
|
149
|
+
*/
|
|
136
150
|
writeTextFile(path: string, content: string): void;
|
|
137
151
|
/** Check if a path exists. */
|
|
138
152
|
exists(path: string): boolean;
|
package/metadata.d.ts
CHANGED
|
@@ -18,7 +18,10 @@ export interface ParsedIdentifier {
|
|
|
18
18
|
export interface ParsedChapter {
|
|
19
19
|
/** Chapter title. */
|
|
20
20
|
title: string;
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* CBZ and PDF: 0-indexed page number. A chapter with a negative value is
|
|
23
|
+
* dropped, along with its children, when Shisho stores chapters on scan.
|
|
24
|
+
*/
|
|
22
25
|
startPage?: number;
|
|
23
26
|
/** M4B: milliseconds from start. */
|
|
24
27
|
startTimestampMs?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shisho/plugin-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "TypeScript SDK for Shisho plugin development — types, host API declarations, and test utilities",
|
|
5
5
|
"homepage": "https://github.com/shishobooks/shisho/blob/master/packages/plugin-sdk/README.md",
|
|
6
6
|
"types": "index.d.ts",
|