@openpkg-ts/ui 0.3.2 → 0.5.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.
- package/dist/badge/index.d.ts +2 -10
- package/dist/docskit/index.d.ts +300 -88
- package/dist/docskit/index.js +1642 -1463
- package/package.json +11 -1
- package/src/styles/docskit.css +38 -13
package/dist/badge/index.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
type KindBadgeKind = "function" | "class" | "interface" | "type" | "enum" | "variable" | "namespace" | "module" | "reference" | "external";
|
|
3
3
|
type KindBadgeSize = "sm" | "md";
|
|
4
|
-
declare const kindBadgeVariants:
|
|
5
|
-
kind?: KindBadgeKind | null;
|
|
6
|
-
size?: KindBadgeSize | null;
|
|
7
|
-
className?: string;
|
|
8
|
-
}) => string;
|
|
4
|
+
declare const kindBadgeVariants: unknown;
|
|
9
5
|
interface KindBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
10
6
|
kind?: KindBadgeKind | null;
|
|
11
7
|
size?: KindBadgeSize | null;
|
|
@@ -14,11 +10,7 @@ interface KindBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
14
10
|
declare const KindBadge: React.ForwardRefExoticComponent<KindBadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
15
11
|
type StatusBadgeStatus = "success" | "warning" | "error" | "neutral";
|
|
16
12
|
type StatusBadgeSize = "sm" | "md";
|
|
17
|
-
declare const statusBadgeVariants:
|
|
18
|
-
status?: StatusBadgeStatus | null;
|
|
19
|
-
size?: StatusBadgeSize | null;
|
|
20
|
-
className?: string;
|
|
21
|
-
}) => string;
|
|
13
|
+
declare const statusBadgeVariants: unknown;
|
|
22
14
|
interface StatusBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
23
15
|
status?: StatusBadgeStatus | null;
|
|
24
16
|
size?: StatusBadgeSize | null;
|
package/dist/docskit/index.d.ts
CHANGED
|
@@ -43,9 +43,27 @@ interface APICodePanelProps {
|
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Right-side sticky code panel for API documentation.
|
|
46
|
-
* Features language dropdown
|
|
46
|
+
* Features language dropdown and syntax highlighting via docskit.
|
|
47
47
|
*/
|
|
48
48
|
declare function APICodePanel({ languages, examples, externalLink, title, className }: APICodePanelProps): React3.ReactNode;
|
|
49
|
+
import { ReactNode as ReactNode2 } from "react";
|
|
50
|
+
interface APIReferenceLayoutProps {
|
|
51
|
+
/** Left column content (documentation) */
|
|
52
|
+
children: ReactNode2;
|
|
53
|
+
/** Right column content (code examples) */
|
|
54
|
+
examples: ReactNode2;
|
|
55
|
+
/** Custom className */
|
|
56
|
+
className?: string;
|
|
57
|
+
/** Left column width on desktop (default: 58%) */
|
|
58
|
+
leftWidth?: string;
|
|
59
|
+
/** Right column width on desktop (default: 42%) */
|
|
60
|
+
rightWidth?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Two-column layout for API reference with sticky right panel.
|
|
64
|
+
* Responsive: stacks vertically on mobile, two-column on desktop.
|
|
65
|
+
*/
|
|
66
|
+
declare function APIReferenceLayout({ children, examples, className, leftWidth, rightWidth }: APIReferenceLayoutProps): ReactNode2;
|
|
49
67
|
import * as React4 from "react";
|
|
50
68
|
interface APIReferencePageProps {
|
|
51
69
|
/** Page title */
|
|
@@ -88,14 +106,46 @@ interface APISectionProps {
|
|
|
88
106
|
* Docs/params on left, sticky code panel on right.
|
|
89
107
|
*/
|
|
90
108
|
declare function APISection({ title, id, description, children, languages, examples, externalLink, codePanelTitle, className }: APISectionProps): React5.ReactNode;
|
|
109
|
+
import { ReactNode as ReactNode3 } from "react";
|
|
110
|
+
interface CodeBlockProps {
|
|
111
|
+
/** Code content */
|
|
112
|
+
code: string;
|
|
113
|
+
/** Language for syntax highlighting */
|
|
114
|
+
language?: string;
|
|
115
|
+
/** Show line numbers */
|
|
116
|
+
showLineNumbers?: boolean;
|
|
117
|
+
/** Custom className */
|
|
118
|
+
className?: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Syntax-highlighted code block powered by CodeHike.
|
|
122
|
+
* Thin wrapper around docskit's ClientDocsKitCode with a simple interface.
|
|
123
|
+
*/
|
|
124
|
+
declare function CodeBlock({ code, language, showLineNumbers, className }: CodeBlockProps): ReactNode3;
|
|
125
|
+
import { ReactNode as ReactNode4 } from "react";
|
|
126
|
+
interface CollapsiblePanelProps {
|
|
127
|
+
/** Panel title (e.g., "Response", "Data source") */
|
|
128
|
+
title: string;
|
|
129
|
+
/** Panel content */
|
|
130
|
+
children: ReactNode4;
|
|
131
|
+
/** Default expanded state */
|
|
132
|
+
defaultExpanded?: boolean;
|
|
133
|
+
/** Controlled expanded state */
|
|
134
|
+
expanded?: boolean;
|
|
135
|
+
/** Controlled onChange */
|
|
136
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
137
|
+
/** Custom className */
|
|
138
|
+
className?: string;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Accordion-style collapsible panel for code examples.
|
|
142
|
+
* Uses CSS grid-rows transition for smooth open/close.
|
|
143
|
+
*/
|
|
144
|
+
declare function CollapsiblePanel({ title, children, defaultExpanded, expanded: controlledExpanded, onExpandedChange, className }: CollapsiblePanelProps): ReactNode4;
|
|
91
145
|
import * as React6 from "react";
|
|
92
146
|
type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
93
147
|
type EndpointBadgeSize = "sm" | "md";
|
|
94
|
-
declare const endpointBadgeVariants:
|
|
95
|
-
method?: HttpMethod | null;
|
|
96
|
-
size?: EndpointBadgeSize | null;
|
|
97
|
-
className?: string;
|
|
98
|
-
}) => string;
|
|
148
|
+
declare const endpointBadgeVariants: unknown;
|
|
99
149
|
interface EndpointBadgeProps extends React6.HTMLAttributes<HTMLSpanElement> {
|
|
100
150
|
method: HttpMethod;
|
|
101
151
|
size?: EndpointBadgeSize | null;
|
|
@@ -111,7 +161,154 @@ interface EndpointHeaderProps extends React7.HTMLAttributes<HTMLDivElement> {
|
|
|
111
161
|
copyable?: boolean;
|
|
112
162
|
}
|
|
113
163
|
declare const EndpointHeader: React7.ForwardRefExoticComponent<EndpointHeaderProps & React7.RefAttributes<HTMLDivElement>>;
|
|
114
|
-
import
|
|
164
|
+
import { ReactNode as ReactNode5 } from "react";
|
|
165
|
+
interface EnumValue {
|
|
166
|
+
/** Enum value */
|
|
167
|
+
value: string;
|
|
168
|
+
/** Optional description */
|
|
169
|
+
description?: string;
|
|
170
|
+
}
|
|
171
|
+
interface EnumValuesSectionProps {
|
|
172
|
+
/** Enum values to display */
|
|
173
|
+
values: EnumValue[];
|
|
174
|
+
/** Section header (default: "Possible values") */
|
|
175
|
+
header?: string;
|
|
176
|
+
/** Custom className */
|
|
177
|
+
className?: string;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Enum values section showing possible values with optional descriptions.
|
|
181
|
+
* Used inside parameter items to show enum options.
|
|
182
|
+
*/
|
|
183
|
+
declare function EnumValuesSection({ values, header, className }: EnumValuesSectionProps): ReactNode5;
|
|
184
|
+
import { ReactNode as ReactNode6 } from "react";
|
|
185
|
+
interface ExampleChip {
|
|
186
|
+
/** Unique identifier */
|
|
187
|
+
id: string;
|
|
188
|
+
/** Display label */
|
|
189
|
+
label: string;
|
|
190
|
+
}
|
|
191
|
+
interface ExampleChipsProps {
|
|
192
|
+
/** Available examples */
|
|
193
|
+
examples: ExampleChip[];
|
|
194
|
+
/** Currently active example ID */
|
|
195
|
+
activeId: string;
|
|
196
|
+
/** Selection callback */
|
|
197
|
+
onSelect: (id: string) => void;
|
|
198
|
+
/** Custom className */
|
|
199
|
+
className?: string;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Tab-like chips for switching between code examples.
|
|
203
|
+
* Used in the right column to select different example variations.
|
|
204
|
+
*/
|
|
205
|
+
declare function ExampleChips({ examples, activeId, onSelect, className }: ExampleChipsProps): ReactNode6;
|
|
206
|
+
import { ReactNode as ReactNode7 } from "react";
|
|
207
|
+
interface CodeExample2 {
|
|
208
|
+
/** Unique identifier */
|
|
209
|
+
id: string;
|
|
210
|
+
/** Display label for chip */
|
|
211
|
+
label: string;
|
|
212
|
+
/** Code content */
|
|
213
|
+
code: string;
|
|
214
|
+
/** Language for highlighting */
|
|
215
|
+
language?: string;
|
|
216
|
+
}
|
|
217
|
+
interface ExampleSectionProps {
|
|
218
|
+
/** Section ID for sync scroll */
|
|
219
|
+
id: string;
|
|
220
|
+
/** Code examples to display */
|
|
221
|
+
examples: CodeExample2[];
|
|
222
|
+
/** Data source code (SQL/schema) */
|
|
223
|
+
dataSource?: string;
|
|
224
|
+
/** Response JSON */
|
|
225
|
+
response?: string;
|
|
226
|
+
/** Notes text */
|
|
227
|
+
notes?: ReactNode7;
|
|
228
|
+
/** Custom className */
|
|
229
|
+
className?: string;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Complete right-column section combining chips, code, and collapsible panels.
|
|
233
|
+
* Integrates with SyncScrollProvider for synchronized scrolling.
|
|
234
|
+
*/
|
|
235
|
+
declare function ExampleSection({ id, examples, dataSource, response, notes, className }: ExampleSectionProps): ReactNode7;
|
|
236
|
+
import { SpecSignatureParameter } from "@openpkg-ts/spec";
|
|
237
|
+
import { ReactNode as ReactNode8 } from "react";
|
|
238
|
+
interface ExpandableParameterProps {
|
|
239
|
+
/** Parameter from spec */
|
|
240
|
+
parameter: SpecSignatureParameter;
|
|
241
|
+
/** Parent path prefix */
|
|
242
|
+
parentPath?: string;
|
|
243
|
+
/** Default expanded state */
|
|
244
|
+
defaultExpanded?: boolean;
|
|
245
|
+
/** Controlled expanded state */
|
|
246
|
+
expanded?: boolean;
|
|
247
|
+
/** Controlled onChange */
|
|
248
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
249
|
+
/** Nesting depth */
|
|
250
|
+
level?: number;
|
|
251
|
+
/** Custom className */
|
|
252
|
+
className?: string;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Compound component combining APIParameterItem + NestedParameterToggle + NestedParameterContainer.
|
|
256
|
+
* Automatically extracts nested object properties and enum values from spec schema.
|
|
257
|
+
*/
|
|
258
|
+
declare function ExpandableParameter({ parameter, parentPath, defaultExpanded, expanded: controlledExpanded, onExpandedChange, level, className }: ExpandableParameterProps): ReactNode8;
|
|
259
|
+
import { ReactNode as ReactNode9 } from "react";
|
|
260
|
+
interface MethodSectionProps {
|
|
261
|
+
/** Section ID for scroll sync */
|
|
262
|
+
id: string;
|
|
263
|
+
/** Method title (e.g., "Fetch data") */
|
|
264
|
+
title: string;
|
|
265
|
+
/** Method signature (e.g., "select(columns?, options?)") */
|
|
266
|
+
signature?: string;
|
|
267
|
+
/** Method description */
|
|
268
|
+
description?: ReactNode9;
|
|
269
|
+
/** Bullet list notes */
|
|
270
|
+
notes?: string[];
|
|
271
|
+
/** Parameter content */
|
|
272
|
+
children?: ReactNode9;
|
|
273
|
+
/** Custom className */
|
|
274
|
+
className?: string;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Container for a single API method in the documentation.
|
|
278
|
+
* Renders title, signature, description, notes list, and parameters.
|
|
279
|
+
*/
|
|
280
|
+
declare function MethodSection({ id, title, signature, description, notes, children, className }: MethodSectionProps): ReactNode9;
|
|
281
|
+
import { ReactNode as ReactNode10 } from "react";
|
|
282
|
+
interface NestedParameterContainerProps {
|
|
283
|
+
/** Nested parameter content */
|
|
284
|
+
children: ReactNode10;
|
|
285
|
+
/** Nesting depth level (0 = first level) */
|
|
286
|
+
level?: number;
|
|
287
|
+
/** Custom className */
|
|
288
|
+
className?: string;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Bordered container for nested child parameters (Stripe-style).
|
|
292
|
+
* Connects to NestedParameterToggle above (no top border).
|
|
293
|
+
*/
|
|
294
|
+
declare function NestedParameterContainer({ children, level, className }: NestedParameterContainerProps): ReactNode10;
|
|
295
|
+
import { ReactNode as ReactNode11 } from "react";
|
|
296
|
+
interface NestedParameterToggleProps {
|
|
297
|
+
/** Toggle state */
|
|
298
|
+
expanded: boolean;
|
|
299
|
+
/** Toggle callback */
|
|
300
|
+
onToggle: () => void;
|
|
301
|
+
/** Optional child count to display */
|
|
302
|
+
count?: number;
|
|
303
|
+
/** Custom className */
|
|
304
|
+
className?: string;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* "Show/Hide child parameters" toggle button (Stripe-style).
|
|
308
|
+
* Plus icon rotates 45deg when expanded.
|
|
309
|
+
*/
|
|
310
|
+
declare function NestedParameterToggle({ expanded, onToggle, count, className }: NestedParameterToggleProps): ReactNode11;
|
|
311
|
+
import { ReactNode as ReactNode12 } from "react";
|
|
115
312
|
interface APIParameterSchema {
|
|
116
313
|
/** Type name */
|
|
117
314
|
type?: string;
|
|
@@ -127,40 +324,48 @@ interface APIParameterSchema {
|
|
|
127
324
|
interface APIParameterItemProps {
|
|
128
325
|
/** Parameter name */
|
|
129
326
|
name: string;
|
|
130
|
-
/**
|
|
327
|
+
/** Parent path prefix (e.g., "options." for nested) */
|
|
328
|
+
parentPath?: string;
|
|
329
|
+
/** Parameter type */
|
|
131
330
|
type: string;
|
|
132
|
-
/**
|
|
331
|
+
/** Required parameter */
|
|
133
332
|
required?: boolean;
|
|
333
|
+
/** Optional parameter (explicit) */
|
|
334
|
+
optional?: boolean;
|
|
335
|
+
/** Has expandable children */
|
|
336
|
+
expandable?: boolean;
|
|
134
337
|
/** Description */
|
|
135
|
-
description?:
|
|
136
|
-
/** Nested
|
|
137
|
-
children?:
|
|
138
|
-
/**
|
|
139
|
-
|
|
338
|
+
description?: ReactNode12;
|
|
339
|
+
/** Nested content (params or enum) */
|
|
340
|
+
children?: ReactNode12;
|
|
341
|
+
/** Anchor ID for deep linking */
|
|
342
|
+
anchorId?: string;
|
|
343
|
+
/** Show anchor link on hover */
|
|
344
|
+
showAnchor?: boolean;
|
|
140
345
|
/** Custom className */
|
|
141
346
|
className?: string;
|
|
142
347
|
}
|
|
143
348
|
/**
|
|
144
|
-
* Single parameter row
|
|
145
|
-
*
|
|
349
|
+
* Single parameter row in Stripe-style documentation.
|
|
350
|
+
* Displays name, type, badges, description, and optional nested content.
|
|
146
351
|
*/
|
|
147
|
-
declare function APIParameterItem({ name, type, required, description, children,
|
|
148
|
-
import * as
|
|
352
|
+
declare function APIParameterItem({ name, parentPath, type, required, optional, expandable, description, children, anchorId, showAnchor, className }: APIParameterItemProps): ReactNode12;
|
|
353
|
+
import * as React8 from "react";
|
|
149
354
|
interface ParameterListProps {
|
|
150
355
|
/** Title above the list (e.g., "Body parameters") */
|
|
151
356
|
title?: string;
|
|
152
357
|
/** Number of items to show before collapsing */
|
|
153
358
|
collapseAfter?: number;
|
|
154
359
|
/** Child parameter items */
|
|
155
|
-
children:
|
|
360
|
+
children: React8.ReactNode;
|
|
156
361
|
/** Custom className */
|
|
157
362
|
className?: string;
|
|
158
363
|
}
|
|
159
364
|
/**
|
|
160
365
|
* Container for parameter items with optional "More parameters" collapse.
|
|
161
366
|
*/
|
|
162
|
-
declare function ParameterList({ title, collapseAfter, children, className }: ParameterListProps):
|
|
163
|
-
import * as
|
|
367
|
+
declare function ParameterList({ title, collapseAfter, children, className }: ParameterListProps): React8.ReactNode;
|
|
368
|
+
import * as React9 from "react";
|
|
164
369
|
interface ResponseBlockProps {
|
|
165
370
|
/** Response JSON data */
|
|
166
371
|
data: object;
|
|
@@ -173,7 +378,41 @@ interface ResponseBlockProps {
|
|
|
173
378
|
* JSON response preview with syntax highlighting.
|
|
174
379
|
* Displays formatted JSON with copy functionality.
|
|
175
380
|
*/
|
|
176
|
-
declare function ResponseBlock({ data, title, className }: ResponseBlockProps):
|
|
381
|
+
declare function ResponseBlock({ data, title, className }: ResponseBlockProps): React9.ReactNode;
|
|
382
|
+
import { ReactNode as ReactNode13, RefObject } from "react";
|
|
383
|
+
interface SyncScrollContextValue {
|
|
384
|
+
/** Currently visible section ID */
|
|
385
|
+
activeSection: string | null;
|
|
386
|
+
/** Register a section to track */
|
|
387
|
+
registerSection: (id: string, ref: RefObject<HTMLElement | null>) => void;
|
|
388
|
+
/** Unregister a section */
|
|
389
|
+
unregisterSection: (id: string) => void;
|
|
390
|
+
/** Scroll right column to section */
|
|
391
|
+
scrollToSection: (id: string) => void;
|
|
392
|
+
/** Register the right column container */
|
|
393
|
+
registerRightColumn: (ref: RefObject<HTMLElement | null>) => void;
|
|
394
|
+
}
|
|
395
|
+
interface SyncScrollProviderProps {
|
|
396
|
+
children: ReactNode13;
|
|
397
|
+
/** Root margin for intersection observer (default: '-20% 0px -60% 0px') */
|
|
398
|
+
rootMargin?: string;
|
|
399
|
+
/** Scroll behavior (default: 'smooth') */
|
|
400
|
+
scrollBehavior?: ScrollBehavior;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Provider for synchronized scrolling between left and right columns.
|
|
404
|
+
* Uses IntersectionObserver to track visible sections on the left,
|
|
405
|
+
* and auto-scrolls the right column to matching examples.
|
|
406
|
+
*/
|
|
407
|
+
declare function SyncScrollProvider({ children, rootMargin, scrollBehavior }: SyncScrollProviderProps): ReactNode13;
|
|
408
|
+
/**
|
|
409
|
+
* Hook to access sync scroll context.
|
|
410
|
+
*/
|
|
411
|
+
declare function useSyncScroll(): SyncScrollContextValue;
|
|
412
|
+
/**
|
|
413
|
+
* Hook to register a section for scroll tracking.
|
|
414
|
+
*/
|
|
415
|
+
declare function useSyncSection(id: string): RefObject<HTMLElement | null>;
|
|
177
416
|
import { AnnotationHandler } from "codehike/code";
|
|
178
417
|
declare const callout: AnnotationHandler;
|
|
179
418
|
import { AnnotationHandler as AnnotationHandler2, RawCode } from "codehike/code";
|
|
@@ -208,11 +447,11 @@ declare function DocsKitCode(props: {
|
|
|
208
447
|
codeblock: RawCode;
|
|
209
448
|
handlers?: AnnotationHandler2[];
|
|
210
449
|
className?: string;
|
|
211
|
-
}): Promise<React.
|
|
450
|
+
}): Promise<React.ReactNode>;
|
|
212
451
|
declare function SingleCode(props: {
|
|
213
452
|
group: CodeInfo;
|
|
214
453
|
className?: string;
|
|
215
|
-
}): Promise<React.
|
|
454
|
+
}): Promise<React.ReactNode>;
|
|
216
455
|
declare function toCodeGroup(props: {
|
|
217
456
|
codeblocks: RawCode[];
|
|
218
457
|
flags?: string;
|
|
@@ -222,7 +461,7 @@ declare function toCodeGroup(props: {
|
|
|
222
461
|
declare function MultiCode({ group, className }: {
|
|
223
462
|
group: CodeInfo;
|
|
224
463
|
className?: string;
|
|
225
|
-
}): React.
|
|
464
|
+
}): React.ReactNode;
|
|
226
465
|
import { AnnotationHandler as AnnotationHandler3, RawCode as RawCode2 } from "codehike/code";
|
|
227
466
|
/**
|
|
228
467
|
* Client-side code block with syntax highlighting.
|
|
@@ -232,20 +471,20 @@ declare function ClientDocsKitCode(props: {
|
|
|
232
471
|
codeblock: RawCode2;
|
|
233
472
|
handlers?: AnnotationHandler3[];
|
|
234
473
|
className?: string;
|
|
235
|
-
}): React.
|
|
474
|
+
}): React.ReactNode;
|
|
236
475
|
/**
|
|
237
476
|
* Client-side terminal-style code block.
|
|
238
477
|
*/
|
|
239
478
|
declare function ClientTerminal(props: {
|
|
240
479
|
codeblock: RawCode2;
|
|
241
480
|
handlers?: AnnotationHandler3[];
|
|
242
|
-
}): React.
|
|
481
|
+
}): React.ReactNode;
|
|
243
482
|
/**
|
|
244
483
|
* Client-side inline code with syntax highlighting.
|
|
245
484
|
*/
|
|
246
485
|
declare function ClientInlineCode({ codeblock }: {
|
|
247
486
|
codeblock: RawCode2;
|
|
248
|
-
}): React.
|
|
487
|
+
}): React.ReactNode;
|
|
249
488
|
/**
|
|
250
489
|
* Client-side code tabs with multiple files.
|
|
251
490
|
*/
|
|
@@ -253,12 +492,12 @@ declare function ClientCode(props: {
|
|
|
253
492
|
codeblocks: RawCode2[];
|
|
254
493
|
flags?: string;
|
|
255
494
|
storage?: string;
|
|
256
|
-
}): React.
|
|
495
|
+
}): React.ReactNode;
|
|
257
496
|
declare function CopyButton({ text, className, variant }: {
|
|
258
497
|
text: string;
|
|
259
498
|
className?: string;
|
|
260
499
|
variant?: "floating" | "inline";
|
|
261
|
-
}): React.
|
|
500
|
+
}): React.ReactNode;
|
|
262
501
|
import { AnnotationHandler as AnnotationHandler4, RawCode as RawCode3 } from "codehike/code";
|
|
263
502
|
interface DiffStats {
|
|
264
503
|
additions?: number;
|
|
@@ -283,16 +522,16 @@ interface ClientDiffCodeProps {
|
|
|
283
522
|
* DocKit code block variant with file change row header.
|
|
284
523
|
* Displays path/filename with diff stats, collapsible with syntax-highlighted code.
|
|
285
524
|
*/
|
|
286
|
-
declare function ClientDiffCode(props: ClientDiffCodeProps): React.
|
|
525
|
+
declare function ClientDiffCode(props: ClientDiffCodeProps): React.ReactNode;
|
|
287
526
|
declare function CodeIcon({ title, lang, className }: {
|
|
288
527
|
title: string;
|
|
289
528
|
lang: string;
|
|
290
529
|
className?: string;
|
|
291
|
-
}): React.
|
|
530
|
+
}): React.ReactNode;
|
|
292
531
|
import { RawCode as RawCode4 } from "codehike/code";
|
|
293
532
|
declare function DocsKitInlineCode({ codeblock }: {
|
|
294
533
|
codeblock: RawCode4;
|
|
295
|
-
}): Promise<React.
|
|
534
|
+
}): Promise<React.ReactNode>;
|
|
296
535
|
type PackageManager = "npm" | "bun" | "pnpm" | "yarn";
|
|
297
536
|
interface PackageInstallProps {
|
|
298
537
|
/** The package name to install */
|
|
@@ -316,38 +555,38 @@ interface PackageInstallProps {
|
|
|
316
555
|
* <PackageInstall package="opencode-ai" global />
|
|
317
556
|
* ```
|
|
318
557
|
*/
|
|
319
|
-
declare function PackageInstall({ package: pkg, dev, global: isGlobal, managers, copyButton }: PackageInstallProps): React.
|
|
558
|
+
declare function PackageInstall({ package: pkg, dev, global: isGlobal, managers, copyButton }: PackageInstallProps): React.ReactNode;
|
|
320
559
|
/**
|
|
321
560
|
* Loading skeleton for code blocks.
|
|
322
561
|
*/
|
|
323
562
|
declare function CodeBlockSkeleton({ hasTitle, lines }: {
|
|
324
563
|
hasTitle?: boolean;
|
|
325
564
|
lines?: number;
|
|
326
|
-
}): React.
|
|
565
|
+
}): React.ReactNode;
|
|
327
566
|
/**
|
|
328
567
|
* Loading skeleton for terminal-style code blocks.
|
|
329
568
|
*/
|
|
330
569
|
declare function TerminalSkeleton({ lines }: {
|
|
331
570
|
lines?: number;
|
|
332
|
-
}): React.
|
|
571
|
+
}): React.ReactNode;
|
|
333
572
|
/**
|
|
334
573
|
* Loading skeleton for inline code.
|
|
335
574
|
*/
|
|
336
|
-
declare function InlineCodeSkeleton(): React.
|
|
575
|
+
declare function InlineCodeSkeleton(): React.ReactNode;
|
|
337
576
|
/**
|
|
338
577
|
* Loading skeleton for code tabs.
|
|
339
578
|
*/
|
|
340
579
|
declare function CodeTabsSkeleton({ tabs, lines }: {
|
|
341
580
|
tabs?: number;
|
|
342
581
|
lines?: number;
|
|
343
|
-
}): React.
|
|
582
|
+
}): React.ReactNode;
|
|
344
583
|
import { RawCode as RawCode5 } from "codehike/code";
|
|
345
|
-
declare function CodeGroup(props: unknown): Promise<React.
|
|
584
|
+
declare function CodeGroup(props: unknown): Promise<React.ReactNode>;
|
|
346
585
|
declare function Code(props: {
|
|
347
586
|
codeblocks: RawCode5[];
|
|
348
587
|
flags?: string;
|
|
349
588
|
storage?: string;
|
|
350
|
-
}): Promise<React.
|
|
589
|
+
}): Promise<React.ReactNode>;
|
|
351
590
|
import { AnnotationHandler as AnnotationHandler5, RawCode as RawCode6 } from "codehike/code";
|
|
352
591
|
/**
|
|
353
592
|
* Terminal-style code block with macOS window controls.
|
|
@@ -366,24 +605,24 @@ import { AnnotationHandler as AnnotationHandler5, RawCode as RawCode6 } from "co
|
|
|
366
605
|
declare function Terminal(props: {
|
|
367
606
|
codeblock: RawCode6;
|
|
368
607
|
handlers?: AnnotationHandler5[];
|
|
369
|
-
}): Promise<React.
|
|
608
|
+
}): Promise<React.ReactNode>;
|
|
370
609
|
import { AnnotationHandler as AnnotationHandler6 } from "codehike/code";
|
|
371
|
-
declare const collapse: AnnotationHandler6[];
|
|
610
|
+
declare const collapse: readonly AnnotationHandler6[];
|
|
372
611
|
import { AnnotationHandler as AnnotationHandler7 } from "codehike/code";
|
|
373
612
|
declare const diff: AnnotationHandler7;
|
|
374
|
-
import
|
|
375
|
-
declare function addDocsKit<T extends Record<string,
|
|
613
|
+
import React10 from "react";
|
|
614
|
+
declare function addDocsKit<T extends Record<string, React10.ElementType | string>>(components: T): T;
|
|
376
615
|
import { AnnotationHandler as AnnotationHandler8 } from "codehike/code";
|
|
377
616
|
declare const expandable: AnnotationHandler8;
|
|
378
617
|
import { AnnotationHandler as AnnotationHandler9 } from "codehike/code";
|
|
379
|
-
import
|
|
618
|
+
import React11 from "react";
|
|
380
619
|
declare function WithHover(props: {
|
|
381
|
-
children:
|
|
382
|
-
}):
|
|
620
|
+
children: React11.ReactNode;
|
|
621
|
+
}): React11.ReactNode;
|
|
383
622
|
declare function HoverLink(props: {
|
|
384
623
|
href?: string;
|
|
385
|
-
children?:
|
|
386
|
-
}):
|
|
624
|
+
children?: React11.ReactNode;
|
|
625
|
+
}): React11.ReactNode;
|
|
387
626
|
declare const hover: AnnotationHandler9;
|
|
388
627
|
import { AnnotationHandler as AnnotationHandler10 } from "codehike/code";
|
|
389
628
|
declare const lineNumbers2: AnnotationHandler10;
|
|
@@ -393,45 +632,21 @@ import { AnnotationHandler as AnnotationHandler12 } from "codehike/code";
|
|
|
393
632
|
declare const mark: AnnotationHandler12;
|
|
394
633
|
declare function WithNotes({ children,...rest }: {
|
|
395
634
|
children: React.ReactNode;
|
|
396
|
-
}): React.
|
|
635
|
+
}): React.ReactNode;
|
|
397
636
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
398
|
-
import * as
|
|
399
|
-
declare function Tabs({ className,...props }:
|
|
400
|
-
declare function TabsList({ className,...props }:
|
|
401
|
-
declare function TabsTrigger({ className,...props }:
|
|
402
|
-
declare function TabsContent({ className,...props }:
|
|
637
|
+
import * as React12 from "react";
|
|
638
|
+
declare function Tabs({ className,...props }: React12.ComponentProps<typeof TabsPrimitive.Root>): React12.ReactNode;
|
|
639
|
+
declare function TabsList({ className,...props }: React12.ComponentProps<typeof TabsPrimitive.List>): React12.ReactNode;
|
|
640
|
+
declare function TabsTrigger({ className,...props }: React12.ComponentProps<typeof TabsPrimitive.Trigger>): React12.ReactNode;
|
|
641
|
+
declare function TabsContent({ className,...props }: React12.ComponentProps<typeof TabsPrimitive.Content>): React12.ReactNode;
|
|
403
642
|
import { AnnotationHandler as AnnotationHandler13 } from "codehike/code";
|
|
404
643
|
declare const tooltip: AnnotationHandler13;
|
|
405
644
|
declare function TooltipLink(props: {
|
|
406
645
|
href?: string;
|
|
407
646
|
children?: React.ReactNode;
|
|
408
|
-
}): React.
|
|
647
|
+
}): React.ReactNode;
|
|
409
648
|
import { AnnotationHandler as AnnotationHandler14 } from "codehike/code";
|
|
410
649
|
declare const wordWrap2: AnnotationHandler14;
|
|
411
|
-
import { ReactNode as ReactNode2 } from "react";
|
|
412
|
-
interface CodeTab {
|
|
413
|
-
/** Tab label */
|
|
414
|
-
label: string;
|
|
415
|
-
/** Tab content (code block) */
|
|
416
|
-
content: ReactNode2;
|
|
417
|
-
/** Raw code for copy button */
|
|
418
|
-
code: string;
|
|
419
|
-
}
|
|
420
|
-
interface CodeTabsProps {
|
|
421
|
-
/** Array of tabs */
|
|
422
|
-
tabs: CodeTab[];
|
|
423
|
-
/** Default selected tab index */
|
|
424
|
-
defaultIndex?: number;
|
|
425
|
-
/** Enable sticky positioning for the header */
|
|
426
|
-
sticky?: boolean;
|
|
427
|
-
/** Custom className */
|
|
428
|
-
className?: string;
|
|
429
|
-
}
|
|
430
|
-
/**
|
|
431
|
-
* Tabbed code block wrapper with copy button per tab.
|
|
432
|
-
* Uses docskit --dk-* CSS variables for consistent theming.
|
|
433
|
-
*/
|
|
434
|
-
declare function CodeTabs({ tabs, defaultIndex, sticky, className }: CodeTabsProps): React.ReactNode2;
|
|
435
650
|
interface ImportSectionProps {
|
|
436
651
|
/** Import statement text */
|
|
437
652
|
importStatement: string;
|
|
@@ -443,17 +658,14 @@ interface ImportSectionProps {
|
|
|
443
658
|
* Monospace styling with copy button.
|
|
444
659
|
*/
|
|
445
660
|
declare function ImportSection({ importStatement, className }: ImportSectionProps): React.ReactNode;
|
|
446
|
-
import * as
|
|
661
|
+
import * as React13 from "react";
|
|
447
662
|
type TypeColor = "string" | "number" | "boolean" | "null" | "undefined" | "object" | "array" | "function" | "union" | "generic" | "default";
|
|
448
663
|
/**
|
|
449
664
|
* Type coloring for syntax display.
|
|
450
665
|
* Follows Stripe-style: consistent colors for primitives vs complex types.
|
|
451
666
|
*/
|
|
452
|
-
declare const typeBadgeVariants:
|
|
453
|
-
|
|
454
|
-
className?: string;
|
|
455
|
-
}) => string;
|
|
456
|
-
interface TypeBadgeProps extends React14.HTMLAttributes<HTMLSpanElement> {
|
|
667
|
+
declare const typeBadgeVariants: unknown;
|
|
668
|
+
interface TypeBadgeProps extends React13.HTMLAttributes<HTMLSpanElement> {
|
|
457
669
|
/** Type string to display */
|
|
458
670
|
type: string;
|
|
459
671
|
/** Override color detection */
|
|
@@ -463,5 +675,5 @@ interface TypeBadgeProps extends React14.HTMLAttributes<HTMLSpanElement> {
|
|
|
463
675
|
* Inline type display with syntax coloring.
|
|
464
676
|
* Automatically detects type category and applies appropriate color.
|
|
465
677
|
*/
|
|
466
|
-
declare const TypeBadge:
|
|
467
|
-
export { wordWrap2 as wordWrap, typeBadgeVariants, tooltip, toCodeGroup, theme, mark, link, lineNumbers2 as lineNumbers, hover, flagsToOptions, expandable, endpointBadgeVariants, diff, collapse, callout, addDocsKit, WithNotes, WithHover, TypeColor, TypeBadgeProps, TypeBadge, TooltipLink, TerminalSkeleton, Terminal, TabsTrigger, TabsList, TabsContent, Tabs, SingleCode, ResponseBlockProps, ResponseBlock, ParameterListProps, ParameterList, PackageInstall, MultiCode, LanguageSelectorProps, LanguageSelector, Language, InlineCodeSkeleton, ImportSectionProps, ImportSection, HttpMethod, HoverLink, EndpointHeaderProps, EndpointHeader, EndpointBadgeProps, EndpointBadge, DocsKitInlineCode, DocsKitCode, DiffStats, CopyButton,
|
|
678
|
+
declare const TypeBadge: React13.ForwardRefExoticComponent<TypeBadgeProps & React13.RefAttributes<HTMLSpanElement>>;
|
|
679
|
+
export { wordWrap2 as wordWrap, useSyncSection, useSyncScroll, typeBadgeVariants, tooltip, toCodeGroup, theme, mark, link, lineNumbers2 as lineNumbers, hover, flagsToOptions, expandable, endpointBadgeVariants, diff, collapse, callout, addDocsKit, WithNotes, WithHover, TypeColor, TypeBadgeProps, TypeBadge, TooltipLink, TerminalSkeleton, Terminal, TabsTrigger, TabsList, TabsContent, Tabs, SyncScrollProviderProps, SyncScrollProvider, SyncScrollContextValue, SingleCode, ResponseBlockProps, ResponseBlock, ParameterListProps, ParameterList, PackageInstall, NestedParameterToggleProps, NestedParameterToggle, NestedParameterContainerProps, NestedParameterContainer, MultiCode, MethodSectionProps, MethodSection, LanguageSelectorProps, LanguageSelector, Language, InlineCodeSkeleton, ImportSectionProps, ImportSection, HttpMethod, HoverLink, ExpandableParameterProps, ExpandableParameter, ExampleSectionProps, CodeExample2 as ExampleSectionCodeExample, ExampleSection, ExampleChipsProps, ExampleChips, ExampleChip, EnumValuesSectionProps, EnumValuesSection, EnumValue, EndpointHeaderProps, EndpointHeader, EndpointBadgeProps, EndpointBadge, DocsKitInlineCode, DocsKitCode, DiffStats, CopyButton, CollapsiblePanelProps, CollapsiblePanel, CodeTabsSkeleton, CodeInfo, CodeIcon, CodeGroup, CodeExample, CodeBlockSkeleton, CodeBlockProps, CodeBlock, Code, ClientTerminal, ClientInlineCode, ClientDocsKitCode, ClientDiffCodeProps, ClientDiffCode, ClientCode, APISectionProps, APISection, APIReferencePageProps, APIReferencePage, APIReferenceLayoutProps, APIReferenceLayout, APIParameterSchema, APIParameterItemProps, APIParameterItem, APICodePanelProps, APICodePanel };
|