style: restrict type import (#1589)

This commit is contained in:
Himself65
2023-03-15 11:58:43 -05:00
committed by GitHub
parent 6ab2f83e13
commit efcf1fcaa0
154 changed files with 332 additions and 307 deletions
@@ -1,6 +1,6 @@
import { Workspace as BlocksuiteWorkspace } from '@blocksuite/store';
import assert from 'assert';
import { KyInstance } from 'ky/distribution/types/ky';
import type { KyInstance } from 'ky/distribution/types/ky';
import { MessageCenter } from '../../message';
import type { User } from '../../types';
@@ -12,8 +12,8 @@ import type {
ProviderConstructorParams,
} from '../base';
import { BaseProvider } from '../base';
import type { Apis, WorkspaceDetail } from './apis';
import { getApis, Workspace } from './apis';
import type { Apis, Workspace, WorkspaceDetail } from './apis';
import { getApis } from './apis';
import { createGoogleAuth } from './apis/google';
import { createAuthClient, createBareClient } from './apis/request';
import { WebsocketClient } from './channel';
@@ -1,6 +1,7 @@
import { DebugLogger } from '@affine/debug';
import { initializeApp } from 'firebase/app';
import { connectAuthEmulator, User } from 'firebase/auth';
import type { User } from 'firebase/auth';
import { connectAuthEmulator } from 'firebase/auth';
import {
type Auth as FirebaseAuth,
getAuth as getFirebaseAuth,
@@ -9,7 +10,7 @@ import {
signOut,
} from 'firebase/auth';
import { decode } from 'js-base64';
import { KyInstance } from 'ky/distribution/types/ky';
import type { KyInstance } from 'ky/distribution/types/ky';
import { MessageCenter } from '../../../message';
import { storage } from '../storage';
@@ -1,8 +1,9 @@
export type { Callback } from './google';
import { KyInstance } from 'ky/distribution/types/ky';
import type { KyInstance } from 'ky/distribution/types/ky';
import { createGoogleAuth, getAuthorizer, GoogleAuth } from './google';
import type { createGoogleAuth, GoogleAuth } from './google';
import { getAuthorizer } from './google';
import { createUserApis } from './user';
import { createWorkspaceApis } from './workspace';
@@ -1,7 +1,7 @@
import ky from 'ky-universal';
import { MessageCenter } from '../../../message';
import { GoogleAuth } from './google';
import type { GoogleAuth } from './google';
type KyInstance = typeof ky;
@@ -1,4 +1,4 @@
import { KyInstance } from 'ky/distribution/types/ky';
import type { KyInstance } from 'ky/distribution/types/ky';
export interface GetUserByEmailParams {
email: string;
@@ -1,8 +1,8 @@
import { KyInstance } from 'ky/distribution/types/ky';
import type { KyInstance } from 'ky/distribution/types/ky';
import { MessageCenter } from '../../../message';
import { createBlocksuiteWorkspace as _createBlocksuiteWorkspace } from '../../../utils';
import { GoogleAuth } from './google';
import type { GoogleAuth } from './google';
import RequestError from './request-error';
import type { User } from './user';
const messageCenter = MessageCenter.getInstance();
@@ -2,7 +2,7 @@ import { DebugLogger } from '@affine/debug';
import * as url from 'lib0/url';
import * as websocket from 'lib0/websocket';
import { GoogleAuth } from './apis/google';
import type { GoogleAuth } from './apis/google';
const RECONNECT_INTERVAL_TIME = 500;
const MAX_RECONNECT_TIMES = 50;
+5 -5
View File
@@ -1,12 +1,12 @@
import { DebugLogger } from '@affine/debug';
import { Workspace as BlocksuiteWorkspace } from '@blocksuite/store';
import type { Workspace as BlocksuiteWorkspace } from '@blocksuite/store';
import { MessageCenter } from '../message';
import { User } from '../types';
import type { MessageCenter } from '../message';
import type { User } from '../types';
import type { WorkspaceUnit, WorkspaceUnitCtorParams } from '../workspace-unit';
import type { WorkspaceUnitCollectionScope } from '../workspace-unit-collection';
import { Member } from './affine/apis';
import { Permission } from './affine/apis/workspace';
import type { Member } from './affine/apis';
import type { Permission } from './affine/apis/workspace';
export interface ProviderConstructorParams {
workspaces: WorkspaceUnitCollectionScope;
@@ -1,4 +1,5 @@
import { uuidv4, Workspace as BlocksuiteWorkspace } from '@blocksuite/store';
import type { Workspace as BlocksuiteWorkspace } from '@blocksuite/store';
import { uuidv4 } from '@blocksuite/store';
import assert from 'assert';
import { varStorage as storage } from 'lib0/storage';
@@ -1,11 +1,11 @@
import { GetBlob, PutBlob } from '../ipc/types/blob';
import {
import type { GetBlob, PutBlob } from '../ipc/types/blob';
import type {
GetDocumentParameter,
GetDocumentResponse,
YDocumentUpdate,
} from '../ipc/types/document';
import { CreateUser, GetUserParameters, User } from '../ipc/types/user';
import {
import type { CreateUser, GetUserParameters, User } from '../ipc/types/user';
import type {
CreateWorkspace,
CreateWorkspaceResult,
GetWorkspace,
@@ -1,16 +1,19 @@
import { Workspace as BlocksuiteWorkspace } from '@blocksuite/store';
import type { Workspace as BlocksuiteWorkspace } from '@blocksuite/store';
import assert from 'assert';
import * as Y from 'yjs';
import { User } from '../../types';
import type { User } from '../../types';
import { applyUpdate } from '../../utils';
import type { WorkspaceUnit } from '../../workspace-unit';
import { CreateWorkspaceInfoParams, ProviderConstructorParams } from '../base';
import type {
CreateWorkspaceInfoParams,
ProviderConstructorParams,
} from '../base';
import { LocalProvider } from '../local';
import { loadWorkspaceUnit } from '../local/utils';
import { IPCBlobProvider } from './blocksuite-provider/blob';
import type { IPCMethodsType } from './ipc/methods';
import { WorkspaceWithPermission } from './ipc/types/workspace';
import type { WorkspaceWithPermission } from './ipc/types/workspace';
import { createWorkspaceUnit } from './utils';
/**
@@ -1,13 +1,13 @@
import { invoke } from '@tauri-apps/api';
import { GetBlob, PutBlob } from './types/blob';
import {
import type { GetBlob, PutBlob } from './types/blob';
import type {
GetDocumentParameter,
GetDocumentResponse,
YDocumentUpdate,
} from './types/document';
import { CreateUser, GetUserParameters } from './types/user';
import {
import type { CreateUser, GetUserParameters } from './types/user';
import type {
CreateWorkspace,
CreateWorkspaceResult,
GetWorkspace,
+1 -1
View File
@@ -1,4 +1,4 @@
import { Workspace as BlocksuiteWorkspace } from '@blocksuite/store';
import type { Workspace as BlocksuiteWorkspace } from '@blocksuite/store';
import assert from 'assert';
import { getDefaultHeadImgBlob } from '../utils';