mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 12:06:35 +08:00
chore: sort imports
This commit is contained in:
@@ -184,11 +184,11 @@ export const getDataExporter = () => {
|
||||
return { importData, exportData, hasExporter, installExporter };
|
||||
};
|
||||
|
||||
export { YjsAdapter } from './yjs';
|
||||
export type { YjsContentOperation, YjsInitOptions } from './yjs';
|
||||
export type {
|
||||
AsyncDatabaseAdapter,
|
||||
BlockPosition,
|
||||
BlockInstance,
|
||||
ContentOperation,
|
||||
};
|
||||
export type { YjsInitOptions, YjsContentOperation } from './yjs';
|
||||
export { YjsAdapter } from './yjs';
|
||||
|
||||
@@ -5,12 +5,12 @@ import {
|
||||
transact,
|
||||
} from 'yjs';
|
||||
|
||||
import { BlockInstance, BlockListener, HistoryManager } from '../index';
|
||||
import { BlockItem, BlockTypes } from '../../types';
|
||||
import { BlockInstance, BlockListener, HistoryManager } from '../index';
|
||||
|
||||
import { YjsContentOperation } from './operation';
|
||||
import { ChildrenListenerHandler, ContentListenerHandler } from './listener';
|
||||
import { YjsHistoryManager } from './history';
|
||||
import { ChildrenListenerHandler, ContentListenerHandler } from './listener';
|
||||
import { YjsContentOperation } from './operation';
|
||||
|
||||
const GET_BLOCK_ITEM = Symbol('GET_BLOCK_ITEM');
|
||||
|
||||
|
||||
@@ -5,17 +5,17 @@ import { Buffer } from 'buffer';
|
||||
import { saveAs } from 'file-saver';
|
||||
import { fromEvent } from 'file-selector';
|
||||
import LRUCache from 'lru-cache';
|
||||
import { debounce } from 'ts-debounce';
|
||||
import { nanoid } from 'nanoid';
|
||||
import { debounce } from 'ts-debounce';
|
||||
import { Awareness } from 'y-protocols/awareness.js';
|
||||
import {
|
||||
Doc,
|
||||
Array as YArray,
|
||||
Map as YMap,
|
||||
transact,
|
||||
encodeStateAsUpdate,
|
||||
applyUpdate,
|
||||
Array as YArray,
|
||||
Doc,
|
||||
encodeStateAsUpdate,
|
||||
Map as YMap,
|
||||
snapshot,
|
||||
transact,
|
||||
} from 'yjs';
|
||||
|
||||
import {
|
||||
@@ -31,12 +31,12 @@ import { getLogger, sha3, sleep } from '../../utils';
|
||||
import { YjsRemoteBinaries } from './binary';
|
||||
import { YjsBlockInstance } from './block';
|
||||
import { GateKeeper } from './gatekeeper';
|
||||
import {
|
||||
YjsContentOperation,
|
||||
DO_NOT_USE_THIS_OR_YOU_WILL_BE_FIRED_SYMBOL_INTO_INNER as INTO_INNER,
|
||||
} from './operation';
|
||||
import { EmitEvents, Suspend } from './listener';
|
||||
import { YjsHistoryManager } from './history';
|
||||
import { EmitEvents, Suspend } from './listener';
|
||||
import {
|
||||
DO_NOT_USE_THIS_OR_YOU_WILL_BE_FIRED_SYMBOL_INTO_INNER as INTO_INNER,
|
||||
YjsContentOperation,
|
||||
} from './operation';
|
||||
import { YjsProvider } from './provider';
|
||||
|
||||
declare const JWT_DEV: boolean;
|
||||
@@ -142,6 +142,8 @@ async function _initYjsDatabase(
|
||||
|
||||
export type { YjsBlockInstance } from './block';
|
||||
export type { YjsContentOperation } from './operation';
|
||||
export { getYjsProviders } from './provider';
|
||||
export type { YjsProviderOptions } from './provider';
|
||||
|
||||
export type YjsInitOptions = {
|
||||
userId?: string;
|
||||
@@ -149,9 +151,6 @@ export type YjsInitOptions = {
|
||||
provider?: Record<string, YjsProvider>;
|
||||
};
|
||||
|
||||
export { getYjsProviders } from './provider';
|
||||
export type { YjsProviderOptions } from './provider';
|
||||
|
||||
export class YjsAdapter implements AsyncDatabaseAdapter<YjsContentOperation> {
|
||||
private readonly _provider: YjsProviders;
|
||||
private readonly _doc: Doc; // doc instance
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Doc } from 'yjs';
|
||||
import { Awareness } from 'y-protocols/awareness.js';
|
||||
import { Doc } from 'yjs';
|
||||
|
||||
import {
|
||||
IndexedDBProvider,
|
||||
|
||||
@@ -8,10 +8,10 @@ import {
|
||||
MapOperation,
|
||||
} from '../adapter';
|
||||
import {
|
||||
BlockTypes,
|
||||
BlockTypeKeys,
|
||||
BlockFlavors,
|
||||
BlockFlavorKeys,
|
||||
BlockFlavors,
|
||||
BlockTypeKeys,
|
||||
BlockTypes,
|
||||
} from '../types';
|
||||
import { getLogger } from '../utils';
|
||||
|
||||
|
||||
@@ -8,5 +8,5 @@ export type BlockSearchItem = Partial<
|
||||
|
||||
export { BaseBlock } from './base';
|
||||
export type { Decoration, ReadableContentExporter } from './base';
|
||||
export { BlockIndexer } from './indexer';
|
||||
export type { BlockCapability } from './capability';
|
||||
export { BlockIndexer } from './indexer';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* eslint-disable max-lines */
|
||||
import { createNewSortInstance } from 'fast-sort';
|
||||
import { deflateSync, inflateSync, strToU8, strFromU8 } from 'fflate';
|
||||
import { deflateSync, inflateSync, strFromU8, strToU8 } from 'fflate';
|
||||
import { Document as DocumentIndexer, DocumentSearchOptions } from 'flexsearch';
|
||||
import { get, set, keys, del, createStore } from 'idb-keyval';
|
||||
import { createStore, del, get, keys, set } from 'idb-keyval';
|
||||
import produce from 'immer';
|
||||
import LRUCache from 'lru-cache';
|
||||
import sift, { Query } from 'sift';
|
||||
|
||||
@@ -4,18 +4,18 @@ import LRUCache from 'lru-cache';
|
||||
|
||||
import {
|
||||
AsyncDatabaseAdapter,
|
||||
YjsAdapter,
|
||||
YjsInitOptions,
|
||||
YjsContentOperation,
|
||||
ChangedStates,
|
||||
BlockListener,
|
||||
BlockInstance,
|
||||
ContentOperation,
|
||||
HistoryManager,
|
||||
ContentTypes,
|
||||
BlockListener,
|
||||
ChangedStates,
|
||||
Connectivity,
|
||||
ContentOperation,
|
||||
ContentTypes,
|
||||
DataExporter,
|
||||
getDataExporter,
|
||||
HistoryManager,
|
||||
YjsAdapter,
|
||||
YjsContentOperation,
|
||||
YjsInitOptions,
|
||||
} from './adapter';
|
||||
import {
|
||||
getYjsProviders,
|
||||
@@ -30,14 +30,14 @@ import {
|
||||
} from './block';
|
||||
import { QueryIndexMetadata } from './block/indexer';
|
||||
import {
|
||||
BlockTypes,
|
||||
BlockTypeKeys,
|
||||
BlockFlavors,
|
||||
UUID,
|
||||
BlockFlavorKeys,
|
||||
BlockFlavors,
|
||||
BlockItem,
|
||||
ExcludeFunction,
|
||||
BlockTypeKeys,
|
||||
BlockTypes,
|
||||
BucketBackend,
|
||||
ExcludeFunction,
|
||||
UUID,
|
||||
} from './types';
|
||||
import { BlockEventBus, genUUID, getLogger } from './utils';
|
||||
|
||||
@@ -649,18 +649,18 @@ export type BlockInitOptions = NonNullable<
|
||||
>;
|
||||
|
||||
export type {
|
||||
TextOperation,
|
||||
ArrayOperation,
|
||||
MapOperation,
|
||||
ChangedStates,
|
||||
Connectivity,
|
||||
MapOperation,
|
||||
TextOperation,
|
||||
} from './adapter';
|
||||
export type {
|
||||
BlockSearchItem,
|
||||
Decoration as BlockDecoration,
|
||||
ReadableContentExporter as BlockContentExporter,
|
||||
} from './block';
|
||||
export type { BlockTypeKeys } from './types';
|
||||
export { BlockTypes, BucketBackend as BlockBackend } from './types';
|
||||
export type { BlockTypeKeys } from './types';
|
||||
export { isBlock } from './utils';
|
||||
export type { QueryIndexMetadata };
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
export { BlockTypes, BlockFlavors } from './block';
|
||||
export type { BlockTypeKeys, BlockFlavorKeys, BlockItem } from './block';
|
||||
export type { UUID } from './uuid';
|
||||
export { BlockFlavors, BlockTypes } from './block';
|
||||
export type { BlockFlavorKeys, BlockItem, BlockTypeKeys } from './block';
|
||||
export type { ExcludeFunction } from './utils';
|
||||
export type { UUID } from './uuid';
|
||||
|
||||
function getLocation() {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user