Skip to content

Commit

Permalink
Merge pull request #26199 from software-mansion-labs/ts-migration/com…
Browse files Browse the repository at this point in the history
…ponent-utils-lib

[No QA] [TS migration] Migrate 'ComponentUtils' lib to TypeScript
  • Loading branch information
madmax330 authored Aug 29, 2023
2 parents 0a7aabd + 6a90385 commit 7e524dd
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
8 changes: 0 additions & 8 deletions src/libs/ComponentUtils/index.js

This file was deleted.

5 changes: 0 additions & 5 deletions src/libs/ComponentUtils/index.native.js

This file was deleted.

7 changes: 7 additions & 0 deletions src/libs/ComponentUtils/index.native.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {AccessibilityRoleForm, NewPasswordAutocompleteType, PasswordAutocompleteType} from './types';

const PASSWORD_AUTOCOMPLETE_TYPE: PasswordAutocompleteType = 'password';
const NEW_PASSWORD_AUTOCOMPLETE_TYPE: NewPasswordAutocompleteType = 'password-new';
const ACCESSIBILITY_ROLE_FORM: AccessibilityRoleForm = 'none';

export {PASSWORD_AUTOCOMPLETE_TYPE, ACCESSIBILITY_ROLE_FORM, NEW_PASSWORD_AUTOCOMPLETE_TYPE};
10 changes: 10 additions & 0 deletions src/libs/ComponentUtils/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {AccessibilityRoleForm, NewPasswordAutocompleteType, PasswordAutocompleteType} from './types';

/**
* Web password field needs `current-password` as autocomplete type which is not supported on native
*/
const PASSWORD_AUTOCOMPLETE_TYPE: PasswordAutocompleteType = 'current-password';
const NEW_PASSWORD_AUTOCOMPLETE_TYPE: NewPasswordAutocompleteType = 'new-password';
const ACCESSIBILITY_ROLE_FORM: AccessibilityRoleForm = 'form';

export {PASSWORD_AUTOCOMPLETE_TYPE, ACCESSIBILITY_ROLE_FORM, NEW_PASSWORD_AUTOCOMPLETE_TYPE};
5 changes: 5 additions & 0 deletions src/libs/ComponentUtils/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type PasswordAutocompleteType = 'current-password' | 'password';
type NewPasswordAutocompleteType = 'new-password' | 'password-new';
type AccessibilityRoleForm = 'form' | 'none';

export type {PasswordAutocompleteType, NewPasswordAutocompleteType, AccessibilityRoleForm};

0 comments on commit 7e524dd

Please sign in to comment.