mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
style: restrict type import (#1589)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { DebugLogger } from '@affine/debug';
|
||||
import { Workspace as BlocksuiteWorkspace } from '@blocksuite/store';
|
||||
import type { Workspace as BlocksuiteWorkspace } from '@blocksuite/store';
|
||||
import assert from 'assert';
|
||||
|
||||
import { MessageCenter } from './message';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Observable } from 'lib0/observable';
|
||||
|
||||
import { Message } from '../types';
|
||||
import type { Message } from '../types';
|
||||
import { MessageCode, messages } from './code';
|
||||
|
||||
export class MessageCenter extends Observable<string> {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,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';
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
// memberCount: number;
|
||||
// provider: string;
|
||||
// };
|
||||
import type { DebugLogger } from '@affine/debug';
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
@@ -24,8 +25,7 @@ export type User = {
|
||||
};
|
||||
|
||||
// export type WorkspaceMeta = Pick<WorkspaceInfo, 'name' | 'avatar'>;
|
||||
|
||||
export type Logger = typeof import('@affine/debug').DebugLogger;
|
||||
export type Logger = DebugLogger;
|
||||
|
||||
export type Message = {
|
||||
code: number;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { __unstableSchemas, builtInSchemas } from '@blocksuite/blocks/models';
|
||||
import {
|
||||
StoreOptions,
|
||||
Workspace as BlocksuiteWorkspace,
|
||||
} from '@blocksuite/store';
|
||||
import type { StoreOptions } from '@blocksuite/store';
|
||||
import { Workspace as BlocksuiteWorkspace } from '@blocksuite/store';
|
||||
|
||||
export const createBlocksuiteWorkspace = (options: StoreOptions) => {
|
||||
return new BlocksuiteWorkspace({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {
|
||||
import type {
|
||||
BlobOptionsGetter,
|
||||
Workspace as BlocksuiteWorkspace,
|
||||
} from '@blocksuite/store';
|
||||
|
||||
Reference in New Issue
Block a user