import { QuerySize } from "./constants"; /** * The current size for your application. This should work both server side and * client side, but you will have much better results client side. */ export interface AppSize { /** * Boolean if currently matching a phone by comparing the max width of the * device. */ isPhone: boolean; /** * Boolean if currently matching a tablet by comparing the max width of the * device. */ isTablet: boolean; /** * Boolean if currently matching a desktop screen by comparing the max width * of the device. */ isDesktop: boolean; /** * Boolean if currently matching a large desktop screen by comparing the max * width of the device. */ isLargeDesktop: boolean; /** * Boolean if the app is considered to be in landscape mode. This will just * verify that the window width is greater than the window height. * * NOTE: This might not be super accurate on Android devices since the soft * keyboard will change the dimensions of the viewport when it appears. It is * recommended to use the `useOrientation` hook as well if you'd like to get * the current orientation type. */ isLandscape: boolean; } export declare const DEFAULT_APP_SIZE: AppSize; export interface AppSizeOptions { /** * The max width to use for phones. This one is a max width unline the others * since everything from 0 to this value will be considered a phone. */ phoneMaxWidth?: QuerySize; /** * The min width for a tablet device. */ tabletMinWidth?: QuerySize; /** * The max width for a tablet device. This should normally be `1px` less than * the `desktopMinWidth`, but it can be any value if needed. The tablet has a * range of min to max so that you can have a bit more control. */ tabletMaxWidth?: QuerySize; /** * The min width for a desktop screen. */ desktopMinWidth?: QuerySize; /** * The min width for a large desktop screen. */ desktopLargeMinWidth?: QuerySize; /** * An optional default size to use for your app. This is really only helpful * when trying to do server side rendering or initial page render since the * default behavior is to check and update the size once mounted in the DOM. */ defaultSize?: AppSize; } /** * This hook is used to determine the current application size based on the * provided query sizes. When you want to render your app server side, you will * need to provide a custom `defaultSize` that implements your logic to * determine the type of device requesting a page. Once the app has been * rendered in the DOM, this hook will attach event listeners to automatically * update the app size when the page is resized. * * @private */ export default function useAppSizeMedia({ phoneMaxWidth, tabletMinWidth, tabletMaxWidth, desktopMinWidth, desktopLargeMinWidth, defaultSize, }?: AppSizeOptions): AppSize;