mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-25 09:02:04 +03:00
chore: add @types/addfine__env
to the devDep (#3616)
This commit is contained in:
parent
4d1692db7b
commit
7d16a8348c
@ -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');
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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",
|
||||
|
@ -21,8 +21,6 @@
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"resolveJsonModule": true,
|
||||
"types": ["affine__env"],
|
||||
"typeRoots": ["./node_modules/@types"],
|
||||
|
||||
// Emit
|
||||
"declaration": true,
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user