@bigbinary/neeto-commons-frontend 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,87 @@
1
+ import { AvatarProps } from "@bigbinary/neetoui";
2
+ import {
3
+ LinkType,
4
+ NavLinkItemType,
5
+ SidebarProps,
6
+ } from "@bigbinary/neetoui/layouts";
7
+ import React from "react";
8
+ import { ObjectAndPrimitives } from "./pure";
9
+
10
+ export const HoneybadgerErrorBoundary: React.FC<{
11
+ ErrorComponent?: React.ReactNode;
12
+ }>;
13
+ export function PrivateRoute<Component extends JSX.Element>(
14
+ props: {
15
+ component: Component;
16
+ condition: boolean;
17
+ path: string;
18
+ redirectRoute: string;
19
+ } & { [key in keyof Component]: Component[key] }
20
+ ): JSX.Element;
21
+ export const Sidebar: React.FC<{
22
+ navLinks: NavLinkItemType[];
23
+ appName: string;
24
+ profileInfoOverrides?: {
25
+ name?: string;
26
+ email?: string;
27
+ topLinks?: LinkType[];
28
+ bottomLinks?: LinkType[];
29
+ customContent?: React.ReactNode;
30
+ changelogProps?: LinkType;
31
+ helpProps?: LinkType;
32
+ "data-cy"?: string;
33
+ } & AvatarProps;
34
+ organizationInfoOverrides?: {
35
+ logo?: React.ReactNode;
36
+ name?: React.ReactNode;
37
+ subdomain?: React.ReactNode;
38
+ };
39
+ extraTopLinks?: LinkType[];
40
+ showAppSwitcher?: boolean;
41
+ }>;
42
+
43
+ export function useDebounce<T>(value: T, delay?: number): T;
44
+ export function useFuncDebounce<A, B, C, D, E>(
45
+ func: (a?: A, b?: B, c?: C, d?: D, ...e: E[]) => any,
46
+ delay?: number
47
+ ): (a?: A, b?: B, c?: C, d?: D, ...e: E[]) => void;
48
+ export function useLocalStorage<T>(
49
+ key: string,
50
+ initialValue?: T
51
+ ): [T, (value: T) => void];
52
+ export function useOnClickOutside<T>(
53
+ ref: React.MutableRefObject<T>,
54
+ handler: (event: MouseEvent | TouchEvent) => any
55
+ );
56
+ export function usePrevious<T>(value: T): T;
57
+ export function useUpdateEffect(effect: () => void, deps: any[]): void;
58
+
59
+ export function createContext<T>(initialValue: T): {
60
+ Provider: React.FC<{}>;
61
+ useState: T;
62
+ useSetState: React.Dispatch<React.SetStateAction<T>>;
63
+ useContext: [T, React.Dispatch<React.SetStateAction<T>>];
64
+ };
65
+ type ActionType<T> = {
66
+ type: string;
67
+ payload: Partial<T> | ObjectAndPrimitives;
68
+ };
69
+ export function createContext<T>(
70
+ initialValue: T,
71
+ reducer: (prevState: T, action: ActionType<T>) => T
72
+ ): {
73
+ Provider: React.FC<{}>;
74
+ useState: T;
75
+ useDispatch: (action: ActionType<T>) => void;
76
+ useContext: [T, (action: ActionType<T>) => void];
77
+ };
78
+
79
+ export const ErrorPage: React.FC<{}>;
80
+ export const LoginPage: React.FC<{
81
+ handleSubmit: (data: {
82
+ user: {
83
+ email: string;
84
+ password: string;
85
+ };
86
+ }) => any;
87
+ }>;