[web] Tighten auth's tsconfig.json (#1846)

Ongoing process, just some steps in the direction we wish.
This commit is contained in:
Manav Rathi 2024-05-24 19:03:53 +05:30 committed by GitHub
commit 82bffd81de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
109 changed files with 223 additions and 242 deletions

View file

@ -6,7 +6,7 @@ import { accountLogout } from "@ente/accounts/services/logout";
import { APPS, APP_TITLES } from "@ente/shared/apps/constants";
import { Overlay } from "@ente/shared/components/Container";
import DialogBoxV2 from "@ente/shared/components/DialogBoxV2";
import {
import type {
DialogBoxAttributesV2,
SetDialogBoxAttributesV2,
} from "@ente/shared/components/DialogBoxV2/types";

View file

@ -9,14 +9,8 @@ import { t } from "i18next";
import _sodium from "libsodium-wrappers";
import { useRouter } from "next/router";
import { AppContext } from "pages/_app";
import {
Dispatch,
SetStateAction,
createContext,
useContext,
useEffect,
useState,
} from "react";
import type { Dispatch, SetStateAction } from "react";
import { createContext, useContext, useEffect, useState } from "react";
import { Passkey } from "types/passkey";
import {
finishPasskeyRegistration,

View file

@ -1 +1,4 @@
NEXT_TELEMETRY_DISABLED = 1
# For details on how to populate a .env.local to run auth and get it to connect
# to an arbitrary Ente instance, see `apps/photos/.env`.

View file

@ -9,5 +9,5 @@ module.exports = {
tsconfigRootDir: __dirname,
project: "./tsconfig.json",
},
ignorePatterns: [".eslintrc.js", "out"],
ignorePatterns: [".eslintrc.js", "next.config.js", "out"],
};

View file

@ -3,6 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"@/build-config": "*",
"@/next": "*",
"@ente/accounts": "*",
"@ente/eslint-config": "*",

View file

@ -12,7 +12,7 @@ import {
} from "@ente/shared/apps/constants";
import { Overlay } from "@ente/shared/components/Container";
import DialogBoxV2 from "@ente/shared/components/DialogBoxV2";
import {
import type {
DialogBoxAttributesV2,
SetDialogBoxAttributesV2,
} from "@ente/shared/components/DialogBoxV2/types";
@ -25,12 +25,12 @@ import HTTPService from "@ente/shared/network/HTTPService";
import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
import { getTheme } from "@ente/shared/themes";
import { THEME_COLOR } from "@ente/shared/themes/constants";
import { SetTheme } from "@ente/shared/themes/types";
import type { SetTheme } from "@ente/shared/themes/types";
import type { User } from "@ente/shared/user/types";
import { CssBaseline, useMediaQuery } from "@mui/material";
import { ThemeProvider } from "@mui/material/styles";
import { t } from "i18next";
import { AppProps } from "next/app";
import type { AppProps } from "next/app";
import { useRouter } from "next/router";
import { createContext, useEffect, useRef, useState } from "react";
import LoadingBar from "react-top-loading-bar";

View file

@ -1,24 +1,25 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "./src",
"downlevelIteration": true,
"jsx": "preserve",
"jsxImportSource": "@emotion/react",
"lib": ["dom", "dom.iterable", "esnext", "webworker"],
"noImplicitAny": false,
"noUnusedLocals": false,
"noUnusedParameters": false,
"strictNullChecks": false,
"target": "es5",
"useUnknownInCatchVariables": false
},
"extends": "@/build-config/tsconfig-next.json",
"include": [
"src",
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"**/*.js",
"../../packages/shared/themes/mui-theme.d.ts"
],
"exclude": ["node_modules", "out", ".next", "thirdparty"]
// Temporarily disable some things to get the existing code to compile
// without warnings.
"compilerOptions": {
"baseUrl": "./src",
"jsxImportSource": "@emotion/react",
"strict": false,
/* Stricter than strict */
"noImplicitReturns": false,
"noUnusedParameters": false,
"noUnusedLocals": false,
"noFallthroughCasesInSwitch": false,
/* e.g. makes array indexing returns undefined */
"noUncheckedIndexedAccess": false,
"exactOptionalPropertyTypes": false
}
}

View file

@ -1,10 +1,10 @@
import log from "@/next/log";
import DialogBoxV2 from "@ente/shared/components/DialogBoxV2";
import VerifyMasterPasswordForm, {
VerifyMasterPasswordFormProps,
type VerifyMasterPasswordFormProps,
} from "@ente/shared/components/VerifyMasterPasswordForm";
import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
import { KeyAttributes, User } from "@ente/shared/user/types";
import type { KeyAttributes, User } from "@ente/shared/user/types";
import { t } from "i18next";
import { AppContext } from "pages/_app";
import { useContext, useEffect, useState } from "react";

View file

@ -1,5 +1,5 @@
import { VerticallyCenteredFlex } from "@ente/shared/components/Container";
import { ButtonProps, Typography } from "@mui/material";
import { Typography, type ButtonProps } from "@mui/material";
interface Iprops {
mainText: string;

View file

@ -3,7 +3,7 @@ import {
FormControlLabel,
FormGroup,
Typography,
TypographyProps,
type TypographyProps,
} from "@mui/material";
interface Iprops {

View file

@ -6,7 +6,7 @@ import PeopleIcon from "@mui/icons-material/People";
import { SetCollectionNamerAttributes } from "components/Collections/CollectionNamer";
import CollectionOptions from "components/Collections/CollectionOptions";
import { CollectionSummaryType } from "constants/collection";
import { Dispatch, SetStateAction } from "react";
import type { Dispatch, SetStateAction } from "react";
import { Collection, CollectionSummary } from "types/collection";
import { SetFilesDownloadProgressAttributesCreator } from "types/gallery";
import { shouldShowOptions } from "utils/collection";

View file

@ -1,6 +1,6 @@
import DialogBoxV2 from "@ente/shared/components/DialogBoxV2";
import SingleInputForm, {
SingleInputFormProps,
type SingleInputFormProps,
} from "@ente/shared/components/SingleInputForm";
import { t } from "i18next";
import React from "react";

View file

@ -4,7 +4,7 @@ import DialogBoxV2 from "@ente/shared/components/DialogBoxV2";
import EnteButton from "@ente/shared/components/EnteButton";
import EnteSpinner from "@ente/shared/components/EnteSpinner";
import SingleInputForm, {
SingleInputFormProps,
type SingleInputFormProps,
} from "@ente/shared/components/SingleInputForm";
import { boxSeal } from "@ente/shared/crypto/internal/libsodium";
import castGateway from "@ente/shared/network/cast";

View file

@ -11,7 +11,8 @@ import {
import { t } from "i18next";
import { AppContext } from "pages/_app";
import { GalleryContext } from "pages/gallery";
import { Dispatch, SetStateAction, useContext, useRef, useState } from "react";
import type { Dispatch, SetStateAction } from "react";
import { useContext, useRef, useState } from "react";
import { Trans } from "react-i18next";
import * as CollectionAPI from "services/collectionService";
import * as TrashService from "services/trashService";

View file

@ -8,7 +8,7 @@ import MenuItemDivider from "components/Menu/MenuItemDivider";
import { MenuItemGroup } from "components/Menu/MenuItemGroup";
import MenuSectionTitle from "components/Menu/MenuSectionTitle";
import Avatar from "components/pages/gallery/Avatar";
import { Formik, FormikHelpers } from "formik";
import { Formik, type FormikHelpers } from "formik";
import { t } from "i18next";
import { useMemo, useState } from "react";
import * as Yup from "yup";

View file

@ -1,5 +1,5 @@
import SingleInputForm, {
SingleInputFormProps,
type SingleInputFormProps,
} from "@ente/shared/components/SingleInputForm";
import ComlinkCryptoWorker from "@ente/shared/crypto";
import { Dialog, Stack, Typography } from "@mui/material";

View file

@ -3,7 +3,7 @@ import DialogBoxV2 from "@ente/shared/components/DialogBoxV2";
import EnteButton from "@ente/shared/components/EnteButton";
import { DELETE_ACCOUNT_EMAIL } from "@ente/shared/constants/urls";
import { Button, Link, Stack } from "@mui/material";
import { Formik, FormikHelpers } from "formik";
import { Formik, type FormikHelpers } from "formik";
import { t } from "i18next";
import { AppContext } from "pages/_app";
import { GalleryContext } from "pages/gallery";

View file

@ -6,7 +6,7 @@ import {
SelectChangeEvent,
Stack,
Typography,
TypographyProps,
type TypographyProps,
} from "@mui/material";
export interface DropdownOption<T> {

View file

@ -1,5 +1,5 @@
import CircularProgress, {
CircularProgressProps,
type CircularProgressProps,
} from "@mui/material/CircularProgress";
export default function EnteSpinner(props: CircularProgressProps) {

View file

@ -4,10 +4,10 @@ import {
} from "@ente/shared/components/Container";
import {
Box,
ButtonProps,
MenuItem,
Typography,
TypographyProps,
type ButtonProps,
type TypographyProps,
} from "@mui/material";
import { CaptionedText } from "components/CaptionedText";
import PublicShareSwitch from "components/Collections/CollectionShare/publicShare/switch";

View file

@ -2,12 +2,12 @@ import CloseIcon from "@mui/icons-material/Close";
import {
Box,
Button,
ButtonProps,
Snackbar,
Stack,
SxProps,
Theme,
Typography,
type ButtonProps,
} from "@mui/material";
import { NotificationAttributes } from "types/Notification";

View file

@ -1,6 +1,6 @@
import DialogBoxV2 from "@ente/shared/components/DialogBoxV2";
import SingleInputForm, {
SingleInputFormProps,
type SingleInputFormProps,
} from "@ente/shared/components/SingleInputForm";
import { t } from "i18next";

View file

@ -1,5 +1,5 @@
import { Button, ButtonProps, styled } from "@mui/material";
import { CSSProperties } from "@mui/material/styles/createTypography";
import { Button, styled, type ButtonProps } from "@mui/material";
import { type CSSProperties } from "@mui/material/styles/createTypography";
export const MapButton = styled((props: ButtonProps) => (
<Button color="secondary" {...props} />

View file

@ -3,7 +3,7 @@ import { EnteMenuItem } from "components/Menu/EnteMenuItem";
import { MenuItemGroup } from "components/Menu/MenuItemGroup";
import MenuSectionTitle from "components/Menu/MenuSectionTitle";
import { t } from "i18next";
import { Dispatch, SetStateAction } from "react";
import type { Dispatch, SetStateAction } from "react";
interface IProps {
brightness: number;

View file

@ -31,16 +31,8 @@ import MenuSectionTitle from "components/Menu/MenuSectionTitle";
import { CORNER_THRESHOLD, FILTER_DEFAULT_VALUES } from "constants/photoEditor";
import { t } from "i18next";
import { AppContext } from "pages/_app";
import {
Dispatch,
MutableRefObject,
SetStateAction,
createContext,
useContext,
useEffect,
useRef,
useState,
} from "react";
import type { Dispatch, MutableRefObject, SetStateAction } from "react";
import { createContext, useContext, useEffect, useRef, useState } from "react";
import { getLocalCollections } from "services/collectionService";
import downloadManager from "services/download";
import uploadManager from "services/upload/uploadManager";

View file

@ -1,8 +1,8 @@
import { Overlay } from "@ente/shared/components/Container";
import {
CircularProgress,
CircularProgressProps,
Typography,
type CircularProgressProps,
} from "@mui/material";
function CircularProgressWithLabel(

View file

@ -1,4 +1,4 @@
import { Typography, TypographyProps, styled } from "@mui/material";
import { Typography, styled, type TypographyProps } from "@mui/material";
import MuiAccordion, { AccordionProps } from "@mui/material/Accordion";
import MuiAccordionDetails from "@mui/material/AccordionDetails";
import MuiAccordionSummary from "@mui/material/AccordionSummary";

View file

@ -1,5 +1,5 @@
import { ButtonProps, Link, LinkProps } from "@mui/material";
import React, { FC } from "react";
import { Link, type ButtonProps, type LinkProps } from "@mui/material";
import React from "react";
export type LinkButtonProps = React.PropsWithChildren<{
onClick: () => void;
@ -7,12 +7,9 @@ export type LinkButtonProps = React.PropsWithChildren<{
style?: React.CSSProperties;
}>;
const LinkButton: FC<LinkProps<"button", { color?: ButtonProps["color"] }>> = ({
children,
sx,
color,
...props
}) => {
const LinkButton: React.FC<
LinkProps<"button", { color?: ButtonProps["color"] }>
> = ({ children, sx, color, ...props }) => {
return (
<Link
component="button"

View file

@ -18,7 +18,7 @@ import {
SetDialogBoxAttributes,
} from "@ente/shared/components/DialogBox/types";
import DialogBoxV2 from "@ente/shared/components/DialogBoxV2";
import {
import type {
DialogBoxAttributesV2,
SetDialogBoxAttributesV2,
} from "@ente/shared/components/DialogBoxV2/types";
@ -36,7 +36,7 @@ import {
} from "@ente/shared/storage/localStorage/helpers";
import { getTheme } from "@ente/shared/themes";
import { THEME_COLOR } from "@ente/shared/themes/constants";
import { SetTheme } from "@ente/shared/themes/types";
import type { SetTheme } from "@ente/shared/themes/types";
import type { User } from "@ente/shared/user/types";
import ArrowForward from "@mui/icons-material/ArrowForward";
import { CssBaseline, useMediaQuery } from "@mui/material";
@ -45,7 +45,7 @@ import Notification from "components/Notification";
import { REDIRECTS } from "constants/redirects";
import { t } from "i18next";
import isElectron from "is-electron";
import { AppProps } from "next/app";
import type { AppProps } from "next/app";
import { useRouter } from "next/router";
import "photoswipe/dist/photoswipe.css";
import { createContext, useEffect, useRef, useState } from "react";

View file

@ -21,7 +21,7 @@ import {
clearKeys,
getKey,
} from "@ente/shared/storage/sessionStorage";
import { User } from "@ente/shared/user/types";
import type { User } from "@ente/shared/user/types";
import { isPromise } from "@ente/shared/utils";
import { Typography, styled } from "@mui/material";
import AuthenticateUserModal from "components/AuthenticateUserModal";

View file

@ -11,7 +11,12 @@ import localForage from "@ente/shared/storage/localForage";
import { getData, LS_KEYS } from "@ente/shared/storage/localStorage";
import { getToken } from "@ente/shared/storage/localStorage/helpers";
import { getKey, SESSION_KEYS } from "@ente/shared/storage/sessionStorage";
import { Button, styled, Typography, TypographyProps } from "@mui/material";
import {
Button,
styled,
Typography,
type TypographyProps,
} from "@mui/material";
import { t } from "i18next";
import { useRouter } from "next/router";
import { CarouselProvider, DotGroup, Slide, Slider } from "pure-react-carousel";

View file

@ -11,7 +11,7 @@ import FormPaperTitle from "@ente/shared/components/Form/FormPaper/Title";
import OverflowMenu from "@ente/shared/components/OverflowMenu/menu";
import { OverflowMenuOption } from "@ente/shared/components/OverflowMenu/option";
import SingleInputForm, {
SingleInputFormProps,
type SingleInputFormProps,
} from "@ente/shared/components/SingleInputForm";
import { PHOTOS_PAGES as PAGES } from "@ente/shared/constants/pages";
import { ENTE_WEBSITE_LINK } from "@ente/shared/constants/urls";

View file

@ -8,7 +8,7 @@ import { CustomError } from "@ente/shared/error";
import HTTPService from "@ente/shared/network/HTTPService";
import { getToken } from "@ente/shared/storage/localStorage/helpers";
import { getActualKey } from "@ente/shared/user";
import { User } from "@ente/shared/user/types";
import type { User } from "@ente/shared/user/types";
import { REQUEST_BATCH_SIZE } from "constants/api";
import {
ALL_SECTION,

View file

@ -7,7 +7,7 @@ import ComlinkCryptoWorker from "@ente/shared/crypto";
import { DedicatedCryptoWorker } from "@ente/shared/crypto/internal/crypto.worker";
import { CustomError } from "@ente/shared/error";
import { isPlaybackPossible } from "@ente/shared/media/video-playback";
import { Remote } from "comlink";
import type { Remote } from "comlink";
import isElectron from "is-electron";
import * as ffmpeg from "services/ffmpeg";
import { EnteFile } from "types/file";

View file

@ -8,7 +8,7 @@ import { CustomError } from "@ente/shared/error";
import { Events, eventBus } from "@ente/shared/events";
import { LS_KEYS, getData, setData } from "@ente/shared/storage/localStorage";
import { formatDateTimeShort } from "@ente/shared/time/format";
import { User } from "@ente/shared/user/types";
import type { User } from "@ente/shared/user/types";
import QueueProcessor, {
CancellationStatus,
RequestCanceller,

View file

@ -5,7 +5,7 @@ import { nameAndExtension } from "@/next/file";
import log from "@/next/log";
import { wait } from "@/utils/promise";
import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
import { User } from "@ente/shared/user/types";
import type { User } from "@ente/shared/user/types";
import { getLocalCollections } from "services/collectionService";
import downloadManager from "services/download";
import { getAllLocalFiles } from "services/fileService";

View file

@ -1,7 +1,7 @@
import type { Electron } from "@/next/types/ipc";
import { ComlinkWorker } from "@/next/worker/comlink-worker";
import { validateAndGetCreationUnixTimeInMicroSeconds } from "@ente/shared/time";
import { Remote } from "comlink";
import type { Remote } from "comlink";
import {
ffmpegPathPlaceholder,
inputPathPlaceholder,

View file

@ -12,7 +12,7 @@ import { DedicatedCryptoWorker } from "@ente/shared/crypto/internal/crypto.worke
import { CustomError } from "@ente/shared/error";
import { Events, eventBus } from "@ente/shared/events";
import { Canceler } from "axios";
import { Remote } from "comlink";
import type { Remote } from "comlink";
import {
RANDOM_PERCENTAGE_PROGRESS_FOR_PUT,
UPLOAD_RESULT,

View file

@ -9,9 +9,9 @@ import { CustomErrorMessage } from "@/next/types/ipc";
import { ensure } from "@/utils/ensure";
import { ENCRYPTION_CHUNK_SIZE } from "@ente/shared/crypto/constants";
import { DedicatedCryptoWorker } from "@ente/shared/crypto/internal/crypto.worker";
import { B64EncryptionResult } from "@ente/shared/crypto/types";
import type { B64EncryptionResult } from "@ente/shared/crypto/types";
import { CustomError, handleUploadError } from "@ente/shared/error";
import { Remote } from "comlink";
import type { Remote } from "comlink";
import {
NULL_LOCATION,
RANDOM_PERCENTAGE_PROGRESS_FOR_PUT,

View file

@ -8,7 +8,7 @@ import {
getToken,
setLocalMapEnabled,
} from "@ente/shared/storage/localStorage/helpers";
import { AxiosResponse, HttpStatusCode } from "axios";
import { HttpStatusCode, type AxiosResponse } from "axios";
import {
DeleteChallengeResponse,
GetFeatureFlagResponse,

View file

@ -1,4 +1,4 @@
import { User } from "@ente/shared/user/types";
import type { User } from "@ente/shared/user/types";
import { CollectionSelectorAttributes } from "components/Collections/CollectionSelector";
import { FilesDownloadProgressAttributes } from "components/FilesDownloadProgress";
import { TimeStampListItem } from "components/PhotoList";

View file

@ -3,7 +3,7 @@ import { SetDialogBoxAttributes } from "@ente/shared/components/DialogBox/types"
import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
import { REDIRECTS, getRedirectURL } from "constants/redirects";
import { t } from "i18next";
import { NextRouter } from "next/router";
import type { NextRouter } from "next/router";
import billingService from "services/billingService";
import { Plan, Subscription } from "types/billing";
import { SetLoading } from "types/gallery";

View file

@ -3,7 +3,7 @@ import log from "@/next/log";
import { CustomError } from "@ente/shared/error";
import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
import { getUnixTimeInMicroSecondsWithDelta } from "@ente/shared/time";
import { User } from "@ente/shared/user/types";
import type { User } from "@ente/shared/user/types";
import bs58 from "bs58";
import {
ADD_TO_NOT_ALLOWED_COLLECTION,

View file

@ -1,6 +1,6 @@
import { haveWindow } from "@/next/env";
import { ComlinkWorker } from "@/next/worker/comlink-worker";
import { Remote } from "comlink";
import type { Remote } from "comlink";
import { type DedicatedSearchWorker } from "worker/search.worker";
class ComlinkSearchWorker {

View file

@ -8,7 +8,7 @@ import { workerBridge } from "@/next/worker/worker-bridge";
import { withTimeout } from "@/utils/promise";
import ComlinkCryptoWorker from "@ente/shared/crypto";
import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
import { User } from "@ente/shared/user/types";
import type { User } from "@ente/shared/user/types";
import { downloadUsingAnchor } from "@ente/shared/utils";
import { t } from "i18next";
import isElectron from "is-electron";

View file

@ -1,6 +1,6 @@
import log from "@/next/log";
import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
import { User } from "@ente/shared/user/types";
import type { User } from "@ente/shared/user/types";
import { FamilyData, FamilyMember } from "types/user";
export function getLocalFamilyData(): FamilyData {

View file

@ -2,7 +2,7 @@ import log from "@/next/log";
import HTTPService from "@ente/shared/network/HTTPService";
import { getEndpoint } from "@ente/shared/network/api";
import {
import type {
CompleteSRPSetupRequest,
CompleteSRPSetupResponse,
CreateSRPSessionResponse,

View file

@ -1,4 +1,4 @@
import {
import type {
RecoveryKey,
TwoFactorRecoveryResponse,
TwoFactorSecret,
@ -6,12 +6,12 @@ import {
UserVerificationResponse,
} from "@ente/accounts/types/user";
import { APPS, OTT_CLIENTS } from "@ente/shared/apps/constants";
import { B64EncryptionResult } from "@ente/shared/crypto/types";
import type { B64EncryptionResult } from "@ente/shared/crypto/types";
import { ApiError, CustomError } from "@ente/shared/error";
import HTTPService from "@ente/shared/network/HTTPService";
import { getEndpoint } from "@ente/shared/network/api";
import { getToken } from "@ente/shared/storage/localStorage/helpers";
import { KeyAttributes } from "@ente/shared/user/types";
import type { KeyAttributes } from "@ente/shared/user/types";
import { HttpStatusCode } from "axios";
import { TwoFactorType } from "../constants/twofactor";

View file

@ -1,14 +1,14 @@
import { wait } from "@/utils/promise";
import { changeEmail, sendOTTForEmailChange } from "@ente/accounts/api/user";
import { APP_HOMES } from "@ente/shared/apps/constants";
import { PageProps } from "@ente/shared/apps/types";
import type { PageProps } from "@ente/shared/apps/types";
import { VerticallyCentered } from "@ente/shared/components/Container";
import FormPaperFooter from "@ente/shared/components/Form/FormPaper/Footer";
import LinkButton from "@ente/shared/components/LinkButton";
import SubmitButton from "@ente/shared/components/SubmitButton";
import { LS_KEYS, getData, setData } from "@ente/shared/storage/localStorage";
import { Alert, Box, TextField } from "@mui/material";
import { Formik, FormikHelpers } from "formik";
import { Formik, type FormikHelpers } from "formik";
import { t } from "i18next";
import { useRouter } from "next/router";
import { useRef, useState } from "react";

View file

@ -4,7 +4,7 @@ import FormPaperFooter from "@ente/shared/components/Form/FormPaper/Footer";
import FormPaperTitle from "@ente/shared/components/Form/FormPaper/Title";
import LinkButton from "@ente/shared/components/LinkButton";
import SingleInputForm, {
SingleInputFormProps,
type SingleInputFormProps,
} from "@ente/shared/components/SingleInputForm";
import { LS_KEYS, setData } from "@ente/shared/storage/localStorage";
import { Input } from "@mui/material";

View file

@ -34,9 +34,9 @@ import {
Tooltip,
Typography,
} from "@mui/material";
import { Formik, FormikHelpers } from "formik";
import { Formik, type FormikHelpers } from "formik";
import { t } from "i18next";
import { NextRouter } from "next/router";
import type { NextRouter } from "next/router";
import React, { useState } from "react";
import { Trans } from "react-i18next";
import * as Yup from "yup";

View file

@ -1,7 +1,7 @@
import { Typography, TypographyProps } from "@mui/material";
import { FC } from "react";
import { Typography, type TypographyProps } from "@mui/material";
import React from "react";
const InvalidInputMessage: FC<TypographyProps> = (props) => {
const InvalidInputMessage: React.FC<TypographyProps> = (props) => {
return (
<Typography
variant="mini"

View file

@ -6,7 +6,7 @@ import {
} from "@ente/shared/components/Container";
import SubmitButton from "@ente/shared/components/SubmitButton";
import { Box, Typography } from "@mui/material";
import { Formik, FormikHelpers } from "formik";
import { Formik, type FormikHelpers } from "formik";
import { t } from "i18next";
import { useRef, useState } from "react";
import OtpInput from "react-otp-input";

View file

@ -1,4 +1,4 @@
import { TwoFactorSecret } from "@ente/accounts/types/user";
import type { TwoFactorSecret } from "@ente/accounts/types/user";
import CodeBlock from "@ente/shared/components/CodeBlock";
import { Typography } from "@mui/material";
import { t } from "i18next";

View file

@ -1,4 +1,4 @@
import { TwoFactorSecret } from "@ente/accounts/types/user";
import type { TwoFactorSecret } from "@ente/accounts/types/user";
import EnteSpinner from "@ente/shared/components/EnteSpinner";
import { t } from "i18next";

View file

@ -1,7 +1,7 @@
import SetupManualMode from "@ente/accounts/components/two-factor/setup/ManualMode";
import SetupQRMode from "@ente/accounts/components/two-factor/setup/QRMode";
import { SetupMode } from "@ente/accounts/pages/two-factor/setup";
import { TwoFactorSecret } from "@ente/accounts/types/user";
import type { TwoFactorSecret } from "@ente/accounts/types/user";
import { VerticallyCentered } from "@ente/shared/components/Container";
import { useState } from "react";

View file

@ -1,6 +1,6 @@
import ChangeEmailForm from "@ente/accounts/components/ChangeEmail";
import { PAGES } from "@ente/accounts/constants/pages";
import { PageProps } from "@ente/shared/apps/types";
import type { PageProps } from "@ente/shared/apps/types";
import { VerticallyCentered } from "@ente/shared/components/Container";
import FormPaper from "@ente/shared/components/Form/FormPaper";
import FormPaperTitle from "@ente/shared/components/Form/FormPaper/Title";

View file

@ -1,41 +1,38 @@
import { t } from "i18next";
import { useEffect, useState } from "react";
import { startSRPSetup, updateSRPAndKeys } from "@ente/accounts/api/srp";
import SetPasswordForm, {
type SetPasswordFormProps,
} from "@ente/accounts/components/SetPasswordForm";
import { PAGES } from "@ente/accounts/constants/pages";
import {
generateSRPClient,
generateSRPSetupAttributes,
} from "@ente/accounts/services/srp";
import {
generateAndSaveIntermediateKeyAttributes,
generateLoginSubKey,
saveKeyInSessionStore,
} from "@ente/shared/crypto/helpers";
import { LS_KEYS, getData, setData } from "@ente/shared/storage/localStorage";
import { startSRPSetup, updateSRPAndKeys } from "@ente/accounts/api/srp";
import SetPasswordForm, {
SetPasswordFormProps,
} from "@ente/accounts/components/SetPasswordForm";
import { PAGES } from "@ente/accounts/constants/pages";
import { UpdatedKey } from "@ente/accounts/types/user";
import { SESSION_KEYS } from "@ente/shared/storage/sessionStorage";
import { getActualKey } from "@ente/shared/user";
import { KEK, KeyAttributes, User } from "@ente/shared/user/types";
import type { UpdatedKey } from "@ente/accounts/types/user";
import {
convertBase64ToBuffer,
convertBufferToBase64,
} from "@ente/accounts/utils";
import { APP_HOMES } from "@ente/shared/apps/constants";
import { PageProps } from "@ente/shared/apps/types";
import type { PageProps } from "@ente/shared/apps/types";
import { VerticallyCentered } from "@ente/shared/components/Container";
import FormPaper from "@ente/shared/components/Form/FormPaper";
import FormPaperFooter from "@ente/shared/components/Form/FormPaper/Footer";
import FormPaperTitle from "@ente/shared/components/Form/FormPaper/Title";
import LinkButton from "@ente/shared/components/LinkButton";
import ComlinkCryptoWorker from "@ente/shared/crypto";
import {
generateAndSaveIntermediateKeyAttributes,
generateLoginSubKey,
saveKeyInSessionStore,
} from "@ente/shared/crypto/helpers";
import InMemoryStore, { MS_KEYS } from "@ente/shared/storage/InMemoryStore";
import { LS_KEYS, getData, setData } from "@ente/shared/storage/localStorage";
import { SESSION_KEYS } from "@ente/shared/storage/sessionStorage";
import { getActualKey } from "@ente/shared/user";
import type { KEK, KeyAttributes, User } from "@ente/shared/user/types";
import { t } from "i18next";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";
export default function ChangePassword({ appName }: PageProps) {
const [token, setToken] = useState<string>();

View file

@ -1,14 +1,14 @@
import { isDevBuild } from "@/next/env";
import log from "@/next/log";
import { APP_HOMES } from "@ente/shared/apps/constants";
import { PageProps } from "@ente/shared/apps/types";
import type { PageProps } from "@ente/shared/apps/types";
import { VerticallyCentered } from "@ente/shared/components/Container";
import EnteSpinner from "@ente/shared/components/EnteSpinner";
import FormPaper from "@ente/shared/components/Form/FormPaper";
import FormPaperFooter from "@ente/shared/components/Form/FormPaper/Footer";
import LinkButton from "@ente/shared/components/LinkButton";
import VerifyMasterPasswordForm, {
VerifyMasterPasswordFormProps,
type VerifyMasterPasswordFormProps,
} from "@ente/shared/components/VerifyMasterPasswordForm";
import ComlinkCryptoWorker from "@ente/shared/crypto";
import {
@ -17,7 +17,7 @@ import {
generateLoginSubKey,
saveKeyInSessionStore,
} from "@ente/shared/crypto/helpers";
import { B64EncryptionResult } from "@ente/shared/crypto/types";
import type { B64EncryptionResult } from "@ente/shared/crypto/types";
import { CustomError } from "@ente/shared/error";
import { getAccountsURL, getEndpoint } from "@ente/shared/network/api";
import InMemoryStore, { MS_KEYS } from "@ente/shared/storage/InMemoryStore";
@ -38,7 +38,7 @@ import {
removeKey,
setKey,
} from "@ente/shared/storage/sessionStorage";
import { KeyAttributes, User } from "@ente/shared/user/types";
import type { KeyAttributes, User } from "@ente/shared/user/types";
import { Typography, styled } from "@mui/material";
import { t } from "i18next";
import { useRouter } from "next/router";
@ -50,7 +50,7 @@ import {
generateSRPSetupAttributes,
loginViaSRP,
} from "../services/srp";
import { SRPAttributes } from "../types/srp";
import type { SRPAttributes } from "../types/srp";
export default function Credentials({ appContext, appName }: PageProps) {
const { logout } = appContext;

View file

@ -14,7 +14,7 @@ import { useEffect, useState } from "react";
import SetPasswordForm from "@ente/accounts/components/SetPasswordForm";
import { PAGES } from "@ente/accounts/constants/pages";
import { APP_HOMES } from "@ente/shared/apps/constants";
import { PageProps } from "@ente/shared/apps/types";
import type { PageProps } from "@ente/shared/apps/types";
import { VerticallyCentered } from "@ente/shared/components/Container";
import EnteSpinner from "@ente/shared/components/EnteSpinner";
import FormPaper from "@ente/shared/components/Form/FormPaper";
@ -26,7 +26,7 @@ import {
justSignedUp,
setJustSignedUp,
} from "@ente/shared/storage/localStorage/helpers";
import { KeyAttributes, User } from "@ente/shared/user/types";
import type { KeyAttributes, User } from "@ente/shared/user/types";
import { useRouter } from "next/router";
export default function Generate({ appContext, appName }: PageProps) {

View file

@ -1,4 +1,4 @@
import { PageProps } from "@ente/shared/apps/types";
import type { PageProps } from "@ente/shared/apps/types";
import { VerticallyCentered } from "@ente/shared/components/Container";
import EnteSpinner from "@ente/shared/components/EnteSpinner";
import FormPaper from "@ente/shared/components/Form/FormPaper";

View file

@ -2,14 +2,14 @@ import log from "@/next/log";
import { sendOtt } from "@ente/accounts/api/user";
import { PAGES } from "@ente/accounts/constants/pages";
import { APP_HOMES } from "@ente/shared/apps/constants";
import { PageProps } from "@ente/shared/apps/types";
import type { PageProps } from "@ente/shared/apps/types";
import { VerticallyCentered } from "@ente/shared/components/Container";
import FormPaper from "@ente/shared/components/Form/FormPaper";
import FormPaperFooter from "@ente/shared/components/Form/FormPaper/Footer";
import FormPaperTitle from "@ente/shared/components/Form/FormPaper/Title";
import LinkButton from "@ente/shared/components/LinkButton";
import SingleInputForm, {
SingleInputFormProps,
type SingleInputFormProps,
} from "@ente/shared/components/SingleInputForm";
import ComlinkCryptoWorker from "@ente/shared/crypto";
import {
@ -19,7 +19,7 @@ import {
import InMemoryStore, { MS_KEYS } from "@ente/shared/storage/InMemoryStore";
import { LS_KEYS, getData, setData } from "@ente/shared/storage/localStorage";
import { SESSION_KEYS, getKey } from "@ente/shared/storage/sessionStorage";
import { KeyAttributes, User } from "@ente/shared/user/types";
import type { KeyAttributes, User } from "@ente/shared/user/types";
import { t } from "i18next";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";

View file

@ -1,7 +1,7 @@
import SignUp from "@ente/accounts/components/SignUp";
import { PAGES } from "@ente/accounts/constants/pages";
import { LS_KEYS, getData } from "@ente/shared//storage/localStorage";
import { PageProps } from "@ente/shared/apps/types";
import type { PageProps } from "@ente/shared/apps/types";
import { VerticallyCentered } from "@ente/shared/components/Container";
import EnteSpinner from "@ente/shared/components/EnteSpinner";
import FormPaper from "@ente/shared/components/Form/FormPaper";

View file

@ -2,19 +2,19 @@ import log from "@/next/log";
import { recoverTwoFactor, removeTwoFactor } from "@ente/accounts/api/user";
import { PAGES } from "@ente/accounts/constants/pages";
import { TwoFactorType } from "@ente/accounts/constants/twofactor";
import { PageProps } from "@ente/shared/apps/types";
import type { PageProps } from "@ente/shared/apps/types";
import { VerticallyCentered } from "@ente/shared/components/Container";
import { DialogBoxAttributesV2 } from "@ente/shared/components/DialogBoxV2/types";
import type { DialogBoxAttributesV2 } from "@ente/shared/components/DialogBoxV2/types";
import FormPaper from "@ente/shared/components/Form/FormPaper";
import FormPaperFooter from "@ente/shared/components/Form/FormPaper/Footer";
import FormPaperTitle from "@ente/shared/components/Form/FormPaper/Title";
import LinkButton from "@ente/shared/components/LinkButton";
import SingleInputForm, {
SingleInputFormProps,
type SingleInputFormProps,
} from "@ente/shared/components/SingleInputForm";
import { SUPPORT_EMAIL } from "@ente/shared/constants/urls";
import ComlinkCryptoWorker from "@ente/shared/crypto";
import { B64EncryptionResult } from "@ente/shared/crypto/types";
import type { B64EncryptionResult } from "@ente/shared/crypto/types";
import { ApiError } from "@ente/shared/error";
import { LS_KEYS, getData, setData } from "@ente/shared/storage/localStorage";
import { Link } from "@mui/material";

View file

@ -1,12 +1,12 @@
import log from "@/next/log";
import { enableTwoFactor, setupTwoFactor } from "@ente/accounts/api/user";
import VerifyTwoFactor, {
VerifyTwoFactorCallback,
type VerifyTwoFactorCallback,
} from "@ente/accounts/components/two-factor/VerifyForm";
import { TwoFactorSetup } from "@ente/accounts/components/two-factor/setup";
import { TwoFactorSecret } from "@ente/accounts/types/user";
import type { TwoFactorSecret } from "@ente/accounts/types/user";
import { APP_HOMES } from "@ente/shared/apps/constants";
import { PageProps } from "@ente/shared/apps/types";
import type { PageProps } from "@ente/shared/apps/types";
import { VerticallyCentered } from "@ente/shared/components/Container";
import LinkButton from "@ente/shared/components/LinkButton";
import { encryptWithRecoveryKey } from "@ente/shared/crypto/helpers";

View file

@ -1,6 +1,6 @@
import { verifyTwoFactor } from "@ente/accounts/api/user";
import VerifyTwoFactor, {
VerifyTwoFactorCallback,
type VerifyTwoFactorCallback,
} from "@ente/accounts/components/two-factor/VerifyForm";
import { PAGES } from "@ente/accounts/constants/pages";
@ -13,7 +13,7 @@ import LinkButton from "@ente/shared/components/LinkButton";
import { ApiError } from "@ente/shared/error";
import InMemoryStore, { MS_KEYS } from "@ente/shared/storage/InMemoryStore";
import { LS_KEYS, getData, setData } from "@ente/shared/storage/localStorage";
import { User } from "@ente/shared/user/types";
import type { User } from "@ente/shared/user/types";
import { HttpStatusCode } from "axios";
import { t } from "i18next";
import { useRouter } from "next/router";

View file

@ -1,9 +1,5 @@
import { t } from "i18next";
import { useEffect, useState } from "react";
import { Trans } from "react-i18next";
import { UserVerificationResponse } from "@ente/accounts/types/user";
import { PageProps } from "@ente/shared/apps/types";
import type { UserVerificationResponse } from "@ente/accounts/types/user";
import type { PageProps } from "@ente/shared/apps/types";
import { VerticallyCentered } from "@ente/shared/components/Container";
import EnteSpinner from "@ente/shared/components/EnteSpinner";
import FormPaper from "@ente/shared/components/Form/FormPaper";
@ -11,7 +7,7 @@ import FormPaperFooter from "@ente/shared/components/Form/FormPaper/Footer";
import FormPaperTitle from "@ente/shared/components/Form/FormPaper/Title";
import LinkButton from "@ente/shared/components/LinkButton";
import SingleInputForm, {
SingleInputFormProps,
type SingleInputFormProps,
} from "@ente/shared/components/SingleInputForm";
import { ApiError } from "@ente/shared/error";
import { getAccountsURL } from "@ente/shared/network/api";
@ -23,14 +19,17 @@ import {
setIsFirstLogin,
} from "@ente/shared/storage/localStorage/helpers";
import { clearKeys } from "@ente/shared/storage/sessionStorage";
import { KeyAttributes, User } from "@ente/shared/user/types";
import type { KeyAttributes, User } from "@ente/shared/user/types";
import { Box, Typography } from "@mui/material";
import { HttpStatusCode } from "axios";
import { t } from "i18next";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";
import { Trans } from "react-i18next";
import { putAttributes, sendOtt, verifyOtt } from "../api/user";
import { PAGES } from "../constants/pages";
import { configureSRP } from "../services/srp";
import { SRPSetupAttributes } from "../types/srp";
import type { SRPSetupAttributes } from "../types/srp";
export default function VerifyPage({ appContext, appName }: PageProps) {
const { logout } = appContext;

View file

@ -1,5 +1,5 @@
import log from "@/next/log";
import { UserVerificationResponse } from "@ente/accounts/types/user";
import type { UserVerificationResponse } from "@ente/accounts/types/user";
import ComlinkCryptoWorker from "@ente/shared/crypto";
import { generateLoginSubKey } from "@ente/shared/crypto/helpers";
import InMemoryStore, { MS_KEYS } from "@ente/shared/storage/InMemoryStore";
@ -12,7 +12,7 @@ import {
startSRPSetup,
verifySRPSession,
} from "../api/srp";
import { SRPAttributes, SRPSetupAttributes } from "../types/srp";
import type { SRPAttributes, SRPSetupAttributes } from "../types/srp";
import { convertBase64ToBuffer, convertBufferToBase64 } from "../utils";
const SRP_PARAMS = SRP.params["4096"];

View file

@ -1,4 +1,4 @@
import {
import type {
UpdatedKey,
UserVerificationResponse,
} from "@ente/accounts/types/user";

View file

@ -1,4 +1,4 @@
import { KeyAttributes } from "@ente/shared/user/types";
import type { KeyAttributes } from "@ente/shared/user/types";
export interface UserVerificationResponse {
id: number;

View file

@ -1,8 +1,8 @@
import ComlinkCryptoWorker from "@ente/shared/crypto";
import { generateLoginSubKey } from "@ente/shared/crypto/helpers";
import { KeyAttributes } from "@ente/shared/user/types";
import type { KeyAttributes } from "@ente/shared/user/types";
import { generateSRPSetupAttributes } from "../services/srp";
import { SRPSetupAttributes } from "../types/srp";
import type { SRPSetupAttributes } from "../types/srp";
export async function generateKeyAndSRPAttributes(passphrase: string): Promise<{
keyAttributes: KeyAttributes;

View file

@ -0,0 +1,8 @@
{
/* A base TSConfig for typechecking our Next.js apps and packages. */
"extends": "@/build-config/tsconfig-typecheck.json",
"compilerOptions": {
/* Also indicate expectation of a WebWorker runtime */
"lib": ["ESnext", "DOM", "DOM.Iterable", "WebWorker"]
}
}

View file

@ -1,13 +1,4 @@
{
"extends": "@/build-config/tsconfig-typecheck.json",
"compilerOptions": {
/* Also indicate expectation of a WebWorker runtime */
"lib": ["ESnext", "DOM", "DOM.Iterable", "WebWorker"]
},
/* Typecheck all files with the given extensions (here or in subfolders) */
"include": [
"**/*.ts",
"**/*.tsx",
"../../packages/next/global-electron.d.ts"
]
"extends": "@/build-config/tsconfig-next.json",
"include": [".", "../../packages/next/global-electron.d.ts"]
}

View file

@ -1,9 +1,4 @@
{
"extends": "@/build-config/tsconfig-typecheck.json",
"compilerOptions": {
/* Also indicate expectation of a WebWorker runtime */
"lib": ["ESnext", "DOM", "DOM.Iterable", "WebWorker"]
},
/* Typecheck all files with the given extensions (here or in subfolders) */
"include": ["**/*.ts", "**/*.tsx", "**/*.d.ts", "global-electron.d.ts"]
"extends": "@/build-config/tsconfig-next.json",
"include": ["."]
}

View file

@ -1,5 +1,5 @@
import { TwoFactorType } from "@ente/accounts/constants/twofactor";
import { SetDialogBoxAttributesV2 } from "@ente/shared/components/DialogBoxV2/types";
import type { SetDialogBoxAttributesV2 } from "@ente/shared/components/DialogBoxV2/types";
import { APPS } from "./constants";
export interface PageProps {

View file

@ -1,5 +1,5 @@
import { VerticallyCenteredFlex } from "@ente/shared/components/Container";
import { ButtonProps, Typography } from "@mui/material";
import { Typography, type ButtonProps } from "@mui/material";
interface Iprops {
mainText: string;

View file

@ -2,9 +2,9 @@ import ContentCopyIcon from "@mui/icons-material/ContentCopy";
import DoneIcon from "@mui/icons-material/Done";
import {
IconButton,
IconButtonProps,
SvgIconProps,
Tooltip,
type IconButtonProps,
type SvgIconProps,
} from "@mui/material";
import { t } from "i18next";
import { useState } from "react";

View file

@ -1,6 +1,6 @@
import { FreeFlowText } from "@ente/shared/components/Container";
import EnteSpinner from "@ente/shared/components/EnteSpinner";
import { BoxProps } from "@mui/material";
import type { BoxProps } from "@mui/material";
import React from "react";
import CopyButton from "./CopyButton";
import { CodeWrapper, CopyButtonWrapper, Wrapper } from "./styledComponents";

View file

@ -1,10 +1,10 @@
import { SpaceBetweenFlex } from "@ente/shared/components/Container";
import CloseIcon from "@mui/icons-material/Close";
import {
DialogProps,
DialogTitle,
IconButton,
Typography,
type DialogProps,
} from "@mui/material";
const DialogTitleWithCloseButton = (props) => {

View file

@ -4,13 +4,13 @@ import {
Box,
Button,
Dialog,
DialogProps,
Stack,
Typography,
type DialogProps,
} from "@mui/material";
import { t } from "i18next";
import React, { useState } from "react";
import { DialogBoxAttributesV2 } from "./types";
import type { DialogBoxAttributesV2 } from "./types";
type IProps = React.PropsWithChildren<
Omit<DialogProps, "onClose"> & {

View file

@ -1,4 +1,4 @@
import { ButtonProps } from "@mui/material";
import type { ButtonProps } from "@mui/material";
export interface DialogBoxAttributesV2 {
icon?: React.ReactNode;

View file

@ -1,9 +1,9 @@
import Done from "@mui/icons-material/Done";
import {
Button,
ButtonProps,
CircularProgress,
PaletteColor,
type ButtonProps,
type PaletteColor,
} from "@mui/material";
interface Iprops extends ButtonProps {

View file

@ -1,5 +1,5 @@
import CircularProgress, {
CircularProgressProps,
type CircularProgressProps,
} from "@mui/material/CircularProgress";
export default function EnteSpinner(props: CircularProgressProps) {

View file

@ -1,8 +1,8 @@
import { VerticallyCentered } from "@ente/shared/components/Container";
import { BoxProps, Divider } from "@mui/material";
import { FC } from "react";
import { Divider, type BoxProps } from "@mui/material";
import React from "react";
const FormPaperFooter: FC<BoxProps> = ({ sx, style, ...props }) => {
const FormPaperFooter: React.FC<BoxProps> = ({ sx, style, ...props }) => {
return (
<>
<Divider />

View file

@ -1,7 +1,7 @@
import { Typography, TypographyProps } from "@mui/material";
import { FC } from "react";
import { Typography, type TypographyProps } from "@mui/material";
import React from "react";
const FormPaperTitle: FC<TypographyProps> = ({ sx, ...props }) => {
const FormPaperTitle: React.FC<TypographyProps> = ({ sx, ...props }) => {
return (
<Typography variant="h2" sx={{ mb: 8, ...sx }} {...props}>
{props.children}

View file

@ -1,5 +1,5 @@
import { ButtonProps, Link, LinkProps } from "@mui/material";
import React, { FC } from "react";
import { Link, type ButtonProps, type LinkProps } from "@mui/material";
import React from "react";
export type LinkButtonProps = React.PropsWithChildren<{
onClick: () => void;
@ -7,12 +7,9 @@ export type LinkButtonProps = React.PropsWithChildren<{
style?: React.CSSProperties;
}>;
const LinkButton: FC<LinkProps<"button", { color?: ButtonProps["color"] }>> = ({
children,
sx,
color,
...props
}) => {
const LinkButton: React.FC<
LinkProps<"button", { color?: ButtonProps["color"] }>
> = ({ children, sx, color, ...props }) => {
return (
<Link
component="button"

View file

@ -7,7 +7,7 @@ import {
ButtonProps,
MenuItem,
Typography,
TypographyProps,
type TypographyProps,
} from "@mui/material";
import React from "react";
import { CaptionedText } from "../CaptionedText";

View file

@ -1,4 +1,4 @@
import { IconButton, PaperProps, styled } from "@mui/material";
import { IconButton, styled, type PaperProps } from "@mui/material";
import Menu from "@mui/material/Menu";
import React, { useState } from "react";
import { OverflowMenuContext } from "./context";

View file

@ -1,5 +1,5 @@
import { FluidContainer } from "@ente/shared/components/Container";
import { Box, ButtonProps, MenuItem, Typography } from "@mui/material";
import { Box, MenuItem, Typography, type ButtonProps } from "@mui/material";
import React, { useContext } from "react";
import { OverflowMenuContext } from "./context";

View file

@ -1,4 +1,4 @@
import { PageProps } from "@ente/shared/apps/types";
import type { PageProps } from "@ente/shared/apps/types";
import CodeBlock from "@ente/shared/components/CodeBlock";
import DialogTitleWithCloseButton from "@ente/shared/components/DialogBox/TitleWithCloseButton";
import { getRecoveryKey } from "@ente/shared/crypto/helpers";

View file

@ -2,7 +2,7 @@ import { FlexWrapper } from "@ente/shared/components/Container";
import ShowHidePassword from "@ente/shared/components/Form/ShowHidePassword";
import { Button, FormHelperText } from "@mui/material";
import TextField from "@mui/material/TextField";
import { Formik, FormikHelpers, FormikState } from "formik";
import { Formik, type FormikHelpers, type FormikState } from "formik";
import { t } from "i18next";
import React, { useMemo, useState } from "react";
import * as Yup from "yup";

View file

@ -1,6 +1,6 @@
import Done from "@mui/icons-material/Done";
import { Button, ButtonProps, CircularProgress } from "@mui/material";
import { FC } from "react";
import { Button, CircularProgress, type ButtonProps } from "@mui/material";
import React from "react";
export interface SubmitButtonProps {
loading: boolean;
@ -9,7 +9,7 @@ export interface SubmitButtonProps {
disabled?: boolean;
success?: boolean;
}
const SubmitButton: FC<ButtonProps<"button", SubmitButtonProps>> = ({
const SubmitButton: React.FC<ButtonProps<"button", SubmitButtonProps>> = ({
loading,
buttonText,
disabled,

View file

@ -1,13 +1,13 @@
import log from "@/next/log";
import { SRPAttributes } from "@ente/accounts/types/srp";
import { ButtonProps, Input } from "@mui/material";
import type { SRPAttributes } from "@ente/accounts/types/srp";
import { Input, type ButtonProps } from "@mui/material";
import { t } from "i18next";
import SingleInputForm, {
SingleInputFormProps,
type SingleInputFormProps,
} from "../components/SingleInputForm";
import ComlinkCryptoWorker from "../crypto";
import { CustomError } from "../error";
import { KeyAttributes, User } from "../user/types";
import type { KeyAttributes, User } from "../user/types";
export interface VerifyMasterPasswordFormProps {
user: User;

View file

@ -4,7 +4,7 @@ import { LS_KEYS, getData, setData } from "@ente/shared/storage/localStorage";
import { getToken } from "@ente/shared/storage/localStorage/helpers";
import { SESSION_KEYS, setKey } from "@ente/shared/storage/sessionStorage";
import { getActualKey } from "@ente/shared/user";
import { KeyAttributes } from "@ente/shared/user/types";
import type { KeyAttributes } from "@ente/shared/user/types";
import ComlinkCryptoWorker from ".";
const LOGIN_SUB_KEY_LENGTH = 32;

View file

@ -1,5 +1,5 @@
import { ComlinkWorker } from "@/next/worker/comlink-worker";
import { Remote } from "comlink";
import type { Remote } from "comlink";
import { type DedicatedCryptoWorker } from "./internal/crypto.worker";
class ComlinkCryptoWorker {

View file

@ -1,6 +1,6 @@
import * as libsodium from "@ente/shared/crypto/internal/libsodium";
import * as Comlink from "comlink";
import { StateAddress } from "libsodium-wrappers";
import type { StateAddress } from "libsodium-wrappers";
const textDecoder = new TextDecoder();
const textEncoder = new TextEncoder();

View file

@ -1,7 +1,7 @@
import { CustomError } from "@ente/shared/error";
import sodium, { StateAddress } from "libsodium-wrappers";
import sodium, { type StateAddress } from "libsodium-wrappers";
import { ENCRYPTION_CHUNK_SIZE } from "../constants";
import { B64EncryptionResult } from "../types";
import type { B64EncryptionResult } from "../types";
export async function decryptChaChaOneShot(
data: Uint8Array,

View file

@ -1,5 +1,6 @@
import { LS_KEYS, getData, setData } from "@ente/shared/storage/localStorage";
import { Dispatch, SetStateAction, useEffect, useState } from "react";
import type { Dispatch, SetStateAction } from "react";
import { useEffect, useState } from "react";
export function useLocalState<T>(
key: LS_KEYS,

View file

@ -1,5 +1,5 @@
import log from "@/next/log";
import axios, { AxiosRequestConfig, AxiosResponse } from "axios";
import axios, { type AxiosRequestConfig, type AxiosResponse } from "axios";
import { ApiError, CustomError, isApiErrorResponse } from "../error";
interface IHTTPHeaders {

View file

@ -1,4 +1,4 @@
import { FixedColors, ThemeColorsOptions } from "@mui/material";
import type { FixedColors, ThemeColorsOptions } from "@mui/material";
const darkThemeColors: Omit<ThemeColorsOptions, keyof FixedColors> = {
background: {

Some files were not shown because too many files have changed in this diff Show more