@geenius/docs 0.4.1 → 0.8.10

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,270 @@
1
+ /**
2
+ * @module docsTypes
3
+ * @package @geenius/docs-shared
4
+ * @description Declares the shared docs domain model used by the framework
5
+ * variants, Convex integration, and provider adapters. These types form the
6
+ * public contract exported from `@geenius/docs`.
7
+ */
8
+ /**
9
+ * Access levels supported by docs content.
10
+ */
11
+ type DocAccess = 'public' | 'team' | 'admin';
12
+ /**
13
+ * Publishing states supported by docs pages.
14
+ */
15
+ type DocStatus = 'draft' | 'published' | 'archived';
16
+ /**
17
+ * Author metadata attached to a docs page.
18
+ *
19
+ * @property name - Human-readable author display name.
20
+ * @property avatar - Optional avatar URL for UI surfaces that show authorship.
21
+ */
22
+ interface DocAuthor {
23
+ name: string;
24
+ avatar?: string;
25
+ }
26
+ /**
27
+ * Last-editor metadata attached to a docs page revision.
28
+ *
29
+ * @property name - Human-readable editor display name.
30
+ * @property editedAt - ISO timestamp describing the edit event.
31
+ */
32
+ interface DocRevision {
33
+ name: string;
34
+ editedAt: string;
35
+ }
36
+ /**
37
+ * Minimal navigation link used for previous and next page affordances.
38
+ *
39
+ * @property title - Label shown in the navigation UI.
40
+ * @property slug - Page slug used to resolve the target.
41
+ */
42
+ interface DocNavigationLink {
43
+ title: string;
44
+ slug: string;
45
+ }
46
+ /**
47
+ * Core page record shared across all docs variants.
48
+ *
49
+ * @property id - Stable page identifier.
50
+ * @property title - Human-readable page title.
51
+ * @property slug - Route slug relative to the docs base path.
52
+ * @property content - Markdown or MDX body content.
53
+ * @property excerpt - Optional preview excerpt used by search and listings.
54
+ * @property sectionId - Stable section identifier used for grouping.
55
+ * @property order - Sort order inside the containing section.
56
+ * @property author - Primary author metadata for the page.
57
+ * @property lastEditedBy - Optional revision metadata for the last editor.
58
+ * @property version - Optional semantic version label for versioned docs.
59
+ * @property access - Access control level for the page.
60
+ * @property tags - Searchable tags attached to the page.
61
+ * @property status - Publishing status for the page.
62
+ * @property createdAt - ISO timestamp describing when the page was created.
63
+ * @property updatedAt - ISO timestamp describing the most recent update.
64
+ * @property wordCount - Approximate rendered word count.
65
+ * @property readingTime - Reading time in minutes.
66
+ * @property viewCount - Recorded page view count.
67
+ */
68
+ interface DocPage {
69
+ id: string;
70
+ title: string;
71
+ slug: string;
72
+ content: string;
73
+ excerpt?: string;
74
+ sectionId: string;
75
+ order: number;
76
+ author: DocAuthor;
77
+ lastEditedBy?: DocRevision;
78
+ version?: string;
79
+ access: DocAccess;
80
+ tags: string[];
81
+ status: DocStatus;
82
+ createdAt: string;
83
+ updatedAt: string;
84
+ wordCount: number;
85
+ readingTime: number;
86
+ viewCount: number;
87
+ }
88
+ /**
89
+ * Section record used by listings, navigation trees, and admin tooling.
90
+ *
91
+ * @property id - Stable section identifier.
92
+ * @property title - Human-readable section title.
93
+ * @property slug - Route slug for the section landing page.
94
+ * @property parentId - Optional parent section identifier for nested trees.
95
+ * @property order - Sort order among sibling sections.
96
+ * @property icon - Optional decorative icon token or emoji.
97
+ * @property description - Optional descriptive copy used in dashboards and cards.
98
+ * @property access - Access control level inherited by the section.
99
+ * @property pageCount - Optional precomputed number of pages in the section.
100
+ */
101
+ interface DocSection {
102
+ id: string;
103
+ title: string;
104
+ slug: string;
105
+ parentId?: string;
106
+ order: number;
107
+ icon?: string;
108
+ description?: string;
109
+ access: DocAccess;
110
+ pageCount?: number;
111
+ }
112
+ /**
113
+ * Search result returned by the shared search helpers.
114
+ *
115
+ * @property pageId - Stable page identifier.
116
+ * @property pageTitle - Human-readable page title.
117
+ * @property sectionTitle - Human-readable section title.
118
+ * @property sectionSlug - Route slug for the containing section.
119
+ * @property slug - Route slug for the page.
120
+ * @property highlight - Excerpt or match snippet shown in results.
121
+ * @property score - Rank score used to sort results.
122
+ * @property tags - Searchable tags attached to the matching page.
123
+ */
124
+ interface SearchResult {
125
+ pageId: string;
126
+ pageTitle: string;
127
+ sectionTitle: string;
128
+ sectionSlug: string;
129
+ slug: string;
130
+ highlight: string;
131
+ score: number;
132
+ tags: string[];
133
+ }
134
+ /**
135
+ * Table-of-contents node extracted from a page body.
136
+ *
137
+ * @property id - Heading anchor identifier.
138
+ * @property text - Visible heading label.
139
+ * @property level - Heading depth supported by the docs renderer.
140
+ * @property children - Nested headings beneath this item.
141
+ */
142
+ interface TocItem {
143
+ id: string;
144
+ text: string;
145
+ level: 2 | 3 | 4;
146
+ children: TocItem[];
147
+ }
148
+ /**
149
+ * Breadcrumb node used by page-level navigation chrome.
150
+ *
151
+ * @property title - Visible breadcrumb label.
152
+ * @property href - Target route for the breadcrumb item.
153
+ */
154
+ interface BreadcrumbItem {
155
+ title: string;
156
+ href: string;
157
+ }
158
+ /**
159
+ * Shared configuration options consumed by the docs variants.
160
+ *
161
+ * @property siteName - Optional site label for layouts and metadata.
162
+ * @property baseUrl - Optional docs base path.
163
+ * @property defaultAccess - Default access level for new content.
164
+ * @property versionsEnabled - Enables version selection UI when true.
165
+ * @property cmdKEnabled - Enables keyboard search affordances when true.
166
+ * @property editPageUrl - Optional base URL used by "Edit this page" actions.
167
+ * @property showReadingTime - Controls reading-time metadata visibility.
168
+ * @property showLastEdited - Controls last-edited metadata visibility.
169
+ * @property showViewCount - Controls view-count metadata visibility.
170
+ * @property printModeEnabled - Enables print-focused layout affordances.
171
+ */
172
+ interface DocsConfig {
173
+ siteName?: string;
174
+ baseUrl?: string;
175
+ defaultAccess?: DocAccess;
176
+ versionsEnabled?: boolean;
177
+ cmdKEnabled?: boolean;
178
+ editPageUrl?: string;
179
+ showReadingTime?: boolean;
180
+ showLastEdited?: boolean;
181
+ showViewCount?: boolean;
182
+ printModeEnabled?: boolean;
183
+ }
184
+ /**
185
+ * Provider-backed page record with derived navigation and heading data.
186
+ */
187
+ interface DocsPage extends DocPage {
188
+ prev?: DocNavigationLink | null;
189
+ next?: DocNavigationLink | null;
190
+ toc?: TocItem[];
191
+ breadcrumbs?: BreadcrumbItem[];
192
+ }
193
+ /**
194
+ * Page summary entry displayed inside a sidebar section.
195
+ *
196
+ * @property slug - Route slug used by the nav item.
197
+ * @property title - Human-readable nav label.
198
+ */
199
+ interface DocsSidebarPage {
200
+ slug: string;
201
+ title: string;
202
+ }
203
+ /**
204
+ * Section node displayed by docs navigation components.
205
+ *
206
+ * @property id - Stable section identifier.
207
+ * @property title - Human-readable section label.
208
+ * @property slug - Route slug for the section.
209
+ * @property icon - Optional decorative icon token or emoji.
210
+ * @property pages - Flattened page entries belonging to the section.
211
+ * @property children - Optional nested section tree beneath this item.
212
+ */
213
+ interface DocsSidebarItem {
214
+ id: string;
215
+ title: string;
216
+ slug: string;
217
+ icon?: string;
218
+ pages: DocsSidebarPage[];
219
+ children?: DocsSidebarItem[];
220
+ }
221
+ /**
222
+ * Full sidebar structure returned by docs providers.
223
+ */
224
+ type DocsSidebar = DocsSidebarItem[];
225
+ /**
226
+ * Search result returned by provider-backed docs integrations.
227
+ *
228
+ * @property pageId - Stable page identifier.
229
+ * @property pageTitle - Human-readable page title.
230
+ * @property sectionTitle - Human-readable containing section label.
231
+ * @property slug - Page route slug.
232
+ * @property highlight - Preview snippet used in search results.
233
+ * @property score - Rank score used to sort results.
234
+ */
235
+ interface DocsSearchResult {
236
+ pageId: string;
237
+ pageTitle: string;
238
+ sectionTitle: string;
239
+ slug: string;
240
+ highlight: string;
241
+ score: number;
242
+ }
243
+ /**
244
+ * Provider contract implemented by pluggable docs backends such as internal
245
+ * arrays, Astro content directories, and Fumadocs sources.
246
+ */
247
+ interface DocsProvider {
248
+ /**
249
+ * Load the sidebar navigation structure for the docs source.
250
+ *
251
+ * @returns The full sidebar tree for the provider.
252
+ */
253
+ getSidebar(): Promise<DocsSidebar>;
254
+ /**
255
+ * Resolve a single docs page by slug.
256
+ *
257
+ * @param slug - Route slug for the requested page.
258
+ * @returns The resolved page record or `null` when not found.
259
+ */
260
+ getPage(slug: string): Promise<DocsPage | null>;
261
+ /**
262
+ * Search the provider-backed content source.
263
+ *
264
+ * @param query - User-entered search query.
265
+ * @returns Ranked provider search results for the query.
266
+ */
267
+ search(query: string): Promise<DocsSearchResult[]>;
268
+ }
269
+
270
+ export type { BreadcrumbItem as B, DocsConfig as D, SearchResult as S, TocItem as T, DocSection as a, DocPage as b, DocAccess as c, DocAuthor as d, DocNavigationLink as e, DocRevision as f, DocStatus as g, DocsPage as h, DocsProvider as i, DocsSearchResult as j, DocsSidebar as k, DocsSidebarItem as l, DocsSidebarPage as m };
@@ -1,6 +1,6 @@
1
1
  import { BreadcrumbItem, DocPage as DocPage$1, SearchResult, DocSection, TocItem, DocsConfig } from '@geenius/docs-shared';
2
2
  export { BreadcrumbItem, DocAccess, DocPage as DocPageType, DocSection, DocStatus, DocsConfig, SearchResult, TocItem } from '@geenius/docs-shared';
3
- import { JSX, Accessor, Setter } from 'solid-js';
3
+ import { JSX, Accessor } from 'solid-js';
4
4
 
5
5
  /**
6
6
  * @module solidjsBreadcrumbs
@@ -9,15 +9,16 @@ import { JSX, Accessor, Setter } from 'solid-js';
9
9
  * metadata and the Tailwind-styled docs presentation contract.
10
10
  */
11
11
 
12
+ interface BreadcrumbsProps {
13
+ items: BreadcrumbItem[];
14
+ }
12
15
  /**
13
16
  * Renders the current docs breadcrumb hierarchy.
14
17
  *
15
18
  * @param props - Breadcrumb items describing the active page ancestry.
16
19
  * @returns Breadcrumb navigation for the current page when items exist.
17
20
  */
18
- declare function Breadcrumbs(props: {
19
- items: BreadcrumbItem[];
20
- }): JSX.Element;
21
+ declare function Breadcrumbs(props: BreadcrumbsProps): JSX.Element | null;
21
22
 
22
23
  /**
23
24
  * @module solidDocPage
@@ -48,7 +49,7 @@ declare function DocPage(props: DocPageProps): JSX.Element;
48
49
  interface DocSearchProps {
49
50
  results: SearchResult[];
50
51
  query: string;
51
- onQuery: (q: string) => void;
52
+ onQuery: (query: string) => void;
52
53
  onSelect: (result: SearchResult) => void;
53
54
  isOpen: boolean;
54
55
  onClose: () => void;
@@ -59,7 +60,7 @@ interface DocSearchProps {
59
60
  * @param props - Search state, callbacks, and result entries to present.
60
61
  * @returns An animated search overlay for navigating docs content.
61
62
  */
62
- declare function DocSearch(props: DocSearchProps): JSX.Element;
63
+ declare function DocSearch(props: DocSearchProps): JSX.Element | null;
63
64
 
64
65
  /**
65
66
  * @module solidjsDocSidebar
@@ -118,16 +119,17 @@ declare function DocsLayout(props: DocsLayoutProps): JSX.Element;
118
119
  * docs variant when an upstream repository edit URL is configured.
119
120
  */
120
121
 
122
+ interface EditButtonProps {
123
+ pageSlug: string;
124
+ editUrl?: string;
125
+ }
121
126
  /**
122
127
  * Renders an external link for editing the current docs page source.
123
128
  *
124
129
  * @param props - Page slug and optional base repository edit URL.
125
130
  * @returns An edit link when editing is enabled for the current page.
126
131
  */
127
- declare function EditButton(props: {
128
- pageSlug: string;
129
- editUrl?: string;
130
- }): JSX.Element;
132
+ declare function EditButton(props: EditButtonProps): JSX.Element | null;
131
133
 
132
134
  /**
133
135
  * @module solidjsPageNavigation
@@ -152,7 +154,7 @@ interface PageNavigationProps {
152
154
  * @param props - Optional previous and next page descriptors.
153
155
  * @returns Navigation cards when adjacent pages are available.
154
156
  */
155
- declare function PageNavigation(props: PageNavigationProps): JSX.Element;
157
+ declare function PageNavigation(props: PageNavigationProps): JSX.Element | null;
156
158
 
157
159
  /**
158
160
  * @module solidjsTableOfContents
@@ -171,7 +173,7 @@ interface TableOfContentsProps {
171
173
  * @param props - Structured heading tree and current active heading id.
172
174
  * @returns A nested table of contents for the active docs page.
173
175
  */
174
- declare function TableOfContents(props: TableOfContentsProps): JSX.Element;
176
+ declare function TableOfContents(props: TableOfContentsProps): JSX.Element | null;
175
177
 
176
178
  /**
177
179
  * @module solidjsVersionSelector
@@ -183,7 +185,7 @@ declare function TableOfContents(props: TableOfContentsProps): JSX.Element;
183
185
  interface VersionSelectorProps {
184
186
  versions: string[];
185
187
  current: string;
186
- onSelect: (v: string) => void;
188
+ onSelect: (version: string) => void;
187
189
  }
188
190
  /**
189
191
  * Renders a version picker when more than one docs version is available.
@@ -191,7 +193,7 @@ interface VersionSelectorProps {
191
193
  * @param props - Available versions, current version, and selection callback.
192
194
  * @returns A dropdown-style version switcher for the docs surface.
193
195
  */
194
- declare function VersionSelector(props: VersionSelectorProps): JSX.Element;
196
+ declare function VersionSelector(props: VersionSelectorProps): JSX.Element | null;
195
197
 
196
198
  /**
197
199
  * @module solidjsDocSearchPage
@@ -201,10 +203,10 @@ declare function VersionSelector(props: VersionSelectorProps): JSX.Element;
201
203
  */
202
204
 
203
205
  interface DocSearchPageProps {
204
- tree: () => (DocSection & {
206
+ tree: Accessor<(DocSection & {
205
207
  pages: DocPage$1[];
206
208
  pageCount: number;
207
- })[] | undefined;
209
+ })[] | undefined>;
208
210
  onSelectPage?: (page: DocPage$1, section: DocSection) => void;
209
211
  }
210
212
  /**
@@ -215,6 +217,68 @@ interface DocSearchPageProps {
215
217
  */
216
218
  declare function DocSearchPage(props: DocSearchPageProps): JSX.Element;
217
219
 
220
+ /**
221
+ * @module solidjsCreateDocsAdmin
222
+ * @package @geenius/docs-solidjs
223
+ * @description Adapts caller-provided section and page mutations into a
224
+ * stable SolidJS admin controller with normalized method signatures.
225
+ */
226
+ interface DocsAdminActions {
227
+ createSection: (data: {
228
+ title: string;
229
+ slug: string;
230
+ parentId?: string;
231
+ order: number;
232
+ icon?: string;
233
+ description?: string;
234
+ access: 'public' | 'team' | 'admin';
235
+ }) => Promise<void>;
236
+ updateSection: (sectionId: string, data: Record<string, unknown>) => Promise<void>;
237
+ deleteSection: (sectionId: string) => Promise<void>;
238
+ reorderSections: (sectionIds: string[]) => Promise<void>;
239
+ createPage: (data: {
240
+ title: string;
241
+ slug: string;
242
+ content: string;
243
+ sectionId: string;
244
+ access: 'public' | 'team' | 'admin';
245
+ tags?: string[];
246
+ version?: string;
247
+ status?: 'draft' | 'published' | 'archived';
248
+ author?: {
249
+ name: string;
250
+ avatar?: string;
251
+ };
252
+ excerpt?: string;
253
+ order?: number;
254
+ }) => Promise<void>;
255
+ updatePage: (pageId: string, data: Record<string, unknown>) => Promise<void>;
256
+ publishPage: (pageId: string) => Promise<void>;
257
+ archivePage: (pageId: string) => Promise<void>;
258
+ deletePage: (pageId: string) => Promise<void>;
259
+ reorderPages: (pageIds: string[]) => Promise<void>;
260
+ movePage: (pageId: string, newSectionId: string, newOrder: number) => Promise<void>;
261
+ }
262
+ /**
263
+ * Creates a SolidJS-friendly docs admin controller around async mutations.
264
+ *
265
+ * @param mutations - Low-level CRUD and reorder operations for docs content.
266
+ * @returns An admin controller with normalized section and page methods.
267
+ */
268
+ declare function createDocsAdmin(mutations: {
269
+ createSection: (args: Record<string, unknown>) => Promise<unknown>;
270
+ updateSection: (args: Record<string, unknown>) => Promise<unknown>;
271
+ deleteSection: (args: Record<string, unknown>) => Promise<unknown>;
272
+ reorderSections: (args: Record<string, unknown>) => Promise<unknown>;
273
+ createPage: (args: Record<string, unknown>) => Promise<unknown>;
274
+ updatePage: (args: Record<string, unknown>) => Promise<unknown>;
275
+ publishPage: (args: Record<string, unknown>) => Promise<unknown>;
276
+ archivePage: (args: Record<string, unknown>) => Promise<unknown>;
277
+ deletePage: (args: Record<string, unknown>) => Promise<unknown>;
278
+ reorderPages: (args: Record<string, unknown>) => Promise<unknown>;
279
+ movePage: (args: Record<string, unknown>) => Promise<unknown>;
280
+ }): DocsAdminActions;
281
+
218
282
  /**
219
283
  * @module solidjsDocsAdminPage
220
284
  * @package @geenius/docs-solidjs
@@ -223,19 +287,12 @@ declare function DocSearchPage(props: DocSearchPageProps): JSX.Element;
223
287
  */
224
288
 
225
289
  interface DocsAdminPageProps {
226
- tree: () => (DocSection & {
290
+ tree: Accessor<(DocSection & {
227
291
  pages: DocPage$1[];
228
292
  pageCount: number;
229
- })[] | undefined;
293
+ })[] | undefined>;
230
294
  allPages?: DocPage$1[];
231
- admin: {
232
- createSection: (d: Record<string, unknown>) => Promise<void>;
233
- deleteSection: (id: string) => Promise<void>;
234
- createPage: (d: Record<string, unknown>) => Promise<void>;
235
- publishPage: (id: string) => Promise<void>;
236
- archivePage: (id: string) => Promise<void>;
237
- deletePage: (id: string) => Promise<void>;
238
- };
295
+ admin: DocsAdminActions;
239
296
  }
240
297
  /**
241
298
  * Renders the docs administration dashboard for SolidJS consumers.
@@ -253,10 +310,10 @@ declare function DocsAdminPage(props: DocsAdminPageProps): JSX.Element;
253
310
  */
254
311
 
255
312
  interface DocsIndexPageProps {
256
- tree: () => (DocSection & {
313
+ tree: Accessor<(DocSection & {
257
314
  pages: DocPage$1[];
258
315
  pageCount: number;
259
- })[] | undefined;
316
+ })[] | undefined>;
260
317
  onSelectPage?: (page: DocPage$1, section: DocSection) => void;
261
318
  }
262
319
  /**
@@ -275,11 +332,11 @@ declare function DocsIndexPage(props: DocsIndexPageProps): JSX.Element;
275
332
  */
276
333
 
277
334
  interface DocViewPageProps {
278
- tree: () => (DocSection & {
335
+ tree: Accessor<(DocSection & {
279
336
  pages: DocPage$1[];
280
337
  pageCount: number;
281
- })[] | undefined;
282
- page: () => DocPage$1 | null | undefined;
338
+ })[] | undefined>;
339
+ page: Accessor<DocPage$1 | null | undefined>;
283
340
  editPageUrl?: string;
284
341
  onNavigate: (page: DocPage$1, section: DocSection) => void;
285
342
  onIncrementView?: (pageId: string) => void;
@@ -299,13 +356,22 @@ declare function DocViewPage(props: DocViewPageProps): JSX.Element;
299
356
  * query signal, debounced execution, and normalized result lifecycle.
300
357
  */
301
358
 
302
- type DocSearchController = {
359
+ /**
360
+ * Search state returned by the SolidJS docs search primitive.
361
+ *
362
+ * @property results - Accessor returning the current ranked search results.
363
+ * @property isSearching - Accessor describing whether a search request is pending.
364
+ * @property query - Accessor returning the active search query.
365
+ * @property setQuery - Updates the active search query.
366
+ * @property clearSearch - Resets the query, results, and loading state.
367
+ */
368
+ interface DocSearchState {
303
369
  results: Accessor<SearchResult[]>;
304
370
  isSearching: Accessor<boolean>;
305
371
  query: Accessor<string>;
306
- setQuery: (value: string) => string;
372
+ setQuery: (query: string) => void;
307
373
  clearSearch: () => void;
308
- };
374
+ }
309
375
  /**
310
376
  * Creates debounced docs search state for SolidJS consumers.
311
377
  *
@@ -313,7 +379,7 @@ type DocSearchController = {
313
379
  * @param debounceMs - Delay before search execution after each query update.
314
380
  * @returns Signals and actions for driving a docs search experience.
315
381
  */
316
- declare function createDocSearch(searchFn: (query: string) => SearchResult[] | Promise<SearchResult[]>, debounceMs?: number): DocSearchController;
382
+ declare function createDocSearch(searchFn: (query: string) => SearchResult[] | Promise<SearchResult[]>, debounceMs?: number): DocSearchState;
317
383
 
318
384
  /**
319
385
  * @module solidjsCreateDocs
@@ -322,7 +388,21 @@ declare function createDocSearch(searchFn: (query: string) => SearchResult[] | P
322
388
  * config, flattens pages, and tracks section, page, and search selection state.
323
389
  */
324
390
 
325
- type DocsState = {
391
+ /**
392
+ * Aggregate docs state returned by the SolidJS docs primitive.
393
+ *
394
+ * @property sections - Accessor returning the normalized docs sections.
395
+ * @property currentSection - Accessor for the currently selected section.
396
+ * @property setSection - Updates the selected section and resets the page selection.
397
+ * @property currentPage - Accessor for the currently selected page.
398
+ * @property setPage - Updates the selected page.
399
+ * @property searchQuery - Accessor for the active docs search query.
400
+ * @property setSearchQuery - Updates the active docs search query.
401
+ * @property isLoading - Accessor describing whether the tree is still unresolved.
402
+ * @property config - Accessor returning the merged docs configuration.
403
+ * @property flatPages - Accessor returning the flattened page list.
404
+ */
405
+ interface DocsState {
326
406
  sections: Accessor<(DocSection & {
327
407
  pages: DocPage$1[];
328
408
  pageCount: number;
@@ -330,13 +410,13 @@ type DocsState = {
330
410
  currentSection: Accessor<DocSection | null>;
331
411
  setSection: (section: DocSection | null) => void;
332
412
  currentPage: Accessor<DocPage$1 | null>;
333
- setPage: Setter<DocPage$1 | null>;
413
+ setPage: (page: DocPage$1 | null) => void;
334
414
  searchQuery: Accessor<string>;
335
- setSearchQuery: Setter<string>;
415
+ setSearchQuery: (query: string) => void;
336
416
  isLoading: Accessor<boolean>;
337
417
  config: Accessor<DocsConfig>;
338
418
  flatPages: Accessor<DocPage$1[]>;
339
- };
419
+ }
340
420
  /**
341
421
  * Creates normalized docs state for the SolidJS docs surface.
342
422
  *
@@ -344,73 +424,10 @@ type DocsState = {
344
424
  * @param config - Optional overrides merged onto the shared docs config.
345
425
  * @returns A shared docs state object used by SolidJS pages and components.
346
426
  */
347
- declare function createDocs(tree: () => (DocSection & {
427
+ declare function createDocs(tree: Accessor<(DocSection & {
348
428
  pages: DocPage$1[];
349
429
  pageCount: number;
350
- })[] | undefined, config?: Partial<DocsConfig>): DocsState;
351
-
352
- /**
353
- * @module solidjsCreateDocsAdmin
354
- * @package @geenius/docs-solidjs
355
- * @description Adapts caller-provided section and page mutations into a
356
- * stable SolidJS admin controller with normalized method signatures.
357
- */
358
- type DocsAdminMutations = {
359
- createSection: (args: Record<string, unknown>) => Promise<unknown>;
360
- updateSection: (args: Record<string, unknown>) => Promise<unknown>;
361
- deleteSection: (args: Record<string, unknown>) => Promise<unknown>;
362
- reorderSections: (args: Record<string, unknown>) => Promise<unknown>;
363
- createPage: (args: Record<string, unknown>) => Promise<unknown>;
364
- updatePage: (args: Record<string, unknown>) => Promise<unknown>;
365
- publishPage: (args: Record<string, unknown>) => Promise<unknown>;
366
- archivePage: (args: Record<string, unknown>) => Promise<unknown>;
367
- deletePage: (args: Record<string, unknown>) => Promise<unknown>;
368
- reorderPages: (args: Record<string, unknown>) => Promise<unknown>;
369
- movePage: (args: Record<string, unknown>) => Promise<unknown>;
370
- };
371
- type DocsAdminController = {
372
- createSection: (data: {
373
- title: string;
374
- slug: string;
375
- parentId?: string;
376
- order: number;
377
- icon?: string;
378
- description?: string;
379
- access: 'public' | 'team' | 'admin';
380
- }) => Promise<void>;
381
- updateSection: (sectionId: string, data: Record<string, unknown>) => Promise<void>;
382
- deleteSection: (sectionId: string) => Promise<void>;
383
- reorderSections: (sectionIds: string[]) => Promise<void>;
384
- createPage: (data: {
385
- title: string;
386
- slug: string;
387
- content: string;
388
- sectionId: string;
389
- access: 'public' | 'team' | 'admin';
390
- tags?: string[];
391
- version?: string;
392
- status?: 'draft' | 'published' | 'archived';
393
- author?: {
394
- name: string;
395
- avatar?: string;
396
- };
397
- excerpt?: string;
398
- order?: number;
399
- }) => Promise<void>;
400
- updatePage: (pageId: string, data: Record<string, unknown>) => Promise<void>;
401
- publishPage: (pageId: string) => Promise<void>;
402
- archivePage: (pageId: string) => Promise<void>;
403
- deletePage: (pageId: string) => Promise<void>;
404
- reorderPages: (pageIds: string[]) => Promise<void>;
405
- movePage: (pageId: string, newSectionId: string, newOrder: number) => Promise<void>;
406
- };
407
- /**
408
- * Creates a SolidJS-friendly docs admin controller around async mutations.
409
- *
410
- * @param mutations - Low-level CRUD and reorder operations for docs content.
411
- * @returns An admin controller with normalized section and page methods.
412
- */
413
- declare function createDocsAdmin(mutations: DocsAdminMutations): DocsAdminController;
430
+ })[] | undefined>, config?: Partial<DocsConfig>): DocsState;
414
431
 
415
432
  /**
416
433
  * @module solidjsCreateTableOfContents
@@ -419,17 +436,24 @@ declare function createDocsAdmin(mutations: DocsAdminMutations): DocsAdminContro
419
436
  * and tracks the active heading via intersection observer updates.
420
437
  */
421
438
 
422
- type TableOfContentsController = {
439
+ /**
440
+ * Table-of-contents state returned by the SolidJS docs TOC primitive.
441
+ *
442
+ * @property toc - Accessor returning the extracted heading tree.
443
+ * @property activeId - Accessor returning the currently active heading id.
444
+ * @property setActiveId - Updates the currently active heading id.
445
+ */
446
+ interface TableOfContentsState {
423
447
  toc: Accessor<TocItem[]>;
424
448
  activeId: Accessor<string>;
425
- setActiveId: (value: string) => string;
426
- };
449
+ setActiveId: (id: string) => void;
450
+ }
427
451
  /**
428
452
  * Creates table-of-contents state for a docs page.
429
453
  *
430
454
  * @param mdxContent - Accessor returning the current page MDX source.
431
455
  * @returns Derived TOC state and active-heading controls.
432
456
  */
433
- declare function createTableOfContents(mdxContent: () => string | undefined): TableOfContentsController;
457
+ declare function createTableOfContents(mdxContent: Accessor<string | undefined>): TableOfContentsState;
434
458
 
435
459
  export { Breadcrumbs, DocPage, DocSearch, DocSearchPage, DocSidebar, DocViewPage, DocsAdminPage, DocsIndexPage, DocsLayout, EditButton, PageNavigation, TableOfContents, VersionSelector, createDocSearch, createDocs, createDocsAdmin, createTableOfContents };