@cedros/data-react-native 0.0.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/README.md +37 -0
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +816 -0
- package/dist/index.js +6485 -0
- package/dist/index.js.map +1 -0
- package/package.json +50 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,816 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare interface BlogIndexEntry {
|
|
4
|
+
slug: string;
|
|
5
|
+
title: string;
|
|
6
|
+
excerpt?: string;
|
|
7
|
+
category?: string;
|
|
8
|
+
tags?: string[];
|
|
9
|
+
publishedAt?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export declare interface BlogIndexQuery {
|
|
13
|
+
query?: string;
|
|
14
|
+
category?: string;
|
|
15
|
+
tag?: string;
|
|
16
|
+
sort?: "newest" | "oldest" | "title-asc" | "title-desc";
|
|
17
|
+
page?: number;
|
|
18
|
+
pageSize?: number;
|
|
19
|
+
dimensions?: FilterDimensionValues;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export declare function BlogIndexTemplate({ siteTitle, navigation, posts, title, description, query, category, tag, sort, page, pageSize, filterDimensions, activeFilters, onFilterChange, onSearch, onPageChange, bookmarkedSlugs, onBookmarkToggle, onNavigate, currentPath, }: BlogIndexTemplateProps): React.JSX.Element;
|
|
23
|
+
|
|
24
|
+
export declare interface BlogIndexTemplateProps {
|
|
25
|
+
siteTitle: string;
|
|
26
|
+
navigation: SiteNavigationItem[];
|
|
27
|
+
posts: BlogPostSummary[];
|
|
28
|
+
title?: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
query?: string;
|
|
31
|
+
category?: string;
|
|
32
|
+
tag?: string;
|
|
33
|
+
sort?: "newest" | "oldest" | "title-asc" | "title-desc";
|
|
34
|
+
page?: number;
|
|
35
|
+
pageSize?: number;
|
|
36
|
+
filterDimensions?: FilterDimension[];
|
|
37
|
+
activeFilters?: FilterDimensionValues;
|
|
38
|
+
onFilterChange?: (key: string, value: string) => void;
|
|
39
|
+
onSearch?: (query: string) => void;
|
|
40
|
+
onPageChange?: (page: number) => void;
|
|
41
|
+
bookmarkedSlugs?: Set<string>;
|
|
42
|
+
onBookmarkToggle?: (slug: string) => void;
|
|
43
|
+
onNavigate?: (route: string) => void;
|
|
44
|
+
currentPath?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export declare interface BlogPaywallConfig {
|
|
48
|
+
mode: "free" | "preview" | "locked";
|
|
49
|
+
previewParagraphs?: number;
|
|
50
|
+
price?: PaywallPrice;
|
|
51
|
+
unlocked: boolean;
|
|
52
|
+
payClient: PaywallPayClient;
|
|
53
|
+
subscriptionLabel?: string;
|
|
54
|
+
purchaseLabel?: string;
|
|
55
|
+
/** Remaining metered free reads this month (undefined = metering disabled). */
|
|
56
|
+
remainingFreeReads?: number;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export declare interface BlogPostSummary extends BlogIndexEntry {
|
|
60
|
+
author?: string;
|
|
61
|
+
readingMinutes?: number;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export declare function BlogPostTemplate({ siteTitle, navigation, title, bodyMarkdown, bodyHtml, allowUnsafeHtmlFallback, publishedAt, updatedAt, author, category, tags, readingMinutes, breadcrumbs, relatedPosts, isBookmarked, onBookmarkToggle, slug, tipping, paywall, onNavigate, currentPath, }: BlogPostTemplateProps): React.JSX.Element;
|
|
65
|
+
|
|
66
|
+
export declare interface BlogPostTemplateProps {
|
|
67
|
+
siteTitle: string;
|
|
68
|
+
navigation: SiteNavigationItem[];
|
|
69
|
+
title: string;
|
|
70
|
+
bodyMarkdown?: string;
|
|
71
|
+
bodyHtml?: string;
|
|
72
|
+
allowUnsafeHtmlFallback?: boolean;
|
|
73
|
+
publishedAt?: string;
|
|
74
|
+
updatedAt?: string;
|
|
75
|
+
author?: string;
|
|
76
|
+
category?: string;
|
|
77
|
+
tags?: string[];
|
|
78
|
+
readingMinutes?: number;
|
|
79
|
+
breadcrumbs?: Array<{
|
|
80
|
+
label: string;
|
|
81
|
+
href: string;
|
|
82
|
+
}>;
|
|
83
|
+
relatedPosts?: Array<{
|
|
84
|
+
slug: string;
|
|
85
|
+
title: string;
|
|
86
|
+
excerpt?: string;
|
|
87
|
+
}>;
|
|
88
|
+
isBookmarked?: boolean;
|
|
89
|
+
onBookmarkToggle?: (slug: string) => void;
|
|
90
|
+
slug?: string;
|
|
91
|
+
tipping?: BlogTippingConfig;
|
|
92
|
+
paywall?: BlogPaywallConfig;
|
|
93
|
+
onNavigate?: (route: string) => void;
|
|
94
|
+
currentPath?: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export declare function BlogSearchInput({ defaultValue, onSearch, placeholder, }: BlogSearchInputProps): React.JSX.Element;
|
|
98
|
+
|
|
99
|
+
export declare interface BlogSearchInputProps {
|
|
100
|
+
defaultValue?: string;
|
|
101
|
+
onSearch: (query: string) => void;
|
|
102
|
+
placeholder?: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export declare interface BlogTippingConfig {
|
|
106
|
+
enabled: boolean;
|
|
107
|
+
label?: string;
|
|
108
|
+
description?: string;
|
|
109
|
+
recipient?: string;
|
|
110
|
+
currencies?: TipCurrency[];
|
|
111
|
+
presets?: Record<string, number[]>;
|
|
112
|
+
dataServerUrl?: string;
|
|
113
|
+
/** When true, `recipientOverride` takes precedence over `recipient`. */
|
|
114
|
+
allowPerPostRecipient?: boolean;
|
|
115
|
+
/** Per-post tip recipient (used when `allowPerPostRecipient` is true). */
|
|
116
|
+
recipientOverride?: string;
|
|
117
|
+
/** Sender wallet address. */
|
|
118
|
+
senderAddress?: string;
|
|
119
|
+
/** Signs a base64 serialized transaction, returns signed base64. */
|
|
120
|
+
signTransaction?: (serializedTx: string) => Promise<string>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export declare function BookmarkButton({ slug, isBookmarked, onToggle, }: BookmarkButtonProps): React.JSX.Element;
|
|
124
|
+
|
|
125
|
+
export declare interface BookmarkButtonProps {
|
|
126
|
+
slug: string;
|
|
127
|
+
isBookmarked: boolean;
|
|
128
|
+
onToggle: (slug: string) => void;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export declare function Breadcrumbs({ trail, onNavigate, }: BreadcrumbsProps): React.JSX.Element | null;
|
|
132
|
+
|
|
133
|
+
export declare interface BreadcrumbsProps {
|
|
134
|
+
trail: Array<{
|
|
135
|
+
label: string;
|
|
136
|
+
href: string;
|
|
137
|
+
}>;
|
|
138
|
+
onNavigate?: (route: string) => void;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export declare function buildContentListHref(basePath: string, query: Record<string, string | number | undefined>): string;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Builds a deep link URL from structured components.
|
|
145
|
+
*
|
|
146
|
+
* @param contentType - The content type
|
|
147
|
+
* @param slug - Optional slug (omit for index pages)
|
|
148
|
+
* @param filters - Optional query filters
|
|
149
|
+
* @param anchor - Optional anchor/heading ID
|
|
150
|
+
* @returns A path string like `/blog/my-post?tag=api#install`
|
|
151
|
+
*/
|
|
152
|
+
export declare function buildDeepLink(contentType: DeepLinkResult["contentType"], slug?: string, filters?: DeepLinkResult["filters"], anchor?: string): string;
|
|
153
|
+
|
|
154
|
+
export declare function buildDocsSidebarSections(docs: DocsIndexEntry[], basePath?: string): DocsSidebarSection[];
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Theme provider for cedros-data React Native components.
|
|
158
|
+
*
|
|
159
|
+
* Wraps children in a `View` and provides resolved tokens via context.
|
|
160
|
+
*/
|
|
161
|
+
export declare function CedrosDataProvider({ theme, tokenOverrides, unstyled, children, }: CedrosDataProviderProps): React.JSX.Element;
|
|
162
|
+
|
|
163
|
+
export declare interface CedrosDataProviderProps {
|
|
164
|
+
/** Light or dark mode. */
|
|
165
|
+
theme?: ThemeMode;
|
|
166
|
+
/** Token overrides merged on top of the mode defaults. */
|
|
167
|
+
tokenOverrides?: Partial<CedrosDataThemeTokens>;
|
|
168
|
+
/** When true, components skip default styling. */
|
|
169
|
+
unstyled?: boolean;
|
|
170
|
+
children: ReactNode;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Theme token type for React Native.
|
|
175
|
+
*
|
|
176
|
+
* CamelCase keys mapping 1:1 to the web `--cedros-*` CSS variable namespace
|
|
177
|
+
* shared across cedros-login, cedros-pay, and cedros-data.
|
|
178
|
+
*/
|
|
179
|
+
export declare interface CedrosDataThemeTokens {
|
|
180
|
+
background: string;
|
|
181
|
+
foreground: string;
|
|
182
|
+
muted: string;
|
|
183
|
+
mutedForeground: string;
|
|
184
|
+
border: string;
|
|
185
|
+
link: string;
|
|
186
|
+
primary: string;
|
|
187
|
+
primaryForeground: string;
|
|
188
|
+
accent: string;
|
|
189
|
+
ring: string;
|
|
190
|
+
/** Border radius in pixels (not rem). */
|
|
191
|
+
radius: number;
|
|
192
|
+
success: string;
|
|
193
|
+
error: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** Value returned by `useCedrosDataTheme()`. */
|
|
197
|
+
export declare interface CedrosDataThemeValue {
|
|
198
|
+
mode: ThemeMode;
|
|
199
|
+
isDark: boolean;
|
|
200
|
+
tokens: CedrosDataThemeTokens;
|
|
201
|
+
unstyled: boolean;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Renders pre-rendered CMS HTML content.
|
|
206
|
+
*
|
|
207
|
+
* Uses `react-native-render-html` when installed as an optional peer dependency.
|
|
208
|
+
* Falls back to a plain-text message when the dependency is not available.
|
|
209
|
+
*/
|
|
210
|
+
export declare function CmsContent({ html, contentWidth, onLinkPress, }: CmsContentProps): React.JSX.Element;
|
|
211
|
+
|
|
212
|
+
export declare interface CmsContentProps {
|
|
213
|
+
/** Raw HTML content from the CMS to render. */
|
|
214
|
+
html: string;
|
|
215
|
+
/** Content width hint for react-native-render-html layout. */
|
|
216
|
+
contentWidth?: number;
|
|
217
|
+
/** Optional callback invoked when a link inside the content is tapped. */
|
|
218
|
+
onLinkPress?: (href: string) => void;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* A CMS page record as returned by the cedros-data entries API.
|
|
223
|
+
*/
|
|
224
|
+
export declare interface CmsPageRecord {
|
|
225
|
+
entry_key: string;
|
|
226
|
+
payload: {
|
|
227
|
+
key?: string;
|
|
228
|
+
title?: string;
|
|
229
|
+
description?: string;
|
|
230
|
+
route?: string;
|
|
231
|
+
section?: string;
|
|
232
|
+
status?: string;
|
|
233
|
+
body?: string;
|
|
234
|
+
bodyHtml?: string;
|
|
235
|
+
ogTitle?: string;
|
|
236
|
+
ogDescription?: string;
|
|
237
|
+
ogImage?: string;
|
|
238
|
+
twitterTitle?: string;
|
|
239
|
+
twitterDescription?: string;
|
|
240
|
+
author?: string;
|
|
241
|
+
publishedAt?: string;
|
|
242
|
+
updatedAt?: string;
|
|
243
|
+
category?: string;
|
|
244
|
+
tags?: string[];
|
|
245
|
+
slug?: string;
|
|
246
|
+
readingMinutes?: number;
|
|
247
|
+
wordCount?: number;
|
|
248
|
+
_metering?: MeteredReadsInfo;
|
|
249
|
+
[key: string]: unknown;
|
|
250
|
+
};
|
|
251
|
+
updated_at: string;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Code block with copy-to-clipboard button.
|
|
256
|
+
*
|
|
257
|
+
* Renders monospace text with a "Copy" button. Requires
|
|
258
|
+
* `@react-native-clipboard/clipboard` for clipboard functionality.
|
|
259
|
+
*/
|
|
260
|
+
export declare function CodeBlock({ code, language }: CodeBlockProps): React.JSX.Element;
|
|
261
|
+
|
|
262
|
+
export declare interface CodeBlockProps {
|
|
263
|
+
code: string;
|
|
264
|
+
language?: string;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export declare function collectDimensionValues(entries: object[], dimensionKeys: string[]): Record<string, string[]>;
|
|
268
|
+
|
|
269
|
+
export declare function collectFilterValues(entries: Array<{
|
|
270
|
+
category?: string;
|
|
271
|
+
tags?: string[];
|
|
272
|
+
}>): {
|
|
273
|
+
categories: string[];
|
|
274
|
+
tags: string[];
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
export declare interface ContactDetail {
|
|
278
|
+
label: string;
|
|
279
|
+
value: string;
|
|
280
|
+
href?: string;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export declare function ContactPageTemplate({ siteTitle, navigation, title, description, details, onNavigate, onLinkPress, currentPath, }: ContactPageTemplateProps): React.JSX.Element;
|
|
284
|
+
|
|
285
|
+
export declare interface ContactPageTemplateProps {
|
|
286
|
+
siteTitle: string;
|
|
287
|
+
navigation: SiteNavigationItem[];
|
|
288
|
+
title?: string;
|
|
289
|
+
description?: string;
|
|
290
|
+
details: ContactDetail[];
|
|
291
|
+
onNavigate?: (route: string) => void;
|
|
292
|
+
onLinkPress?: (href: string) => void;
|
|
293
|
+
currentPath?: string;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export declare function ContentPagination({ page, totalPages, onPageChange, }: ContentPaginationProps): React.JSX.Element | null;
|
|
297
|
+
|
|
298
|
+
export declare interface ContentPaginationProps {
|
|
299
|
+
page: number;
|
|
300
|
+
totalPages: number;
|
|
301
|
+
onPageChange?: (page: number) => void;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Content paywall gate for premium articles.
|
|
306
|
+
*
|
|
307
|
+
* In "preview" mode, renders truncated markdown content.
|
|
308
|
+
* In "locked" mode, shows a lock icon and unlock prompt.
|
|
309
|
+
*/
|
|
310
|
+
export declare function ContentPaywall({ mode, previewContent, price, payClient, purchaseLabel, subscriptionLabel, }: ContentPaywallProps): React.JSX.Element;
|
|
311
|
+
|
|
312
|
+
export declare interface ContentPaywallProps {
|
|
313
|
+
mode: "preview" | "locked";
|
|
314
|
+
previewContent?: string;
|
|
315
|
+
price?: PaywallPrice;
|
|
316
|
+
payClient: PaywallPayClient;
|
|
317
|
+
purchaseLabel?: string;
|
|
318
|
+
subscriptionLabel?: string;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/** Content type identifiers used across cedros-data. */
|
|
322
|
+
export declare type ContentType = "page" | "blog" | "docs" | "learn" | "project" | "airdrop";
|
|
323
|
+
|
|
324
|
+
/** Parsed result from a deep link URL. */
|
|
325
|
+
export declare interface DeepLinkResult {
|
|
326
|
+
contentType: ContentType | "home" | "contact" | "legal" | "not-found";
|
|
327
|
+
slug?: string;
|
|
328
|
+
/** Query parameters parsed from the URL. */
|
|
329
|
+
filters?: {
|
|
330
|
+
query?: string;
|
|
331
|
+
category?: string;
|
|
332
|
+
tag?: string;
|
|
333
|
+
sort?: string;
|
|
334
|
+
page?: number;
|
|
335
|
+
};
|
|
336
|
+
/** Anchor/hash fragment (e.g. a heading ID to scroll to). */
|
|
337
|
+
anchor?: string;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/** Dark theme defaults matching web CSS values. */
|
|
341
|
+
export declare const defaultDarkTokens: Readonly<CedrosDataThemeTokens>;
|
|
342
|
+
|
|
343
|
+
/** Light theme defaults matching web CSS values. */
|
|
344
|
+
export declare const defaultLightTokens: Readonly<CedrosDataThemeTokens>;
|
|
345
|
+
|
|
346
|
+
export declare function DocArticleTemplate({ siteTitle, navigation, title, bodyMarkdown, bodyHtml, allowUnsafeHtmlFallback, lastUpdated, readingMinutes, basePath, currentPath, docs, sidebarSections, sidebarTitle, breadcrumbs, previousDoc, nextDoc, onNavigate, }: DocArticleTemplateProps): React.JSX.Element;
|
|
347
|
+
|
|
348
|
+
export declare interface DocArticleTemplateProps {
|
|
349
|
+
siteTitle: string;
|
|
350
|
+
navigation: SiteNavigationItem[];
|
|
351
|
+
title: string;
|
|
352
|
+
bodyMarkdown?: string;
|
|
353
|
+
bodyHtml?: string;
|
|
354
|
+
allowUnsafeHtmlFallback?: boolean;
|
|
355
|
+
lastUpdated?: string;
|
|
356
|
+
readingMinutes?: number;
|
|
357
|
+
basePath?: string;
|
|
358
|
+
currentPath?: string;
|
|
359
|
+
docs?: DocsIndexEntry[];
|
|
360
|
+
sidebarSections?: DocsSidebarSection[];
|
|
361
|
+
sidebarTitle?: string;
|
|
362
|
+
breadcrumbs?: Array<{
|
|
363
|
+
label: string;
|
|
364
|
+
href: string;
|
|
365
|
+
}>;
|
|
366
|
+
previousDoc?: {
|
|
367
|
+
title: string;
|
|
368
|
+
href: string;
|
|
369
|
+
};
|
|
370
|
+
nextDoc?: {
|
|
371
|
+
title: string;
|
|
372
|
+
href: string;
|
|
373
|
+
};
|
|
374
|
+
onNavigate?: (route: string) => void;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export declare interface DocsIndexEntry {
|
|
378
|
+
slug: string;
|
|
379
|
+
title: string;
|
|
380
|
+
description?: string;
|
|
381
|
+
category?: string;
|
|
382
|
+
tags?: string[];
|
|
383
|
+
lastUpdated?: string;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export declare interface DocsIndexItem extends DocsIndexEntry {
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export declare interface DocsIndexQuery {
|
|
390
|
+
query?: string;
|
|
391
|
+
category?: string;
|
|
392
|
+
tag?: string;
|
|
393
|
+
sort?: "updated-desc" | "updated-asc" | "title-asc" | "title-desc";
|
|
394
|
+
page?: number;
|
|
395
|
+
pageSize?: number;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export declare function DocsIndexTemplate({ siteTitle, navigation, docs, title, description, basePath, currentPath, query, category, tag, sort, page, pageSize, sidebarSections, sidebarTitle, onNavigate, onPageChange, }: DocsIndexTemplateProps): React.JSX.Element;
|
|
399
|
+
|
|
400
|
+
export declare interface DocsIndexTemplateProps {
|
|
401
|
+
siteTitle: string;
|
|
402
|
+
navigation: SiteNavigationItem[];
|
|
403
|
+
docs: DocsIndexItem[];
|
|
404
|
+
title?: string;
|
|
405
|
+
description?: string;
|
|
406
|
+
basePath?: string;
|
|
407
|
+
currentPath?: string;
|
|
408
|
+
query?: string;
|
|
409
|
+
category?: string;
|
|
410
|
+
tag?: string;
|
|
411
|
+
sort?: "updated-desc" | "updated-asc" | "title-asc" | "title-desc";
|
|
412
|
+
page?: number;
|
|
413
|
+
pageSize?: number;
|
|
414
|
+
sidebarSections?: DocsSidebarSection[];
|
|
415
|
+
sidebarTitle?: string;
|
|
416
|
+
onNavigate?: (route: string) => void;
|
|
417
|
+
onPageChange?: (page: number) => void;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Collapsible docs sidebar navigation.
|
|
422
|
+
*
|
|
423
|
+
* Each section can be expanded/collapsed. Items show active state.
|
|
424
|
+
*/
|
|
425
|
+
export declare function DocsSidebar({ title, sections, onNavigate, }: DocsSidebarProps): React.JSX.Element;
|
|
426
|
+
|
|
427
|
+
export declare interface DocsSidebarItem {
|
|
428
|
+
key: string;
|
|
429
|
+
label: string;
|
|
430
|
+
href: string;
|
|
431
|
+
isActive?: boolean;
|
|
432
|
+
depth?: 0 | 1 | 2;
|
|
433
|
+
badge?: string;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export declare interface DocsSidebarProps {
|
|
437
|
+
title: string;
|
|
438
|
+
sections: DocsSidebarSection[];
|
|
439
|
+
onNavigate?: (route: string) => void;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export declare interface DocsSidebarSection {
|
|
443
|
+
key: string;
|
|
444
|
+
label: string;
|
|
445
|
+
items: DocsSidebarItem[];
|
|
446
|
+
/** When true, section renders collapsed by default in the sidebar. */
|
|
447
|
+
collapsed?: boolean;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Extracts a table-of-contents from raw markdown.
|
|
452
|
+
*
|
|
453
|
+
* Walks top-level heading nodes (h2-h4), slugifies the text content to
|
|
454
|
+
* produce `id` values matching `rehype-slug` output.
|
|
455
|
+
*
|
|
456
|
+
* @param markdown - Raw markdown string
|
|
457
|
+
* @returns Array of TOC entries ordered by document position
|
|
458
|
+
*/
|
|
459
|
+
export declare function extractTocFromMarkdown(markdown: string): TocEntry[];
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* JSON fetch wrapper for cedros-data API calls.
|
|
463
|
+
*
|
|
464
|
+
* React Native has `fetch` globally available — no polyfill needed.
|
|
465
|
+
*/
|
|
466
|
+
export declare function fetchJson<T>(serverUrl: string, path: string, init?: {
|
|
467
|
+
method?: string;
|
|
468
|
+
body?: unknown;
|
|
469
|
+
apiKey?: string;
|
|
470
|
+
}): Promise<T>;
|
|
471
|
+
|
|
472
|
+
/** Options for fetching data from the cedros-data server. */
|
|
473
|
+
export declare interface FetchOptions {
|
|
474
|
+
/** Base URL of the cedros-data server. */
|
|
475
|
+
serverUrl: string;
|
|
476
|
+
/** API key sent as x-api-key header. */
|
|
477
|
+
apiKey?: string;
|
|
478
|
+
/** Visitor ID for metered-reads tracking. */
|
|
479
|
+
visitorId?: string;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
export declare interface FilterDimension {
|
|
483
|
+
/** Payload field name, e.g. "category", "knowledgeLevel" */
|
|
484
|
+
key: string;
|
|
485
|
+
/** Display label, e.g. "Category", "Level" */
|
|
486
|
+
label: string;
|
|
487
|
+
/** Available values, e.g. ["Beginner", "Advanced"] */
|
|
488
|
+
values: string[];
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
export declare function FilterDimensionChips({ dimensions, active, onChange, }: FilterDimensionChipsProps): React.JSX.Element;
|
|
492
|
+
|
|
493
|
+
export declare interface FilterDimensionChipsProps {
|
|
494
|
+
dimensions: FilterDimension[];
|
|
495
|
+
active: FilterDimensionValues;
|
|
496
|
+
onChange: (key: string, value: string) => void;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
export declare interface FilterDimensionValues {
|
|
500
|
+
[dimensionKey: string]: string;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/** Layout options for the site footer. */
|
|
504
|
+
export declare interface FooterLayoutOptions {
|
|
505
|
+
/** Full-width removes horizontal padding. Default: "contained". */
|
|
506
|
+
width?: "contained" | "full";
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Client-side visitor identification via AsyncStorage.
|
|
511
|
+
*
|
|
512
|
+
* Returns a stable UUID stored in `cedros_vid` key.
|
|
513
|
+
* Falls back to a per-session random ID when AsyncStorage is unavailable.
|
|
514
|
+
*/
|
|
515
|
+
/**
|
|
516
|
+
* Returns a stable visitor ID, persisted via AsyncStorage when available.
|
|
517
|
+
*
|
|
518
|
+
* On first call, attempts to load from AsyncStorage. If not found, generates
|
|
519
|
+
* a new UUID and persists it. Returns synchronously from cache on subsequent calls.
|
|
520
|
+
*
|
|
521
|
+
* @returns The visitor ID (or a fresh in-memory one if AsyncStorage is unavailable).
|
|
522
|
+
*/
|
|
523
|
+
export declare function getOrCreateVisitorId(): Promise<string>;
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Returns the cached visitor ID synchronously, or `null` if not yet loaded.
|
|
527
|
+
* Call `getOrCreateVisitorId()` first to ensure the ID is loaded.
|
|
528
|
+
*/
|
|
529
|
+
export declare function getVisitorIdSync(): string | null;
|
|
530
|
+
|
|
531
|
+
export declare interface HomeFeature {
|
|
532
|
+
title: string;
|
|
533
|
+
description: string;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
export declare function HomePageTemplate({ siteTitle, navigation, headline, subheadline, ctaLabel, ctaRoute, features, onNavigate, currentPath, }: HomePageTemplateProps): React.JSX.Element;
|
|
537
|
+
|
|
538
|
+
export declare interface HomePageTemplateProps {
|
|
539
|
+
siteTitle: string;
|
|
540
|
+
navigation: SiteNavigationItem[];
|
|
541
|
+
headline: string;
|
|
542
|
+
subheadline?: string;
|
|
543
|
+
ctaLabel?: string;
|
|
544
|
+
ctaRoute?: string;
|
|
545
|
+
features?: HomeFeature[];
|
|
546
|
+
onNavigate?: (route: string) => void;
|
|
547
|
+
currentPath?: string;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
export declare function isRouteActive(route: string, currentPath: string, options?: RouteMatcherOptions): boolean;
|
|
551
|
+
|
|
552
|
+
export declare function LegalPageTemplate({ siteTitle, navigation, pageType, title, bodyMarkdown, bodyHtml, allowUnsafeHtmlFallback, effectiveDate, onNavigate, currentPath, }: LegalPageTemplateProps): React.JSX.Element;
|
|
553
|
+
|
|
554
|
+
export declare interface LegalPageTemplateProps {
|
|
555
|
+
siteTitle: string;
|
|
556
|
+
navigation: SiteNavigationItem[];
|
|
557
|
+
pageType: "privacy-policy" | "terms-of-service";
|
|
558
|
+
title: string;
|
|
559
|
+
bodyMarkdown?: string;
|
|
560
|
+
bodyHtml?: string;
|
|
561
|
+
allowUnsafeHtmlFallback?: boolean;
|
|
562
|
+
effectiveDate?: string;
|
|
563
|
+
onNavigate?: (route: string) => void;
|
|
564
|
+
currentPath?: string;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* Renders markdown content using react-native-markdown-display.
|
|
569
|
+
*
|
|
570
|
+
* Falls back to plain Text when bodyMarkdown is unavailable or
|
|
571
|
+
* the peer dependency is not installed.
|
|
572
|
+
*/
|
|
573
|
+
export declare function MarkdownContent({ bodyMarkdown, bodyHtml, allowUnsafeHtmlFallback, }: MarkdownContentProps): React.JSX.Element;
|
|
574
|
+
|
|
575
|
+
export declare interface MarkdownContentProps {
|
|
576
|
+
bodyMarkdown?: string;
|
|
577
|
+
bodyHtml?: string;
|
|
578
|
+
allowUnsafeHtmlFallback?: boolean;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
export declare function matchesFilterDimensions(entry: object, activeFilters: FilterDimensionValues): boolean;
|
|
582
|
+
|
|
583
|
+
/** Metering status injected into entry payloads when visitor_id is provided. */
|
|
584
|
+
export declare interface MeteredReadsInfo {
|
|
585
|
+
remainingFreeReads: number;
|
|
586
|
+
freeReadsPerMonth: number;
|
|
587
|
+
readsUsed: number;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/** Layout options for the top navigation bar. */
|
|
591
|
+
export declare interface NavLayoutOptions {
|
|
592
|
+
/** Full-width removes horizontal padding. Default: "contained". */
|
|
593
|
+
width?: "contained" | "full";
|
|
594
|
+
/** Where the main nav links sit. Default: "right". */
|
|
595
|
+
linkPosition?: "center" | "right";
|
|
596
|
+
/** Visual style for nav links. Default: "pill". */
|
|
597
|
+
linkStyle?: "text" | "pill";
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
export declare function normalizeRoutePath(route: string): string;
|
|
601
|
+
|
|
602
|
+
export declare function NotFoundTemplate({ siteTitle, navigation, title, message, onNavigate, currentPath, }: NotFoundTemplateProps): React.JSX.Element;
|
|
603
|
+
|
|
604
|
+
export declare interface NotFoundTemplateProps {
|
|
605
|
+
siteTitle: string;
|
|
606
|
+
navigation: SiteNavigationItem[];
|
|
607
|
+
title?: string;
|
|
608
|
+
message?: string;
|
|
609
|
+
onNavigate?: (route: string) => void;
|
|
610
|
+
currentPath?: string;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
export declare interface PaginationResult<T> {
|
|
614
|
+
items: T[];
|
|
615
|
+
page: number;
|
|
616
|
+
pageSize: number;
|
|
617
|
+
totalItems: number;
|
|
618
|
+
totalPages: number;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* Parses a deep link URL into a structured navigation target.
|
|
623
|
+
*
|
|
624
|
+
* Handles both full URLs (`https://example.com/blog/my-post?tag=api#install`)
|
|
625
|
+
* and path-only strings (`/blog/my-post`).
|
|
626
|
+
*
|
|
627
|
+
* @param url - The URL or path to parse
|
|
628
|
+
* @returns Parsed deep link result with content type, slug, filters, and anchor
|
|
629
|
+
*/
|
|
630
|
+
export declare function parseDeepLink(url: string): DeepLinkResult;
|
|
631
|
+
|
|
632
|
+
/** Provided by @cedros/pay-react-native (or any compatible implementation). */
|
|
633
|
+
export declare interface PaywallPayClient {
|
|
634
|
+
purchase?: () => Promise<void>;
|
|
635
|
+
subscribe?: () => Promise<void>;
|
|
636
|
+
useCredits?: () => Promise<void>;
|
|
637
|
+
creditsBalance?: number;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
export declare interface PaywallPrice {
|
|
641
|
+
amount: number;
|
|
642
|
+
currency: string;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
export declare function prepareBlogIndex<T extends BlogIndexEntry>(entries: T[], query: BlogIndexQuery): PaginationResult<T>;
|
|
646
|
+
|
|
647
|
+
export declare function prepareDocsIndex<T extends DocsIndexEntry>(entries: T[], query: DocsIndexQuery): PaginationResult<T>;
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Resolves the cedros-data server URL from options.
|
|
651
|
+
* Throws if no URL is available.
|
|
652
|
+
*/
|
|
653
|
+
export declare function resolveServerUrl(options: FetchOptions): string;
|
|
654
|
+
|
|
655
|
+
export declare interface RouteAwareItem {
|
|
656
|
+
route: string;
|
|
657
|
+
isActive?: boolean;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
export declare interface RouteMatcherOptions {
|
|
661
|
+
exact?: boolean;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/** Site-level settings record from the site_settings collection. */
|
|
665
|
+
export declare interface SiteDataRecord {
|
|
666
|
+
siteTitle?: string;
|
|
667
|
+
siteName?: string;
|
|
668
|
+
siteDescription?: string;
|
|
669
|
+
defaultDescription?: string;
|
|
670
|
+
defaultOgImage?: string;
|
|
671
|
+
locale?: string;
|
|
672
|
+
timezone?: string;
|
|
673
|
+
[key: string]: unknown;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
export declare function SiteFooter({ siteTitle, note, links, rightSlot, onNavigate, layout, }: SiteFooterProps): React.JSX.Element;
|
|
677
|
+
|
|
678
|
+
export declare interface SiteFooterLink {
|
|
679
|
+
key: string;
|
|
680
|
+
label: string;
|
|
681
|
+
route: string;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
export declare interface SiteFooterProps {
|
|
685
|
+
siteTitle: string;
|
|
686
|
+
note?: string;
|
|
687
|
+
links?: SiteFooterLink[];
|
|
688
|
+
rightSlot?: ReactNode;
|
|
689
|
+
onNavigate?: (route: string) => void;
|
|
690
|
+
layout?: FooterLayoutOptions;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* Full-page layout shell with SafeAreaView, TopNav, ScrollView content, and SiteFooter.
|
|
695
|
+
*/
|
|
696
|
+
export declare function SiteLayout({ siteTitle, navigation, children, currentPath, footerNote, onNavigate, layout, }: SiteLayoutProps): React.JSX.Element;
|
|
697
|
+
|
|
698
|
+
/** Combined layout options for the full site shell. */
|
|
699
|
+
export declare interface SiteLayoutOptions {
|
|
700
|
+
nav?: NavLayoutOptions;
|
|
701
|
+
footer?: FooterLayoutOptions;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
export declare interface SiteLayoutProps {
|
|
705
|
+
siteTitle: string;
|
|
706
|
+
navigation: SiteNavigationItem[];
|
|
707
|
+
children: ReactNode;
|
|
708
|
+
currentPath?: string;
|
|
709
|
+
footerNote?: string;
|
|
710
|
+
onNavigate?: (route: string) => void;
|
|
711
|
+
layout?: SiteLayoutOptions;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
/** Navigation item used by layout components. */
|
|
715
|
+
export declare interface SiteNavigationItem {
|
|
716
|
+
key: string;
|
|
717
|
+
label: string;
|
|
718
|
+
route: string;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
export declare const SOL_CURRENCY: TipCurrency;
|
|
722
|
+
|
|
723
|
+
/** Theme mode selector. */
|
|
724
|
+
export declare type ThemeMode = "light" | "dark";
|
|
725
|
+
|
|
726
|
+
export declare interface TipCurrency {
|
|
727
|
+
symbol: string;
|
|
728
|
+
decimals: number;
|
|
729
|
+
logo: string;
|
|
730
|
+
mint?: string;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* Tipping widget for Solana-based cryptocurrency tips.
|
|
735
|
+
*
|
|
736
|
+
* Requires `@cedros/trade-react` at runtime for transaction building.
|
|
737
|
+
* In React Native, the consumer must provide `senderAddress` and `signTransaction`
|
|
738
|
+
* since there is no browser wallet.
|
|
739
|
+
*/
|
|
740
|
+
export declare function TipWidget({ dataServerUrl, recipient: recipientProp, currencies: currenciesProp, presets: presetsProp, label: labelProp, description: descriptionProp, senderAddress, signTransaction: signProp, }: TipWidgetProps): React.JSX.Element | null;
|
|
741
|
+
|
|
742
|
+
export declare interface TipWidgetProps {
|
|
743
|
+
/** cedros-data server URL for config fetch. */
|
|
744
|
+
dataServerUrl?: string;
|
|
745
|
+
/** Tip recipient address. When provided, config fetch is skipped. */
|
|
746
|
+
recipient?: string;
|
|
747
|
+
currencies?: TipCurrency[];
|
|
748
|
+
presets?: Record<string, number[]>;
|
|
749
|
+
label?: string;
|
|
750
|
+
description?: string;
|
|
751
|
+
/** Sender wallet address. */
|
|
752
|
+
senderAddress?: string;
|
|
753
|
+
/** Signs a base64 serialized transaction, returns signed base64. */
|
|
754
|
+
signTransaction?: (serializedTx: string) => Promise<string>;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
export declare interface TocEntry {
|
|
758
|
+
id: string;
|
|
759
|
+
label: string;
|
|
760
|
+
depth: 2 | 3 | 4;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Table of contents component with active state tracking.
|
|
765
|
+
*
|
|
766
|
+
* Unlike the web version (which uses IntersectionObserver), the RN version
|
|
767
|
+
* accepts `activeId` as a prop. Consumers should track scroll position in
|
|
768
|
+
* their ScrollView and pass the current heading ID.
|
|
769
|
+
*
|
|
770
|
+
* If `activeId` is not provided, tracks selection state internally on press.
|
|
771
|
+
*/
|
|
772
|
+
export declare function TocScrollSpy({ entries, activeId: externalActiveId, onPress, }: TocScrollSpyProps): React.JSX.Element;
|
|
773
|
+
|
|
774
|
+
export declare interface TocScrollSpyProps {
|
|
775
|
+
entries: Array<{
|
|
776
|
+
id: string;
|
|
777
|
+
label: string;
|
|
778
|
+
depth?: 2 | 3 | 4;
|
|
779
|
+
}>;
|
|
780
|
+
activeId?: string;
|
|
781
|
+
onPress?: (id: string) => void;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
export declare function TopNav({ siteTitle, navigation, currentPath, rightSlot, onNavigate, onBrandPress, layout, }: TopNavProps): React.JSX.Element;
|
|
785
|
+
|
|
786
|
+
export declare interface TopNavProps {
|
|
787
|
+
siteTitle: string;
|
|
788
|
+
navigation: SiteNavigationItem[];
|
|
789
|
+
currentPath?: string;
|
|
790
|
+
rightSlot?: ReactNode;
|
|
791
|
+
onNavigate?: (route: string) => void;
|
|
792
|
+
onBrandPress?: () => void;
|
|
793
|
+
layout?: NavLayoutOptions;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
export declare const USDC_CURRENCY: TipCurrency;
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* Returns the current theme context.
|
|
800
|
+
*
|
|
801
|
+
* Must be called inside a `<CedrosDataProvider>`.
|
|
802
|
+
*/
|
|
803
|
+
export declare function useCedrosDataTheme(): CedrosDataThemeValue;
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* Returns the current theme context, or `null` when outside a provider.
|
|
807
|
+
*/
|
|
808
|
+
export declare function useCedrosDataThemeOptional(): CedrosDataThemeValue | null;
|
|
809
|
+
|
|
810
|
+
export declare function withActiveDocsSidebar(sections: DocsSidebarSection[], currentPath?: string): DocsSidebarSection[];
|
|
811
|
+
|
|
812
|
+
export declare function withActiveRouteState<T extends RouteAwareItem>(items: T[], currentPath: string, options?: RouteMatcherOptions): Array<T & {
|
|
813
|
+
isActive: boolean;
|
|
814
|
+
}>;
|
|
815
|
+
|
|
816
|
+
export { }
|