trendmicro-frontend / react-sidenav

React SideNav component
https://trendmicro-frontend.github.io/react-sidenav/
MIT License
349 stars 105 forks source link

typing support #87

Open KM8Oz opened 1 year ago

KM8Oz commented 1 year ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @trendmicro/react-sidenav@0.5.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@trendmicro/react-sidenav/index.d.ts b/node_modules/@trendmicro/react-sidenav/lib/index.d.ts
new file mode 100644
index 0000000..90d979b
--- /dev/null
+++ b/node_modules/@trendmicro/react-sidenav/lib/index.d.ts
@@ -0,0 +1,35 @@
+import * as React from 'react';
+
+export interface ToggleProps {
+    expanded: boolean;
+    onToggle: (expanded: boolean) => void;
+}
+export interface SideNavProps {
+    onToggle: (expanded: boolean) => void;
+    expanded: boolean;
+    className?: string;
+    style?: React.CSSProperties;
+}
+export interface NavItemProps {
+    onClick?: () => void;
+    className?: string;
+    style?: React.CSSProperties;
+}
+export interface NavIconProps {
+    className?: string;
+    style?: React.CSSProperties;
+}
+export interface NavProps {
+    className?: string;
+    style?: React.CSSProperties;
+}
+export interface NavTextProps {
+    className?: string;
+    style?: React.CSSProperties;
+}
+export default class SideNav extends React.Component<SideNavProps> { }
+export class NavText extends React.Component<NavTextProps> { }
+export class Nav extends React.Component<NavProps> { }
+export class NavIcon extends React.Component<NavIconProps> { }
+export class NavItem extends React.Component<NavItemProps> { }
+export class Toggle extends React.Component<ToggleProps> { }
diff --git a/node_modules/@trendmicro/react-sidenav/yarn.lock b/node_modules/@trendmicro/react-sidenav/yarn.lock
new file mode 100644
index 0000000..e69de29

This issue body was partially generated by patch-package.

ghanshyam253 commented 1 year ago

Hi, Could you please share complete index.d.ts file.