Skip to content

Commit

Permalink
Merge pull request #32164 from VickyStash/ts-migration/remaining-group-2
Browse files Browse the repository at this point in the history
[TS migration] Migrate '[Remaining Group 2]' lib to TypeScript
  • Loading branch information
grgia authored Jan 9, 2024
2 parents 5df6055 + d53f4f2 commit e372de1
Show file tree
Hide file tree
Showing 23 changed files with 465 additions and 398 deletions.
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
"@testing-library/jest-native": "5.4.1",
"@testing-library/react-native": "11.5.1",
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
"@types/canvas-size": "^1.2.2",
"@types/concurrently": "^7.0.0",
"@types/jest": "^29.5.2",
"@types/jest-when": "^3.5.2",
Expand Down
1 change: 1 addition & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ type OnyxValues = {
[ONYXKEYS.COLLECTION.REPORT_USER_IS_LEAVING_ROOM]: boolean;
[ONYXKEYS.COLLECTION.SECURITY_GROUP]: OnyxTypes.SecurityGroup;
[ONYXKEYS.COLLECTION.TRANSACTION]: OnyxTypes.Transaction;
[ONYXKEYS.COLLECTION.TRANSACTION_DRAFT]: OnyxTypes.Transaction;
[ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_TAGS]: OnyxTypes.RecentlyUsedTags;
[ONYXKEYS.COLLECTION.SELECTED_TAB]: string;
[ONYXKEYS.COLLECTION.PRIVATE_NOTES_DRAFT]: string;
Expand Down
4 changes: 2 additions & 2 deletions src/libs/Navigation/Navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function getActiveRouteIndex(stateOrRoute: StateOrRoute, index?: number): number
* @param path - Path that you are looking for.
* @return - Returns distance to path or -1 if the path is not found in root navigator.
*/
function getDistanceFromPathInRootNavigator(path: string): number {
function getDistanceFromPathInRootNavigator(path?: string): number {
let currentState = navigationRef.getRootState();

for (let index = 0; index < 5; index++) {
Expand Down Expand Up @@ -149,7 +149,7 @@ function navigate(route: Route = ROUTES.HOME, type?: string) {
* @param shouldEnforceFallback - Enforces navigation to fallback route
* @param shouldPopToTop - Should we navigate to LHN on back press
*/
function goBack(fallbackRoute: Route, shouldEnforceFallback = false, shouldPopToTop = false) {
function goBack(fallbackRoute?: Route, shouldEnforceFallback = false, shouldPopToTop = false) {
if (!canNavigate('goBack')) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4535,4 +4535,4 @@ export {
shouldDisableThread,
};

export type {ExpenseOriginalMessage, OptionData, OptimisticChatReport};
export type {ExpenseOriginalMessage, OptionData, OptimisticChatReport, OptimisticCreatedReportAction};
4 changes: 2 additions & 2 deletions src/libs/actions/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,12 @@ function finalReconnectAppAfterActivatingReliableUpdates(): Promise<void | OnyxT
* @param [updateIDFrom] the ID of the Onyx update that we want to start fetching from
* @param [updateIDTo] the ID of the Onyx update that we want to fetch up to
*/
function getMissingOnyxUpdates(updateIDFrom = 0, updateIDTo = 0): Promise<void | OnyxTypes.Response> {
function getMissingOnyxUpdates(updateIDFrom = 0, updateIDTo: number | string = 0): Promise<void | OnyxTypes.Response> {
console.debug(`[OnyxUpdates] Fetching missing updates updateIDFrom: ${updateIDFrom} and updateIDTo: ${updateIDTo}`);

type GetMissingOnyxMessagesParams = {
updateIDFrom: number;
updateIDTo: number;
updateIDTo: number | string;
};

const parameters: GetMissingOnyxMessagesParams = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ function retrieveMaxCanvasArea() {
// More information at: https://github.com/jhildenbiddle/canvas-size/issues/13
canvasSize
.maxArea({
max: Browser.isMobile() ? 8192 : null,
max: Browser.isMobile() ? 8192 : undefined,
usePromise: true,
useWorker: false,
})
.then(() => ({
onSuccess: (width, height) => {
onSuccess: (width: number, height: number) => {
Onyx.merge(ONYXKEYS.MAX_CANVAS_AREA, width * height);
},
}));
Expand Down
176 changes: 0 additions & 176 deletions src/libs/actions/Card.js

This file was deleted.

Loading

0 comments on commit e372de1

Please sign in to comment.