-
Notifications
You must be signed in to change notification settings - Fork 366
Expand file tree
/
Copy pathtypes.ts
More file actions
59 lines (53 loc) · 1.56 KB
/
Copy pathtypes.ts
File metadata and controls
59 lines (53 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { IndexCollection } from "./indexing/IndexCollection.ts";
export type DocType = "markdown" | "api-reference";
export interface OramaDocument {
id: string;
title: string;
content: string;
url: string;
/** Root-relative path (e.g. /runtime/reference/cli/serve) */
path?: string;
category: string;
section: string;
subsection?: string;
description?: string;
tags: string[];
headings: string[];
lastModified: number;
/** Document type - markdown or api reference */
docType?: DocType;
/** Optional kind/category of doc: e.g. "cli", "guide", "api" */
kind?: string;
/** CLI command name if applicable, e.g. "serve" */
command?: string;
apiInfo?: {
symbolType: string; // "function", "interface", "class", etc.
symbolPath: string; // "Deno.readFile", "web.fetch", etc.
packageName: string; // "Deno", "Web", "Node"
};
}
export interface IIndexDocuments {
isValidIndexer(file: InputFileReference): boolean;
tryIndex(file: InputFileReference): Promise<OramaDocument | null>;
}
export interface InputFileReference {
path: string;
fullPath: string;
docType: DocType;
}
export interface IOutputFormat {
write(index: IndexCollection): Promise<void>;
}
export interface IndexStats {
totalDocuments: number;
totalCharacters: number;
averageDocumentLength: number;
categoryCounts: Record<string, number>;
sectionCounts: Record<string, number>;
documentsWithTags: number;
documentsWithDescriptions: number;
longestDocument: string;
shortestDocument: string;
apiDocuments: number;
markdownDocuments: number;
}