@openpkg-ts/doc-generator 0.1.2 → 0.2.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.
@@ -503,33 +503,34 @@ interface APIPageProps {
503
503
  spec?: OpenPkg7;
504
504
  /** Or docs instance from createDocs() */
505
505
  instance?: DocsInstance;
506
- /** Export ID to render */
507
- id: string;
506
+ /** Export ID to render, or undefined for index page */
507
+ id?: string;
508
+ /** Base href for index page links (required when id is undefined) */
509
+ baseHref?: string;
510
+ /** Description for index page */
511
+ description?: string;
508
512
  /** Custom code example renderer */
509
513
  renderExample?: (code: string, filename: string) => React.ReactNode;
510
514
  }
511
515
  /**
512
- * Main styled API page component that renders documentation for a single export.
516
+ * Main styled API page component that renders documentation.
517
+ *
518
+ * Renders either:
519
+ * - Index page (when id is undefined) showing all exports in a grid
520
+ * - Detail page (when id is provided) showing specific docs
513
521
  *
514
522
  * @example
515
523
  * ```tsx
516
- * import { APIPage } from '@openpkg-ts/doc-generator/react/styled'
517
- * import spec from './openpkg.json'
518
- *
519
- * <APIPage spec={spec} id="createClient" />
524
+ * // Index mode - show all exports
525
+ * <APIPage spec={spec} baseHref="/docs/api" />
520
526
  * ```
521
527
  *
522
528
  * @example
523
529
  * ```tsx
524
- * // With docs instance
525
- * import { APIPage } from '@openpkg-ts/doc-generator/react/styled'
526
- * import { createDocs } from '@openpkg-ts/doc-generator'
527
- *
528
- * const docs = createDocs('./openpkg.json')
529
- * <APIPage instance={docs} id="createClient" />
530
+ * // Detail mode - show specific * <APIPage spec={spec} id="createClient" />
530
531
  * ```
531
532
  */
532
- declare function APIPage({ spec, instance, id, renderExample }: APIPageProps): React.ReactNode;
533
+ declare function APIPage({ spec, instance, id, baseHref, description, renderExample }: APIPageProps): React.ReactNode;
533
534
  import { OpenPkg as OpenPkg8, SpecExport as SpecExport4 } from "@openpkg-ts/spec";
534
535
  interface ClassPageProps {
535
536
  export: SpecExport4;
@@ -552,21 +553,23 @@ interface EnumPageProps {
552
553
  * Styled enum page component with Tailwind.
553
554
  */
554
555
  declare function EnumPage({ export: exp, spec, renderExample }: EnumPageProps): React.ReactNode;
555
- import { OpenPkg as OpenPkg10, SpecExport as SpecExport6 } from "@openpkg-ts/spec";
556
+ import { OpenPkg as OpenPkg11, SpecExport as SpecExport6 } from "@openpkg-ts/spec";
557
+ import { ReactNode as ReactNode4 } from "react";
556
558
  interface FunctionPageProps {
557
559
  export: SpecExport6;
558
- spec: OpenPkg10;
560
+ spec: OpenPkg11;
559
561
  /** Custom code example renderer */
560
- renderExample?: (code: string, filename: string) => React.ReactNode;
562
+ renderExample?: (code: string, filename: string) => ReactNode4;
561
563
  }
562
564
  /**
563
- * Styled function page component with Tailwind.
565
+ * AI SDK-style function page with two-column layout.
566
+ * Left: parameters, returns. Right: sticky code examples.
564
567
  */
565
- declare function FunctionPage({ export: exp, spec, renderExample }: FunctionPageProps): React.ReactNode;
566
- import { OpenPkg as OpenPkg11, SpecExport as SpecExport7 } from "@openpkg-ts/spec";
568
+ declare function FunctionPage({ export: exp, spec, renderExample }: FunctionPageProps): ReactNode4;
569
+ import { OpenPkg as OpenPkg12, SpecExport as SpecExport7 } from "@openpkg-ts/spec";
567
570
  interface InterfacePageProps {
568
571
  export: SpecExport7;
569
- spec: OpenPkg11;
572
+ spec: OpenPkg12;
570
573
  /** Custom code example renderer */
571
574
  renderExample?: (code: string, filename: string) => React.ReactNode;
572
575
  }
@@ -574,10 +577,10 @@ interface InterfacePageProps {
574
577
  * Styled interface/type page component with Tailwind.
575
578
  */
576
579
  declare function InterfacePage({ export: exp, spec, renderExample }: InterfacePageProps): React.ReactNode;
577
- import { OpenPkg as OpenPkg12, SpecExport as SpecExport8 } from "@openpkg-ts/spec";
580
+ import { OpenPkg as OpenPkg13, SpecExport as SpecExport8 } from "@openpkg-ts/spec";
578
581
  interface VariablePageProps {
579
582
  export: SpecExport8;
580
- spec: OpenPkg12;
583
+ spec: OpenPkg13;
581
584
  /** Custom code example renderer */
582
585
  renderExample?: (code: string, filename: string) => React.ReactNode;
583
586
  }