From da7f62426f1760c1c77e0973c16aa9290bbe6ceb Mon Sep 17 00:00:00 2001 From: Dave MacFarlane Date: Mon, 13 Nov 2023 11:19:34 -0500 Subject: [PATCH] [Typescript] Add Breadcrumb.d.ts file Add typescript type definition for Breadcrumbs, so that it can be type checked. --- jsx/Breadcrumbs.d.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 jsx/Breadcrumbs.d.ts diff --git a/jsx/Breadcrumbs.d.ts b/jsx/Breadcrumbs.d.ts new file mode 100644 index 00000000000..ba7ac8c568b --- /dev/null +++ b/jsx/Breadcrumbs.d.ts @@ -0,0 +1,26 @@ +import React from 'react'; + +type breadcrumb = { + text: string + onClick?: (e: React.MouseEvent) => void +} + +type breadcrumbProps = { + baseURL: string, + breadcrumbs: breadcrumb[], +}; + + +class Breadcrumbs { + props: breadcrumbProps + state: {displayCount: number} + context: object + refs: {[key: string]: ReactInstance} + + constructor(props: breadcrumbProps) + render(): ReactNode + setState(newprops: object): void + forceUpdate(): void +} + +export default Breadcrumbs;