-
Notifications
You must be signed in to change notification settings - Fork 2
/
types.d.ts
100 lines (83 loc) · 2.27 KB
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
declare module "@nice-digital/global-nav" {
import React = require("react");
export type AutoCompleteSuggestion = {
Title: string;
TypeAheadType?: string;
TitleHtml?: string;
Link: string;
};
export type OnSearchingCallback = (args: { query: string }) => void;
export type OnResizeCallback = () => void;
export type AutoCompleteSuggestions =
| false
| string
| AutoCompleteSuggestion[];
export type AutoCompleteOptions = {
suggestions: AutoCompleteSuggestions;
suggestionTemplate: (suggestion: AutoCompleteSuggestion) => string;
};
export type SearchProps = {
url?: string;
autocomplete?: AutoCompleteSuggestions | AutoCompleteOptions;
placeholder?: string;
query?: string;
onSearching?: string | OnSearchingCallback;
onResize?: string | OnResizeCallback;
};
export type Service =
| "guidance"
| "standards-and-indicators"
| "evidence"
| "bnf"
| "bnfc"
| "cks"
| "journals";
export type Link = {
text: string;
url: string;
};
export type OnNavigatingCallback = (e: {
element: HTMLAnchorElement;
href: string;
}) => void;
export type IdamProviderProps = {
provider: "idam";
links: Array<Link>;
displayName?: string;
};
export type NiceAccountsProviderProps = {
provider: "niceAccounts";
environment?: "live" | "beta" | "test" | "local";
};
export type AdditionalSubMenuItem = {
service: string;
links: Array<Link>;
};
export type HeaderProps = {
service?: Service;
skipLinkId?: string;
search?: false | SearchProps;
auth?: NiceAccountsProviderProps | IdamProviderProps | false;
onDropdownOpen?: string | (() => void);
onDropdownClose?: string | (() => void);
onNavigating?: string | OnNavigatingCallback;
additionalSubMenuItems?: Array<AdditionalSubMenuItem>;
renderSearchOnly?: boolean;
};
export type FooterProps = {
service?: Service;
};
export interface MainProps {
/** Allow any additional props to be passed and applied to the main element */
[prop: string]: unknown;
/** Contents for the main element */
children: React.ReactNode;
/** Additional classnames for the main element. */
className?: string;
withPadding?: boolean;
}
const Header: React.FC<HeaderProps>;
const Footer: React.FC<FooterProps>;
const Main: React.FC<MainProps>;
export { Header, Footer, Main };
}