diff --git a/src/theme/DocRoot/Layout/Sidebar/index.tsx b/src/theme/DocRoot/Layout/Sidebar/index.tsx index d8e3421d94..249d60f3ba 100644 --- a/src/theme/DocRoot/Layout/Sidebar/index.tsx +++ b/src/theme/DocRoot/Layout/Sidebar/index.tsx @@ -127,7 +127,8 @@ const CustomSearch = () => { } // Wrapper component combining Sidebar with CustomSearch -const SidebarWrapper = (props) => { +const SidebarWrapper = (props: SidebarConfig) => { + console.log({props}) return (
diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 70409a081b..2200871fba 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -22,7 +22,7 @@ type MoreFeatures = { type Social = { id: number name: string - image?: React.FunctionComponent> + image?: FunctionComponent> | undefined href: string } @@ -83,3 +83,35 @@ type RadioOptions = { name: string value: string } + +type SidebarLink = { + type: "link" + label: string + href: string + docId: string + unlisted: boolean +} + +type SidebarCategory = { + type: "category" + label: string + collapsible: boolean + collapsed: boolean + items: SidebarLink[] +} + +type SidebarItem = { + type: "category" | "link" + label: string + collapsible?: boolean + collapsed?: boolean + items?: SidebarLink[] + href?: string + docId?: string + unlisted?: boolean +} + +type SidebarConfig = { + sidebar: SidebarItem[] + hiddenSidebarContainer: boolean +} diff --git a/tsconfig.json b/tsconfig.json index 04fc7ab04a..e0c08d9753 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,5 +4,13 @@ "compilerOptions": { "jsx": "react", "baseUrl": ".", + "strict": true, // Enable all strict type checking options + "noImplicitAny": true, // Raise error on expressions and declarations with an implied 'any' type + "strictNullChecks": true, // When type checking, take into account 'null' and 'undefined' + "strictFunctionTypes": true, // Ensure function parameter and return type matching is more accurate + "strictBindCallApply": true, // Enable stricter checking of the 'bind', 'call', and 'apply' methods + "strictPropertyInitialization": true, // Ensure class properties are initialized in the constructor + "noImplicitThis": true, // Raise error on 'this' expressions with an implied 'any' type + "alwaysStrict": true, // Parse in strict mode and emit "use strict" for each source file }, }