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

View File

@ -3,6 +3,7 @@ import { SettingRow } from '@affine/component/setting-components';
import { isDesktop } from '@affine/env/constant'; import { isDesktop } from '@affine/env/constant';
import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { Button } from '@toeverything/components/button'; import { Button } from '@toeverything/components/button';
import type { SaveDBFileResult } from '@toeverything/infra/type';
import { useCallback } from 'react'; import { useCallback } from 'react';
import type { AffineOfficialWorkspace } from '../../../shared'; import type { AffineOfficialWorkspace } from '../../../shared';
@ -37,7 +38,9 @@ export const ExportPanel = ({ workspace }: ExportPanelProps) => {
const t = useAFFiNEI18N(); const t = useAFFiNEI18N();
const onExport = useCallback(async () => { const onExport = useCallback(async () => {
await syncBlobsToSqliteDb(workspace); await syncBlobsToSqliteDb(workspace);
const result = await window.apis?.dialog.saveDBFileAs(workspaceId); const result: SaveDBFileResult = await window.apis?.dialog.saveDBFileAs(
workspaceId
);
if (result?.error) { if (result?.error) {
toast(t[result.error]()); toast(t[result.error]());
} else if (!result?.canceled) { } 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 { SettingRow } from '@affine/component/setting-components';
import { useAFFiNEI18N } from '@affine/i18n/hooks'; import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { Button } from '@toeverything/components/button'; import { Button } from '@toeverything/components/button';
import type { MoveDBFileResult } from '@toeverything/infra/type';
import { useMemo } from 'react'; import { useMemo } from 'react';
import { useCallback, useEffect, useState } from 'react'; import { useCallback, useEffect, useState } from 'react';
@ -54,7 +55,7 @@ export const StoragePanel = ({ workspace }: StoragePanelProps) => {
setMoveToInProgress(true); setMoveToInProgress(true);
window.apis?.dialog window.apis?.dialog
.moveDBFile(workspaceId) .moveDBFile(workspaceId)
.then(result => { .then((result: MoveDBFileResult) => {
if (!result?.error && !result?.canceled) { if (!result?.error && !result?.canceled) {
toast(t['Move folder success']()); toast(t['Move folder success']());
} else if (result?.error) { } else if (result?.error) {

View File

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

View File

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

View File

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