@mintlify/validation 0.1.585 → 0.1.586

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.
@@ -1,11 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { Division } from '../reusable/divisions.js';
3
+ import { DecoratedPageConfig } from '../reusable/page.js';
3
4
  import { BaseAnchorSchema } from './anchors.js';
4
5
  import { BaseDropdownSchema } from './dropdown.js';
5
- import { GroupsConfig, DecoratedGroupsConfig } from './groups.js';
6
+ import { BaseGroupSchema } from './groups.js';
6
7
  import { BaseLanguageSchema } from './languages.js';
7
8
  import { BaseMenuItemSchema } from './menu.js';
8
- import { PagesConfig, DecoratedPagesConfig } from './pages.js';
9
9
  import { BaseProductSchema } from './products.js';
10
10
  import { BaseTabSchema } from './tabs.js';
11
11
  import { BaseVersionSchema } from './version.js';
@@ -79,9 +79,9 @@ type BaseNavigation<T extends NavigationType, K extends Division> = {
79
79
  } | {
80
80
  menu: K extends ExcludedDivisions['menu'] ? never : MenuItemNavigation<T>[];
81
81
  } | {
82
- groups: T extends 'default' ? GroupsConfig : DecoratedGroupsConfig;
82
+ groups: T extends 'default' ? GroupNavigation<'default'>[] : GroupNavigation<'decorated'>[];
83
83
  } | {
84
- pages: T extends 'default' ? PagesConfig : DecoratedPagesConfig;
84
+ pages: T extends 'default' ? PageOrGroupNavigation<'default'>[] : PageOrGroupNavigation<'decorated'>[];
85
85
  } | {
86
86
  href: string;
87
87
  };
@@ -112,4 +112,12 @@ export type GlobalNavigation = {
112
112
  href: string;
113
113
  })[];
114
114
  };
115
+ export type PageNavigation<T extends NavigationType> = T extends 'default' ? string : DecoratedPageConfig;
116
+ export type PageOrGroupNavigation<T extends NavigationType> = T extends 'default' ? PageNavigation<'default'> | GroupNavigation<'default'> : PageNavigation<'decorated'> | GroupNavigation<'decorated'>;
117
+ export type GroupNavigation<T extends NavigationType> = T extends 'default' ? BaseGroupSchema & z.infer<typeof SomeApiSchema> & {
118
+ pages?: PageOrGroupNavigation<'default'>[];
119
+ } : Omit<BaseGroupSchema, 'root'> & {
120
+ pages: PageOrGroupNavigation<'decorated'>[];
121
+ root?: DecoratedPageConfig;
122
+ };
115
123
  export {};