@talonic/docs 0.17.1 → 0.19.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.
@@ -0,0 +1,134 @@
1
+ /** HTTP method for API endpoint blocks. */
2
+ type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
3
+ /** A single parameter row in a param-table block. */
4
+ interface Param {
5
+ name: string;
6
+ type: string;
7
+ required?: boolean;
8
+ description: string;
9
+ default?: string;
10
+ }
11
+ /**
12
+ * A single content block. The union discriminates on `type`.
13
+ *
14
+ * Text fields use lightweight inline markup:
15
+ * - `**bold**` for strong emphasis
16
+ * - `` `code` `` for inline code
17
+ * - `[text](url)` for links
18
+ * - HTML entities like `→` are passed through
19
+ */
20
+ type DocBlock = {
21
+ type: 'heading';
22
+ level: 2 | 3;
23
+ id: string;
24
+ text: string;
25
+ } | {
26
+ type: 'paragraph';
27
+ text: string;
28
+ } | {
29
+ type: 'code';
30
+ language?: string;
31
+ title?: string;
32
+ code: string;
33
+ } | {
34
+ type: 'callout';
35
+ variant?: 'info' | 'warning';
36
+ text: string;
37
+ } | {
38
+ type: 'param-table';
39
+ title?: string;
40
+ params: Param[];
41
+ } | {
42
+ type: 'endpoint';
43
+ method: HttpMethod;
44
+ path: string;
45
+ summary: string;
46
+ description?: string;
47
+ blocks: DocBlock[];
48
+ } | {
49
+ type: 'list';
50
+ ordered?: boolean;
51
+ items: string[];
52
+ } | {
53
+ type: 'ui-excerpt';
54
+ title: string;
55
+ caption?: string;
56
+ id: string;
57
+ };
58
+ /**
59
+ * A fully-resolved documentation section ready for SEO page rendering.
60
+ * Every leaf-level section ID from the nav structure maps to one DocSection.
61
+ */
62
+ interface DocSection {
63
+ /** Leaf section ID / URL slug, e.g. "introduction" or "post-extract". */
64
+ slug: string;
65
+ /** Parent group ID, e.g. "overview" or "extract". */
66
+ parentSlug: string;
67
+ /** Display title (from nav label). */
68
+ title: string;
69
+ /** SEO page title, 50-60 chars, includes "Talonic". */
70
+ seoTitle: string;
71
+ /** Meta description, 150-160 chars, unique per page. */
72
+ description: string;
73
+ /** Breadcrumb chain from root to this section. */
74
+ breadcrumbs: {
75
+ label: string;
76
+ slug: string;
77
+ }[];
78
+ /** The content body as an ordered list of blocks. */
79
+ content: DocBlock[];
80
+ /** Related sections for cross-linking. */
81
+ related: {
82
+ label: string;
83
+ slug: string;
84
+ }[];
85
+ /** FAQ entries for FAQPage JSON-LD. */
86
+ faq: {
87
+ question: string;
88
+ answer: string;
89
+ }[];
90
+ /** Technical terms for JSON-LD TechArticle mentions. */
91
+ mentions: string[];
92
+ /** Previous section in reading order, or null. */
93
+ prev: {
94
+ slug: string;
95
+ label: string;
96
+ } | null;
97
+ /** Next section in reading order, or null. */
98
+ next: {
99
+ slug: string;
100
+ label: string;
101
+ } | null;
102
+ }
103
+ /**
104
+ * Raw section data before prev/next and breadcrumbs are derived.
105
+ * Content files export arrays of these; the index module enriches them.
106
+ */
107
+ interface RawSection {
108
+ slug: string;
109
+ parentSlug: string;
110
+ title: string;
111
+ seoTitle: string;
112
+ description: string;
113
+ content: DocBlock[];
114
+ related: {
115
+ label: string;
116
+ slug: string;
117
+ }[];
118
+ faq: {
119
+ question: string;
120
+ answer: string;
121
+ }[];
122
+ mentions: string[];
123
+ }
124
+
125
+ /** Get a single platform section by slug, or null if not found. */
126
+ declare function getPlatformSection(slug: string): DocSection | null;
127
+ /** Get all platform sections in reading order. */
128
+ declare function getAllPlatformSections(): DocSection[];
129
+ /** Get a single API section by slug, or null if not found. */
130
+ declare function getApiSection(slug: string): DocSection | null;
131
+ /** Get all API sections in reading order. */
132
+ declare function getAllApiSections(): DocSection[];
133
+
134
+ export { type DocBlock, type DocSection, type HttpMethod, type Param, type RawSection, getAllApiSections, getAllPlatformSections, getApiSection, getPlatformSection };