Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(screen-orientation): Add OrientationLockType #1914

Merged
merged 8 commits into from
Jan 23, 2024

Conversation

dtarnawsky
Copy link
Contributor

@dtarnawsky dtarnawsky commented Nov 21, 2023

Typescript > v5.2 removes OrientationLockType. This adds the type back in.

See (microsoft/TypeScript-DOM-lib-generator#1615).

Fixes WN-1457.

@jcesarmobile jcesarmobile changed the title fix(screen-orientation) Add ScreenOrientationLockType fix(screen-orientation): Add ScreenOrientationLockType Nov 21, 2023
@dtarnawsky dtarnawsky changed the title fix(screen-orientation): Add ScreenOrientationLockType fix(screen-orientation): Add OrientationLockType Nov 21, 2023
@dallastjames dallastjames added the pr review requested Adds PR to internal issue tracker for team review label Nov 28, 2023
Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a minor comment about the noe

I prefer this approach over #1929 as that seems very complex and harder to maintain.

I tested this approach and didn't seem to generate conflicts in apps using typescript < 5.2.

I released a dev build of screen-orientation with dev version: 6.0.0-dev-1915-20231122T130858.0 with this change

screen-orientation/src/definitions.ts Outdated Show resolved Hide resolved
@below43
Copy link

below43 commented Dec 14, 2023

For anyone depending on this in Capacitor 5.x, a solution to this is to add a definitions.d.ts file in your src directory, and add:
declare type OrientationLockType = 'any' | 'natural' | 'landscape' | 'portrait' | 'portrait-primary' | 'portrait-secondary' | 'landscape-primary' | 'landscape-secondary';

@giralte-ionic giralte-ionic merged commit bc61f5c into ionic-team:main Jan 23, 2024
11 of 12 checks passed
IT-MikeS pushed a commit that referenced this pull request Jan 23, 2024
Co-authored-by: Dan Giralté <97970732+giralte-ionic@users.noreply.github.com>
Co-authored-by: jcesarmobile <jcesarmobile@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr review requested Adds PR to internal issue tracker for team review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants