@conundrum/ts 0.0.4 → 0.0.5

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.
@@ -0,0 +1,46 @@
1
+ import { ConundrumDatabase } from './conundrum_database';
2
+ export interface ConundrumSearchOptions {
3
+ /** What the reader typed. Every word must match the start of a word in the note. */
4
+ query: string;
5
+ subject?: string | null;
6
+ topic?: string | null;
7
+ tag?: string | null;
8
+ /** Default: 10. */
9
+ limit?: number;
10
+ /** Default: 0. */
11
+ offset?: number;
12
+ /**
13
+ * Only notes the blog lists (with a `title` and `summary`, not hidden by the `blog`
14
+ * settings). Default: `true`.
15
+ */
16
+ listedOnly?: boolean;
17
+ /** A note's URL. Default: `/blog/by_path/<relative path without extension>`. */
18
+ postUrl?: (relativePath: string) => string;
19
+ }
20
+ export interface ConundrumSearchResult {
21
+ relativePath: string;
22
+ url: string;
23
+ title: string | null;
24
+ summary: string | null;
25
+ subject: string | null;
26
+ topic: string | null;
27
+ tags: string[];
28
+ /** A short passage around the match, as plain text. */
29
+ snippet: string;
30
+ /** The same passage as HTML, with the matched words in `<mark>`. Safe to render. */
31
+ snippetHtml: string;
32
+ }
33
+ export interface ConundrumSearchResponse {
34
+ query: string;
35
+ /** Matches in all, for paging. */
36
+ total: number;
37
+ results: ConundrumSearchResult[];
38
+ }
39
+ /**
40
+ * Turns what the reader typed into an FTS5 query that can't fail to parse: every word quoted and
41
+ * matched as a prefix, so "relativ" finds "relativity" and results update while typing.
42
+ */
43
+ export declare const toFtsQuery: (query: string) => string;
44
+ /** Searches the notes in a database written by `cdrm`, best matches first. */
45
+ export declare const searchConundrum: (db: ConundrumDatabase, options: ConundrumSearchOptions) => ConundrumSearchResponse;
46
+ //# sourceMappingURL=search_conundrum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search_conundrum.d.ts","sourceRoot":"","sources":["../../../src/server/search_conundrum.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,iBA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
2
  "name": "@conundrum/ts",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Conundrum for the web: rendering, React components and the generated types.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/flusterIO/conundrum",
@@ -59,6 +59,11 @@
59
59
  "import": "./dist/uiBlogSSR.mjs",
60
60
  "require": "./dist/uiBlogSSR.cjs"
61
61
  },
62
+ "./server": {
63
+ "types": "./dist/server.d.ts",
64
+ "import": "./dist/server.mjs",
65
+ "require": "./dist/server.cjs"
66
+ },
62
67
  "./pathUtils": {
63
68
  "types": "./dist/pathUtils.d.ts",
64
69
  "import": "./dist/pathUtils.mjs",
@@ -102,7 +107,7 @@
102
107
  "reveal.js": "6.0.1",
103
108
  "wasm-feature-detect": "1.8.0",
104
109
  "zod": "3.24.4",
105
- "@conundrum/wasm": "^0.0.4"
110
+ "@conundrum/wasm": "^0.0.5"
106
111
  },
107
112
  "devDependencies": {
108
113
  "@tailwindcss/vite": "4.2.1",
@@ -113,12 +118,15 @@
113
118
  "vite-plugin-dts": "4.5.4",
114
119
  "vite-tsconfig-paths": "5.1.4",
115
120
  "vitest": "4.0.18",
116
- "@conundrum/main": "0.0.4"
121
+ "@conundrum/main": "0.0.5"
117
122
  },
118
123
  "peerDependencies": {
119
124
  "react": "19.2.0",
120
125
  "react-dom": "19.2.0"
121
126
  },
127
+ "engines": {
128
+ "node": ">=22.13"
129
+ },
122
130
  "scripts": {
123
131
  "build": "vite build && pnpm copy:globalCSS && pnpm postcodegen",
124
132
  "build:ipad": "vite build && pnpm copy:globalCSS && pnpm postcodegen",