{"_id":"@awesome-cordova-library/screen-orientation","_rev":"2-63cf56829afb350054aa7730f314d6d8","name":"@awesome-cordova-library/screen-orientation","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@awesome-cordova-library/screen-orientation","version":"1.0.0","description":"Cordova plugin to set/lock the screen orientation in a common way for iOS, Android, and windows-uwp","main":"lib/index.js","types":"lib/index.d.ts","keywords":["cordova","capacitor","ionic","javascript","mobile","screen orientation"],"publishConfig":{"access":"public"},"author":{"name":"Jordan AZOULAY","email":"jazoulay@joazco.com","url":"https://github.com/joazco"},"license":"SEE LICENSE IN LICENSE","repository":{"type":"git","url":"git://github.com/joazco/awesome-cordova-library.git"},"bugs":{"url":"https://github.com/joazco/awesome-cordova-library/issues"},"homepage":"https://github.com/joazco/awesome-cordova-library","devDependencies":{"@types/jest":"^27.5.1","@types/react":"~17.0.21","jest":"^28.1.0","prettier":"^2.6.2","ts-jest":"^28.0.3","tslint":"^6.1.3","tslint-config-prettier":"^1.18.0","typescript":"^4.7.2"},"scripts":{"build":"rm -rf lib/ && tsc","build-yalc":"npm run build; yalc publish --push --private","test":"jest --config jestconfig.json","format":"prettier --write \"src/**/*.ts\"","lint":"tslint -p tsconfig.json","repo:pre:publish":"npm run format; npm run lint; npm test","repo:publish":"npm run build; npm publish --access public"},"directories":{"lib":"lib"},"dependencies":{},"_id":"@awesome-cordova-library/screen-orientation@1.0.0","_nodeVersion":"14.15.1","_npmVersion":"8.5.2","dist":{"integrity":"sha512-Q42g4Co9cAp4RpkfzeOyUO0bVmK78001zPlG/eUemUlaI023vYHprgWF9teI6JxyimiUwiqxMBLSZChDJYYKKw==","shasum":"7476fcb4d15e7bff875e8ff394d780ab22337d25","tarball":"https://registry.npmjs.org/@awesome-cordova-library/screen-orientation/-/screen-orientation-1.0.0.tgz","fileCount":7,"unpackedSize":10704,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRgZPBZFUGN40eQxBUpzuTNOJiLssE+UoFM3u8WUo9PAIhAOuwXAAtTiWWGQcQzw/eAWcUyBOTXje6+yo/QvZJLjtQ"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilizAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqusQ/9FKLI3vYItCZhAXlTUIEaSY1NquYQ/rcAZSdopdzv6PVA8Uxb\r\nyGhPsJtDHl3WkclAvP7Q/ZeYFOZopEWNQKzaMTmXku6eKb81gS+FvVMuEDts\r\n1GUcH4jHio957X3l+XikXW8HzCtOwNOretRwBM5ZUlcC6/+TFrH9y2CVtE5w\r\nvU8ICLEXxTXVM+ou4fU+Hz0lUivnaSliLy2obRyyeEdzlBRvbklvhVobDnHX\r\nFeFtW6T9iaGWunuLjQeZRb02eIMvqwtzCjN7GkjjSjOkrNIl2cXXV4yM1R4k\r\nJLRx6adqjvI0sGcKjbYbdAqmjSnRSPEy4RgWexCOG9nzo+VqNjJJKwI4eogu\r\nzR2h55cF92dRHvXExwMmE4Lu9Icm6Nvqv3EGkbMv2tf7pwn1TUds5jCCHLeR\r\ndAJI0LNg2N4uf8n/oH+TpzA9LjE3CIjNzwT3WCKFNTLnyPk8FCU0gQRerAHH\r\nUyDTy96D8L7QmfNrDuVAUsCIEuW2d/MvdPyPFeljYBbsMCeFGc+EXJaRzToz\r\nIsDx49OkPG+36THiDDph2Z4XiY//oQHzVTejMuVFNHfNnbuCiIorO7dcT38Y\r\nu3xRdBu/aXb8kECes3a8ZVUIUIcuCjbMZET53mFL4wGPQNnpVv2My3JQTUUF\r\n1g2bfZoaXH3sI+9IBwgqhCC5NvdANJFGVSI=\r\n=PYN7\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"joazco","email":"jazoulay@joazco.com"},"maintainers":[{"name":"joazco","email":"jazoulay@joazco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/screen-orientation_1.0.0_1654009024371_0.2512105629181982"},"_hasShrinkwrap":false},"1.0.1":{"name":"@awesome-cordova-library/screen-orientation","version":"1.0.1","description":"Cordova plugin to set/lock the screen orientation in a common way for iOS, Android, and windows-uwp","main":"lib/index.js","types":"lib/index.d.ts","keywords":["cordova","capacitor","ionic","javascript","mobile","screen orientation"],"publishConfig":{"access":"public"},"author":{"name":"Jordan AZOULAY","email":"jazoulay@joazco.com","url":"https://github.com/joazco"},"license":"SEE LICENSE IN LICENSE","repository":{"type":"git","url":"git://github.com/joazco/awesome-cordova-library.git"},"bugs":{"url":"https://github.com/joazco/awesome-cordova-library/issues"},"homepage":"https://github.com/joazco/awesome-cordova-library","devDependencies":{"@types/jest":"^27.5.1","@types/react":"~17.0.21","jest":"^28.1.0","prettier":"^2.6.2","ts-jest":"^28.0.3","tslint":"^6.1.3","tslint-config-prettier":"^1.18.0","typescript":"^4.7.2"},"scripts":{"build":"rm -rf lib/ && tsc","build-yalc":"npm run build; yalc publish --push --private","test":"jest --config jestconfig.json","format":"prettier --write \"src/**/*.ts\"","lint":"tslint -p tsconfig.json","prepublish":"npm run format; npm run lint; npm test; npm run build"},"directories":{"lib":"lib"},"dependencies":{},"_id":"@awesome-cordova-library/screen-orientation@1.0.1","_nodeVersion":"14.15.1","_npmVersion":"8.5.2","dist":{"integrity":"sha512-0Ztioj7dDOM0GfQ/URFflndqnW+cUvRMZR3ArLjRGqwtaF/BbNSTp6C8lBk3izxuVp8Xd1rcARKXyqK91sR0ug==","shasum":"3c804e78b2e54f4d4b44dd83cfc573dc37ab0240","tarball":"https://registry.npmjs.org/@awesome-cordova-library/screen-orientation/-/screen-orientation-1.0.1.tgz","fileCount":7,"unpackedSize":10795,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICNym3PjdPfs5Zjd6IsYDK2YtvIZGuypNLwpHi/JLRGVAiBb2SKolGuztAlsZll/mHF6mLUk+zT9JwcdC+kLSfvsoA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJinxhgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoAXQ/+NQtf6pLpKuMd/0DQGD1wh5Dn2YMc6d1ux11cclKBPqt8ZvyM\r\nIgEICpuvWIX2UToXQBfgduRn95KkzufMBst2RACDLae+wja6B/pgXzq9w/QP\r\nV5NPFqQyUh41b0C08vgRLJKV4WuEGDA+O6T+AtCzzpCu2y4KayeAaOL90a9B\r\nnLmNHmoLXlMDYW90LuBbkkS+0LbSOtldXI7SgZc6uG6azFiYCi1ByF3arMEn\r\no1GhDy/vI8cxfXmJ7IeNqdqG6o9etPO6H8HMPaD25QBIdpLurGPfcx8V20NI\r\n+r4NUSrgCZ7tGPwCn6wC/IjWITjVNjW+xaJ+8Q9I9L3SIAaMwHYYNyTHdjOe\r\n8m2KeykXajYFT6IwScVv8Fdc/dhx8bZyKhg97nOV9E22tIOEHDgTgexTmBny\r\nHt0W2mnPlEmI030MBiH1nAu2fO5dE3w9aVlyxvYNeZlrBS4ddWaC3SoBQeyv\r\nIYGMvQiFXttjU9brmlzVXFvpcBtw94HEGJvZGVcJG2TeZmitF1d60ENbn+jf\r\nk2+ouj8Fu3S8LMmVnDayT8+VQtYMo2jQ5t/NiDn3k+lhS4tgcr6uoe1W8VPC\r\nJNHu967FTY1sMcWc4Z0D5tl3ED5p6r6WtrWlDXvgs8Xsu4Gqptdh/VfGev40\r\n3P46K5WjXvDrglY2dbkWvpbAtMJ6k4Ja6G8=\r\n=voqA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"joazco","email":"jazoulay@joazco.com"},"maintainers":[{"name":"joazco","email":"jazoulay@joazco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/screen-orientation_1.0.1_1654593632734_0.4911865747238988"},"_hasShrinkwrap":false},"1.0.2":{"name":"@awesome-cordova-library/screen-orientation","version":"1.0.2","description":"Cordova plugin to set/lock the screen orientation in a common way for iOS, Android, and windows-uwp","main":"lib/index.js","types":"lib/index.d.ts","keywords":["cordova","capacitor","ionic","javascript","mobile","screen orientation"],"publishConfig":{"access":"public"},"author":{"name":"Jordan AZOULAY","email":"jazoulay@joazco.com","url":"https://github.com/joazco"},"license":"SEE LICENSE IN LICENSE","repository":{"type":"git","url":"git://github.com/joazco/awesome-cordova-library.git"},"bugs":{"url":"https://github.com/joazco/awesome-cordova-library/issues"},"homepage":"https://github.com/joazco/awesome-cordova-library","devDependencies":{"@types/jest":"^27.5.1","@types/react":"~17.0.21","jest":"^28.1.0","prettier":"^2.6.2","ts-jest":"^28.0.3","tslint":"^6.1.3","tslint-config-prettier":"^1.18.0","typescript":"^4.7.2"},"scripts":{"build":"rm -rf lib/ && tsc","build-yalc":"npm run build; yalc publish --push --private","test":"jest --config jestconfig.json","format":"prettier --write \"src/**/*.ts\"","lint":"tslint -p tsconfig.json","prepublish":"npm run format; npm run lint; npm test; npm run build"},"directories":{"lib":"lib"},"dependencies":{},"gitHead":"2a2b9cf007a870056251632315547e6a651d26a0","_id":"@awesome-cordova-library/screen-orientation@1.0.2","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-wLz8lUd7MySrApQ9z10ACE5LkQBwrpOCq35b4/MhQrODtdNY63V2HA1mj4M+hO9HpGcf5OTyBpwbH36Hoaej3w==","shasum":"b109d04cd1dafce474a78a6869ea957cb0ae56f1","tarball":"https://registry.npmjs.org/@awesome-cordova-library/screen-orientation/-/screen-orientation-1.0.2.tgz","fileCount":7,"unpackedSize":11201,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFEuNwOkLmkoJRtEcSh1mYiXH+1h0n0lXDaNPJTLzQ3gIhAPNVumY/hSV9PlBvwQm+/7VnGdMDshsrKQA+p4wHYMg6"}]},"_npmUser":{"name":"joazco","email":"jazoulay@joazco.com"},"maintainers":[{"name":"joazco","email":"jazoulay@joazco.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/screen-orientation_1.0.2_1694499306788_0.2935610052912605"},"_hasShrinkwrap":false}},"time":{"created":"2022-05-31T14:57:04.299Z","1.0.0":"2022-05-31T14:57:04.514Z","modified":"2023-09-12T06:15:07.167Z","1.0.1":"2022-06-07T09:20:32.876Z","1.0.2":"2023-09-12T06:15:06.964Z"},"maintainers":[{"name":"joazco","email":"jazoulay@joazco.com"}],"description":"Cordova plugin to set/lock the screen orientation in a common way for iOS, Android, and windows-uwp","homepage":"https://github.com/joazco/awesome-cordova-library","keywords":["cordova","capacitor","ionic","javascript","mobile","screen orientation"],"repository":{"type":"git","url":"git://github.com/joazco/awesome-cordova-library.git"},"author":{"name":"Jordan AZOULAY","email":"jazoulay@joazco.com","url":"https://github.com/joazco"},"bugs":{"url":"https://github.com/joazco/awesome-cordova-library/issues"},"license":"SEE LICENSE IN LICENSE","readme":"---\nid: plugin-screen-orientation\ntitle: Screen Orientation\ntags:\n  - cordova\n  - capacitor\n  - ionic\n  - javascript\n  - typescript\n  - plugin\n  - mobile\n  - screen orientation\n---\n\n# Screen Orientation\n\nCordova plugin to set/lock the screen orientation in a common way for iOS, Android, and windows-uwp.\n\n[Online documentation](https://awesomecordovalibrary.com)\n\n[Cordova documentation](https://cordova.apache.org/docs/en/11.x/reference/cordova-plugin-screen-orientation/index.html)\n\n## Installation\n\n### Cordova\n\n```sh\ncordova plugin add cordova-plugin-screen-orientation\nnpm install @awesome-cordova-library/screen-orientation\n```\n\n### Capacitor / Ionic\n\n```bash\nnpm install cordova-plugin-screen-orientation\nnpm install @awesome-cordova-library/screen-orientation\nnpx cap sync\n```\n\n## Vanilla\n\n### Declaration\n\n```typescript\ntype OrientationLockCordovaType =\n  | \"any\"\n  | \"landscape\"\n  | \"landscape-primary\"\n  | \"landscape-secondary\"\n  | \"portrait\"\n  | \"portrait-primary\"\n  | \"portrait-secondary\";\n\nclass ScreenOrientation {\n  static lock(orientation: OrientationLockCordovaType): void;\n  static unLock(): void;\n  static currentOrientation(): OrientationLockCordovaType;\n  static onOrientationChange(\n    callback: (orientation: OrientationLockCordovaType) => void\n  ): void;\n}\n```\n\n### Usages\n\n```typescript\nimport ScreenOrientation from \"@awesome-cordova-library/screen-orientation\";\n\n// lock the device orientation\nScreenOrientation.lock(\"portrait\");\n// unlock the orientation\nScreenOrientation.unLock();\n// access current orientation\nScreenOrientation.currentOrientation();\nScreenOrientation.onOrientationChange((o) => console.log(o));\n```\n\n## React\n\n### Declaration\n\n```typescript\nconst useScreenOrientation: () => {\n  lock: (orientation: OrientationLockCordovaType) => void;\n  unLock: () => void;\n  currentOrientation: () => OrientationLockCordovaType;\n  onOrientationChange: (\n    callback: (orientation: OrientationLockCordovaType) => void\n  ) => void;\n};\n```\n\n### Usages\n\n```typescript\nimport { useEffect } from \"react\";\nimport useScreenOrientation from \"@awesome-cordova-library/screen-orientation/lib/react\";\n\nfunction App() {\n  const { lock, unLock, currentOrientation, onOrientationChange } =\n    useScreenOrientation();\n\n  useEffect(() => {\n    lock(\"portrait\");\n  }, []);\n\n  return <div />;\n}\n```\n","readmeFilename":"README.md"}