xref: /expo/docs/types/common.ts (revision 97eb3c27)
1export type PageMetadata = {
2  title?: string;
3  description?: string;
4  sourceCodeUrl?: string;
5  packageName?: string;
6  maxHeadingDepth?: number;
7  iconUrl?: string;
8  /* If the page should not show up in the Algolia Docsearch results */
9  hideFromSearch?: boolean;
10  hideTOC?: boolean;
11};
12
13/**
14 * A single header from the `remark-export-headings` plugin.
15 */
16export type RemarkHeading = {
17  id?: string;
18  depth: number;
19  title: string;
20  type: string;
21};
22
23/**
24 * Utility type. Extracts `T` type from `T[]` array.
25 */
26export type ElementType<T extends any[]> = T extends (infer U)[] ? U : never;
27
28export type Url = {
29  pathname: string;
30};
31
32export type NavigationType = 'section' | 'group' | 'page';
33
34export type NavigationRoute = {
35  type: NavigationType;
36  name: string;
37  href: string;
38  as?: string;
39  hidden?: boolean;
40  expanded?: boolean;
41  sidebarTitle?: string;
42  weight?: number;
43  children?: NavigationRoute[];
44};
45
46/**
47 * Available platforms supported by our APIs.
48 * Temporarily it also accepts other strings for compatibility reasons.
49 */
50export type PlatformName = 'ios' | 'android' | 'web' | 'expo' | string;
51