{"id":18782885,"url":"https://github.com/rescript-react-native/device-info","last_synced_at":"2025-04-13T12:09:01.862Z","repository":{"id":40715463,"uuid":"206008877","full_name":"rescript-react-native/device-info","owner":"rescript-react-native","description":"ReScript bindings for react-native-device-info","archived":false,"fork":false,"pushed_at":"2023-02-09T07:13:55.000Z","size":834,"stargazers_count":7,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-13T12:08:57.281Z","etag":null,"topics":["react","react-native","rescript","rescript-react","rescript-react-native"],"latest_commit_sha":null,"homepage":"","language":"ReScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rescript-react-native.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["MoOx"]}},"created_at":"2019-09-03T06:52:42.000Z","updated_at":"2024-02-20T00:54:29.000Z","dependencies_parsed_at":"2024-11-07T20:50:41.125Z","dependency_job_id":null,"html_url":"https://github.com/rescript-react-native/device-info","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-react-native%2Fdevice-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-react-native%2Fdevice-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-react-native%2Fdevice-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-react-native%2Fdevice-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rescript-react-native","download_url":"https://codeload.github.com/rescript-react-native/device-info/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710433,"owners_count":21149190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react","react-native","rescript","rescript-react","rescript-react-native"],"created_at":"2024-11-07T20:37:23.139Z","updated_at":"2025-04-13T12:09:01.842Z","avatar_url":"https://github.com/rescript-react-native.png","language":"ReScript","funding_links":["https://github.com/sponsors/MoOx"],"categories":[],"sub_categories":[],"readme":"# `@rescript-react-native/device-info`\n\n[![Build Status](https://github.com/rescript-react-native/device-info/workflows/Build/badge.svg)](https://github.com/rescript-react-native/device-info/actions)\n[![Version](https://img.shields.io/npm/v/@rescript-react-native/device-info.svg)](https://www.npmjs.com/@rescript-react-native/device-info)\n[![ReScript Forum](https://img.shields.io/discourse/posts?color=e6484f\u0026label=ReScript%20Forum\u0026server=https%3A%2F%2Fforum.rescript-lang.org)](https://forum.rescript-lang.org/)\n\n[ReScript](https://rescript-lang.org) bindings for\n[`react-native-device-info`](https://github.com/react-native-device-info/react-native-device-info).\n\nExposed as `ReactNativeDeviceInfo` module.\n\n`@rescript-react-native/device-info` X.y.\\* means it's compatible with\n`react-native-device-info` X.y.\\*\n\n## Installation\n\nWhen\n[`react-native-device-info`](https://github.com/react-native-device-info/react-native-device-info)\nis properly installed \u0026 configured by following their installation instructions,\nyou can install the bindings:\n\n```console\nnpm install @rescript-react-native/device-info\n# or\nyarn add @rescript-react-native/device-info\n```\n\n`@rescript-react-native/device-info` should be added to `bs-dependencies` in your\n`bsconfig.json`:\n\n```diff\n{\n  //...\n  \"bs-dependencies\": [\n    \"@rescript/react\",\n    \"rescript-react-native\",\n    // ...\n+    \"@rescript-react-native/device-info\"\n  ],\n  //...\n}\n```\n\n## Usage\n\n### Types\n\n#### `ReactNativeDeviceInfo.asyncHookResult('result)`\n\n```rescript\n{\n  .\n  \"loading\": bool,\n  \"result\": 'result,\n}\n```\n\n#### `ReactNativeDeviceInfo.powerState`\n\n```rescript\ntype powerState  = {\n  batteryLevel: float,\n  batteryState: string, // | \"unplugged\" | \"charging\" | \"full\" | \"unknown\"\n  lowPowerMode: option(bool),\n}\n```\n\n### Methods\n\n#### `ReactNativeDeviceInfo.getAndroidId()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getApiLevel()`\n\n```rescript\nunit =\u003e Js.Promise.t(float)\n```\n\n#### `ReactNativeDeviceInfo.getApplicationName()`\n\n```rescript\nunit =\u003e string\n```\n\n#### `ReactNativeDeviceInfo.getAvailableLocationProviders()`\n\n```rescript\nunit =\u003e Js.Promise.t(Js.Dict.t(bool))\n```\n\n#### `ReactNativeDeviceInfo.getBaseOs()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getBatteryLevel()`\n\n```rescript\nunit =\u003e Js.Promise.t(float)\n```\n\n#### `ReactNativeDeviceInfo.getBootloader()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getBrand()`\n\n```rescript\nunit =\u003e string\n```\n\n#### `ReactNativeDeviceInfo.getBuildId()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getBuildNumber()`\n\n```rescript\nunit =\u003e string\n```\n\n#### `ReactNativeDeviceInfo.getBundleId()`\n\n```rescript\nunit =\u003e string\n```\n\n#### `ReactNativeDeviceInfo.getCarrier()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getCodename()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getDevice()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getDeviceId()`\n\n```rescript\nunit =\u003e string\n```\n\n#### `ReactNativeDeviceInfo.getDeviceName()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getDeviceType()`\n\n```rescript\nunit =\u003e string\n```\n\n#### `ReactNativeDeviceInfo.getDisplay()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getFingerprint()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getFirstInstallTime()`\n\n```rescript\nunit =\u003e Js.Promise.t(float)\n```\n\n#### `ReactNativeDeviceInfo.getFontScale()`\n\n```rescript\nunit =\u003e Js.Promise.t(float)\n```\n\n#### `ReactNativeDeviceInfo.getFreeDiskStorage()`\n\n```rescript\nunit =\u003e Js.Promise.t(float)\n```\n\n#### `ReactNativeDeviceInfo.getHardware()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getHost()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getIncremental()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getInstallReferrer()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getInstanceId()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getIpAddress()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getLastUpdateTime()`\n\n```rescript\nunit =\u003e Js.Promise.t(float)\n```\n\n#### `ReactNativeDeviceInfo.getMacAddress()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getManufacturer()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getMaxMemory()`\n\n```rescript\nunit =\u003e Js.Promise.t(float)\n```\n\n#### `ReactNativeDeviceInfo.getModel()`\n\n```rescript\nunit =\u003e string\n```\n\n#### `ReactNativeDeviceInfo.getPhoneNumber()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getPowerState()`\n\n```rescript\nunit =\u003e Js.Promise.t(powerState)\n```\n\n#### `ReactNativeDeviceInfo.getPreviewSdkInt()`\n\n```rescript\nunit =\u003e Js.Promise.t(float)\n```\n\n#### `ReactNativeDeviceInfo.getProduct()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getReadableVersion()`\n\n```rescript\nunit =\u003e string\n```\n\n#### `ReactNativeDeviceInfo.getSecurityPatch()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getSerialNumber()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getSystemAvailableFeatures()`\n\n```rescript\nunit =\u003e Js.Promise.t(Js.Array.t(string))\n```\n\n#### `ReactNativeDeviceInfo.getSystemName()`\n\n```rescript\nunit =\u003e string\n```\n\n#### `ReactNativeDeviceInfo.getSystemVersion()`\n\n```rescript\nunit =\u003e string\n```\n\n#### `ReactNativeDeviceInfo.getTags()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getTotalDiskCapacity()`\n\n```rescript\nunit =\u003e Js.Promise.t(float)\n```\n\n#### `ReactNativeDeviceInfo.getTotalMemory()`\n\n```rescript\nunit =\u003e Js.Promise.t(float)\n```\n\n#### `ReactNativeDeviceInfo.getType()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getUniqueId()`\n\n```rescript\nunit =\u003e string\n```\n\n#### `ReactNativeDeviceInfo.getUsedMemory()`\n\n```rescript\nunit =\u003e Js.Promise.t(float)\n```\n\n#### `ReactNativeDeviceInfo.getUserAgent()`\n\n```rescript\nunit =\u003e Js.Promise.t(string)\n```\n\n#### `ReactNativeDeviceInfo.getVersion()`\n\n```rescript\nunit =\u003e string\n```\n\n#### `ReactNativeDeviceInfo.hasNotch()`\n\n```rescript\nunit =\u003e bool\n```\n\n#### `ReactNativeDeviceInfo.hasSystemFeature()`\n\n```rescript\nunit =\u003e Js.Promise.t(bool)\n```\n\n#### `ReactNativeDeviceInfo.isAirplaneMode()`\n\n```rescript\nunit =\u003e Js.Promise.t(bool)\n```\n\n#### `ReactNativeDeviceInfo.isBatteryCharging()`\n\n```rescript\nunit =\u003e Js.Promise.t(bool)\n```\n\n#### `ReactNativeDeviceInfo.isCameraPresent()`\n\n```rescript\nunit =\u003e Js.Promise.t(bool)\n```\n\n#### `ReactNativeDeviceInfo.isEmulator()`\n\n```rescript\nunit =\u003e Js.Promise.t(bool)\n```\n\n#### `ReactNativeDeviceInfo.isHeadphonesConnected()`\n\n```rescript\nunit =\u003e Js.Promise.t(bool)\n```\n\n#### `ReactNativeDeviceInfo.isLandscape()`\n\n```rescript\nunit =\u003e Js.Promise.t(bool)\n```\n\n#### `ReactNativeDeviceInfo.isLocationEnabled()`\n\n```rescript\nunit =\u003e Js.Promise.t(bool)\n```\n\n#### `ReactNativeDeviceInfo.isPinOrFingerprintSet()`\n\n```rescript\nunit =\u003e Js.Promise.t(bool)\n```\n\n#### `ReactNativeDeviceInfo.isTablet()`\n\n```rescript\nunit =\u003e bool\n```\n\n#### `ReactNativeDeviceInfo.supported32BitAbis()`\n\n```rescript\nunit =\u003e Js.Promise.t(Js.Array.t(string))\n```\n\n#### `ReactNativeDeviceInfo.supported64BitAbis()`\n\n```rescript\nunit =\u003e Js.Promise.t(Js.Array.t(string))\n```\n\n#### `ReactNativeDeviceInfo.supportedAbis()`\n\n```rescript\nunit =\u003e Js.Promise.t(Js.Array.t(string))\n```\n\n#### `ReactNativeDeviceInfo.useBatteryLevel()`\n\n```rescript\nunit =\u003e option(float)\n```\n\n#### `ReactNativeDeviceInfo.useBatteryLevelIsLow()`\n\n```rescript\nunit =\u003e option(float)\n```\n\n#### `ReactNativeDeviceInfo.useDeviceName()`\n\n```rescript\nunit =\u003e asyncHookResult(string)\n```\n\n#### `ReactNativeDeviceInfo.useFirstInstallTime()`\n\n```rescript\nunit =\u003e asyncHookResult(float)\n```\n\n#### `ReactNativeDeviceInfo.useHasSystemFeature()`\n\n```rescript\nstring =\u003e asyncHookResult(bool)\n```\n\n#### `ReactNativeDeviceInfo.useIsEmulator()`\n\n```rescript\nunit =\u003e asyncHookResult(bool)\n```\n\n#### `ReactNativeDeviceInfo.usePowerState()`\n\n```rescript\nunit =\u003e powerState\n```\n\n---\n\n## Changelog\n\nCheck the [changelog](./CHANGELOG.md) for more informations about recent\nreleases.\n\n---\n\n## Contribute\n\nRead the\n[contribution guidelines](https://github.com/rescript-react-native/.github/blob/master/CONTRIBUTING.md)\nbefore contributing.\n\n## Code of Conduct\n\nWe want this community to be friendly and respectful to each other. Please read\n[our full code of conduct](https://github.com/rescript-react-native/.github/blob/master/CODE_OF_CONDUCT.md)\nso that you can understand what actions will and will not be tolerated.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frescript-react-native%2Fdevice-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frescript-react-native%2Fdevice-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frescript-react-native%2Fdevice-info/lists"}