All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.initializers.d.ts Maven / Gradle / Ivy

Go to download

A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.

There is a newer version: 4.12.3
Show newest version
type Skippable = boolean | Partial;
type Configurations = {
  translationResources?: {
    en: {
      translation: object;
    };
  };
  skip?: Partial<{
    globalProps: boolean;
    i18n: boolean;
    logger: boolean;
    mixpanel: boolean;
    dayjs: boolean;
    timezone: boolean;
    axios: Skippable<{
      baseURL: boolean;
      authHeaders: boolean;
      interceptors: Skippable<{
        request: Skippable<{
          cleanCredentialsForCrossOrigin: boolean;
          transformCase: boolean;
        }>;
        response: Skippable<{
          transformCase: boolean;
          showToastr: boolean;
          pullDataFromResponse: boolean;
          show404ErrorPage: boolean;
          logoutOn401: boolean;
        }>;
      }>;
    }>;
  }>;
};
type GlobalPropsType = {
  railsEnv: string;
  honeybadgerApiKey: string;
  organization: {
    name: string;
    subdomain: string;
    faviconUrl: string;
    [key: string]: any;
  };
  user?: {
    id: string;
    email: string;
    lastName: string;
    firstName: string;
    profileImageUrl: string;
    active: boolean;
    authenticationToken: string;
    [key: string]: any;
  };
  authenticated: boolean;
  mixpanelProjectToken: string;
  permissions: string[];
  endUserUploadedFileSizeLimitInMb: number;
  [key: string]: any;
};
type TaxonomiesType = {
  [key: string]: {
    singular: string;
    plural: string;
  };
};
export default function initializeApplication(configurations: Configurations): void;
export const globalProps: GlobalPropsType;
export const taxonomies: TaxonomiesType;

/** @deprecated use useDisplayErrorPage from react-utils bundle */
/**
 *
 * The useDisplayErrorPage hook is a utility that allows you to conditionally
 *
 * render an error page in your application based on the status codes of API
 *
 * responses.
 *
 * The following code snippet demonstrates the usage of useDisplayErrorPage in
 *
 * conditionally rendering an error page.
 *
 * @example 
 *
 * import { useDisplayErrorPage } from "@bigbinary/neeto-commons-frontend/react-utils";
 * 
 * const App = () => {
 *   const isError = useDisplayErrorPage();
 * 
 *   if (isError) {
 *     return ;
 *   }
 * 
 *   return 
; * }; * @endexample */ export function useDisplayErrorPage(): Boolean;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy