chore: add @types/addfine__env to the devDep (#3616)

This commit is contained in:
Camol 2023-08-08 23:46:23 +08:00 committed by GitHub
parent 4d1692db7b
commit 7d16a8348c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 7 deletions

View File

@ -10,6 +10,10 @@ import { DebugLogger } from '@affine/debug';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { HelpIcon } from '@blocksuite/icons';
import { Button } from '@toeverything/components/button';
import type {
LoadDBFileResult,
SelectDBFileLocationResult,
} from '@toeverything/infra/type';
import { useSetAtom } from 'jotai';
import type { KeyboardEvent } from 'react';
import { useEffect } from 'react';
@ -134,7 +138,8 @@ const SetDBLocationContent = ({
}
setOpening(true);
(async function () {
const result = await window.apis?.dialog.selectDBFileLocation();
const result: SelectDBFileLocationResult =
await window.apis?.dialog.selectDBFileLocation();
setOpening(false);
if (result?.filePath) {
onConfirmLocation(result.filePath);
@ -266,7 +271,7 @@ export const CreateWorkspaceModal = ({
}
logger.info('load db file');
setStep(undefined);
const result = await window.apis.dialog.loadDBFile();
const result: LoadDBFileResult = await window.apis.dialog.loadDBFile();
if (result.workspaceId && !canceled) {
setAddedId(result.workspaceId);
setStep('set-syncing-mode');

View File

@ -3,6 +3,7 @@ import { SettingRow } from '@affine/component/setting-components';
import { isDesktop } from '@affine/env/constant';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { Button } from '@toeverything/components/button';
import type { SaveDBFileResult } from '@toeverything/infra/type';
import { useCallback } from 'react';
import type { AffineOfficialWorkspace } from '../../../shared';
@ -37,7 +38,9 @@ export const ExportPanel = ({ workspace }: ExportPanelProps) => {
const t = useAFFiNEI18N();
const onExport = useCallback(async () => {
await syncBlobsToSqliteDb(workspace);
const result = await window.apis?.dialog.saveDBFileAs(workspaceId);
const result: SaveDBFileResult = await window.apis?.dialog.saveDBFileAs(
workspaceId
);
if (result?.error) {
toast(t[result.error]());
} else if (!result?.canceled) {

View File

@ -2,6 +2,7 @@ import { FlexWrapper, toast, Tooltip } from '@affine/component';
import { SettingRow } from '@affine/component/setting-components';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { Button } from '@toeverything/components/button';
import type { MoveDBFileResult } from '@toeverything/infra/type';
import { useMemo } from 'react';
import { useCallback, useEffect, useState } from 'react';
@ -54,7 +55,7 @@ export const StoragePanel = ({ workspace }: StoragePanelProps) => {
setMoveToInProgress(true);
window.apis?.dialog
.moveDBFile(workspaceId)
.then(result => {
.then((result: MoveDBFileResult) => {
if (!result?.error && !result?.canceled) {
toast(t['Move folder success']());
} else if (result?.error) {

View File

@ -71,6 +71,7 @@
"@taplo/cli": "^0.5.2",
"@testing-library/react": "^14.0.0",
"@toeverything/infra": "workspace:*",
"@types/affine__env": "workspace:*",
"@types/eslint": "^8.44.2",
"@types/node": "^18.17.1",
"@typescript-eslint/eslint-plugin": "^6.2.1",

View File

@ -21,8 +21,6 @@
"module": "ESNext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"types": ["affine__env"],
"typeRoots": ["./node_modules/@types"],
// Emit
"declaration": true,

View File

@ -480,6 +480,7 @@ __metadata:
"@taplo/cli": ^0.5.2
"@testing-library/react": ^14.0.0
"@toeverything/infra": "workspace:*"
"@types/affine__env": "workspace:*"
"@types/eslint": ^8.44.2
"@types/node": ^18.17.1
"@typescript-eslint/eslint-plugin": ^6.2.1
@ -11392,7 +11393,7 @@ __metadata:
languageName: node
linkType: hard
"@types/affine__env@workspace:packages/@types/env":
"@types/affine__env@workspace:*, @types/affine__env@workspace:packages/@types/env":
version: 0.0.0-use.local
resolution: "@types/affine__env@workspace:packages/@types/env"
dependencies: