@ghostpaw/questlog 0.1.0 → 0.3.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/index.d.cts CHANGED
@@ -1,9 +1,21 @@
1
- import { DatabaseSync } from 'node:sqlite';
2
-
1
+ interface QuestlogRunResult {
2
+ lastInsertRowid: number | bigint;
3
+ changes?: number | bigint | undefined;
4
+ }
5
+ interface QuestlogStatement {
6
+ run(...params: unknown[]): QuestlogRunResult;
7
+ get<TRecord = Record<string, unknown>>(...params: unknown[]): TRecord | undefined;
8
+ all<TRecord = Record<string, unknown>>(...params: unknown[]): TRecord[];
9
+ }
3
10
  /**
4
11
  * SQLite dependency injected into every questlog operation.
12
+ * Node.js `DatabaseSync` satisfies this interface directly.
5
13
  */
6
- type QuestlogDb = DatabaseSync;
14
+ type QuestlogDb = {
15
+ exec(sql: string): void;
16
+ prepare(sql: string): QuestlogStatement;
17
+ close(): void;
18
+ };
7
19
 
8
20
  /**
9
21
  * Creates the full standalone questlog schema, including FTS and indexing.
package/dist/index.d.ts CHANGED
@@ -1,9 +1,21 @@
1
- import { DatabaseSync } from 'node:sqlite';
2
-
1
+ interface QuestlogRunResult {
2
+ lastInsertRowid: number | bigint;
3
+ changes?: number | bigint | undefined;
4
+ }
5
+ interface QuestlogStatement {
6
+ run(...params: unknown[]): QuestlogRunResult;
7
+ get<TRecord = Record<string, unknown>>(...params: unknown[]): TRecord | undefined;
8
+ all<TRecord = Record<string, unknown>>(...params: unknown[]): TRecord[];
9
+ }
3
10
  /**
4
11
  * SQLite dependency injected into every questlog operation.
12
+ * Node.js `DatabaseSync` satisfies this interface directly.
5
13
  */
6
- type QuestlogDb = DatabaseSync;
14
+ type QuestlogDb = {
15
+ exec(sql: string): void;
16
+ prepare(sql: string): QuestlogStatement;
17
+ close(): void;
18
+ };
7
19
 
8
20
  /**
9
21
  * Creates the full standalone questlog schema, including FTS and indexing.