UNPKG

@kietpt2003/react-native-core-ui

Version:
141 lines 5.07 kB
export declare const width: number, height: number; /** * Just a constants that specify iPhone 12 width. * * *Example:* * * ```js * import { IPHONE_12_WIDTH } from '@kietpt2003/react-native-core-ui/utils'; * console.log(IPHONE_12_WIDTH); // 375 * ``` * * To get more information. Please see the [Documentation](https://github.com/kietpt2003/react-native-core-ui?tab=readme-ov-file#scaling-function) * * @see: https://github.com/kietpt2003/react-native-core-ui?tab=readme-ov-file#scaling-function */ export declare const IPHONE_12_WIDTH = 375; /** * Just a constants that specify iPhone 12 height. * * *Example:* * * ```js * import { IPHONE_12_HEIGTH } from '@kietpt2003/react-native-core-ui/utils'; * console.log(IPHONE_12_HEIGTH); // 812 * ``` * * To get more information. Please see the [Documentation](https://github.com/kietpt2003/react-native-core-ui?tab=readme-ov-file#scaling-function) * * @see: https://github.com/kietpt2003/react-native-core-ui?tab=readme-ov-file#scaling-function */ export declare const IPHONE_12_HEIGTH = 812; export declare const scaleWidth: number; export declare const scaleHeight: number; export declare const scaleAvg: number; /** * Will return a linear scaled result of the provided size, based on scaleAvg. Use for scaling font. * * *Example:* * ```jsx * import { scaleFont } from '@kietpt2003/react-native-core-ui/utils'; * import { StyleSheet } from 'react-native'; * * const styles = StyleSheet.create({ * text: { * fontSize: scaleFont(16), // fontSize._16 * }, * }); * ``` * * To get more information. Please see the [Documentation](https://github.com/kietpt2003/react-native-core-ui?tab=readme-ov-file#scaling-function) * * @see: https://github.com/kietpt2003/react-native-core-ui?tab=readme-ov-file#scaling-function */ export declare const scaleFont: (size: number) => number; /** * Will return a linear scaled result of the provided size, based on your device's screen width. * * *Example:* * ```jsx * import { scale } from '@kietpt2003/react-native-core-ui/utils'; * import { StyleSheet } from 'react-native'; * * const styles = StyleSheet.create({ * container: { * padding: scale(5), * }, * }); * ``` * * To get more information. Please see the [Documentation](https://github.com/kietpt2003/react-native-core-ui?tab=readme-ov-file#scaling-function) * * @see: https://github.com/kietpt2003/react-native-core-ui?tab=readme-ov-file#scaling-function */ export declare const scale: (size: number) => number; /** * Will return a linear scaled result of the provided size, based on your device's screen height. * * *Example:* * ```jsx * import { scaleH } from '@kietpt2003/react-native-core-ui/utils'; * import { StyleSheet } from 'react-native'; * * const styles = StyleSheet.create({ * container: { * position: 'absolute', * top: scaleH(5), * }, * }); * ``` * * To get more information. Please see the [Documentation](https://github.com/kietpt2003/react-native-core-ui?tab=readme-ov-file#scaling-function) * * @see: https://github.com/kietpt2003/react-native-core-ui?tab=readme-ov-file#scaling-function */ export declare const scaleH: (size: number) => number; /** * Sometimes you don't want to scale everything in a linear manner, that's where moderateScale comes in. * The cool thing about it is that you can control the resize factor (default is 0.5). * If normal scale will increase your size by +2X, moderateScale will only increase it by +X, for example: * ➡️   scale(10) = 20 * ➡️   moderateScale(10) = 15 * ➡️   moderateScale(10, 0.1) = 11 * * *Example:* * ```jsx * import { moderateScale } from '@kietpt2003/react-native-core-ui/utils'; * import { StyleSheet } from 'react-native'; * * const styles = StyleSheet.create({ * container: { * padding: moderateScale(5), * }, * }); * ``` * * To get more information. Please see the [Documentation](https://github.com/kietpt2003/react-native-core-ui?tab=readme-ov-file#scaling-function) * * @see: https://github.com/kietpt2003/react-native-core-ui?tab=readme-ov-file#scaling-function */ export declare const moderateScale: (size: number, factor?: number) => number; /** * Same as moderateScale, but using scaleH instead of scale. * * *Example:* * ```jsx * import { moderateHeightScale } from '@kietpt2003/react-native-core-ui/utils'; * import { StyleSheet } from 'react-native'; * * const styles = StyleSheet.create({ * container: { * padding: moderateHeightScale(5), * }, * }); * ``` * * To get more information. Please see the [Documentation](https://github.com/kietpt2003/react-native-core-ui?tab=readme-ov-file#scaling-function) * * @see: https://github.com/kietpt2003/react-native-core-ui?tab=readme-ov-file#scaling-function */ export declare const moderateHeightScale: (size: number, factor?: number) => number; //# sourceMappingURL=scale.d.ts.map