xref: /expo/docs/types/common.ts (revision ca5a2fa2)
1export type PageMetadata = {
2  title?: string;
3  sourceCodeUrl?: string;
4  packageName?: string;
5  maxHeadingDepth?: number;
6  /* If the page should not show up in the Algolia Docsearch results */
7  hideFromSearch?: boolean;
8  hideTOC?: boolean;
9};
10
11/**
12 * A single header from the `remark-export-headings` plugin.
13 */
14export type RemarkHeading = {
15  id?: string;
16  depth: number;
17  title: string;
18  type: string;
19};
20
21/**
22 * Utility type. Extracts `T` type from `T[]` array.
23 */
24export type ElementType<T extends any[]> = T extends (infer U)[] ? U : never;
25
26export type Url = {
27  pathname: string;
28};
29
30export type NavigationType = 'section' | 'group' | 'page';
31
32export type NavigationRoute = {
33  type: NavigationType;
34  name: string;
35  href: string;
36  as?: string;
37  hidden?: boolean;
38  expanded?: boolean;
39  sidebarTitle?: string;
40  weight?: number;
41  children?: NavigationRoute[];
42};
43