@yinsen/deveco-cli-docs-zh 1.3.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/dist/engine/constants-Bi5VwlSi.d.ts +4 -0
- package/dist/engine/index.d.ts +50 -0
- package/dist/engine/index.js +2575 -0
- package/docs.zip +0 -0
- package/index.js +7 -0
- package/index.zip +0 -0
- package/package.json +35 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export { Q as QUERY_MAX_RAW_CHARS } from './constants-Bi5VwlSi.js';
|
|
2
|
+
|
|
3
|
+
declare const apiVersion: 1;
|
|
4
|
+
interface CreateDocsEngineOptions {
|
|
5
|
+
cacheDir: string;
|
|
6
|
+
}
|
|
7
|
+
interface DocsSearchRequest {
|
|
8
|
+
keywords: string[];
|
|
9
|
+
catalog?: string;
|
|
10
|
+
limit?: number;
|
|
11
|
+
}
|
|
12
|
+
interface DocsSearchResult {
|
|
13
|
+
title: string;
|
|
14
|
+
documentId: string;
|
|
15
|
+
snippet: string;
|
|
16
|
+
sectionTitle?: string;
|
|
17
|
+
}
|
|
18
|
+
interface DocsCatalogNode {
|
|
19
|
+
nodeId: string;
|
|
20
|
+
nodeName: string;
|
|
21
|
+
relateDocument: string;
|
|
22
|
+
isLeaf: boolean;
|
|
23
|
+
parent: string;
|
|
24
|
+
children: DocsCatalogNode[];
|
|
25
|
+
catalogIndex: number;
|
|
26
|
+
}
|
|
27
|
+
interface DocsEngine {
|
|
28
|
+
search(request: DocsSearchRequest): Promise<DocsSearchResult[]>;
|
|
29
|
+
read(request: {
|
|
30
|
+
relativePath: string;
|
|
31
|
+
}): Promise<string>;
|
|
32
|
+
catalog(): Promise<DocsCatalogNode[]>;
|
|
33
|
+
close(): Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
declare function createDocsEngine(options: CreateDocsEngineOptions): Promise<DocsEngine>;
|
|
36
|
+
|
|
37
|
+
declare const CATALOG_NAMES: readonly ["harmonyos-guides", "harmonyos-references", "best-practices", "harmonyos-faqs", "harmonyos-releases", "harmonyos-roadmap"];
|
|
38
|
+
type CatalogName = (typeof CATALOG_NAMES)[number];
|
|
39
|
+
declare const CATALOG_TITLES: Record<CatalogName, string>;
|
|
40
|
+
|
|
41
|
+
type DocStorageAssertMode = 'read' | 'write';
|
|
42
|
+
interface AssertDocStorageOptions {
|
|
43
|
+
/** `read` skips `.tmp`; `write` is full (default). */
|
|
44
|
+
mode?: DocStorageAssertMode;
|
|
45
|
+
}
|
|
46
|
+
declare function isDocStorageError(error: unknown): error is Error;
|
|
47
|
+
/** Ensures documentation paths under DATA_DIR stay inside the resolved data root. */
|
|
48
|
+
declare function assertDocStorageSafe(options?: AssertDocStorageOptions): Promise<void>;
|
|
49
|
+
|
|
50
|
+
export { CATALOG_NAMES, CATALOG_TITLES, type CatalogName, type CreateDocsEngineOptions, type DocsCatalogNode, type DocsEngine, type DocsSearchRequest, type DocsSearchResult, apiVersion, assertDocStorageSafe, createDocsEngine, isDocStorageError };
|