add internals file and use it to organize imports
This commit is contained in:
@@ -1,23 +1,25 @@
|
||||
/**
|
||||
* @module structs
|
||||
*/
|
||||
|
||||
import { readID, createID, writeID, ID } from '../utils/ID.js' // eslint-disable-line
|
||||
import { GC } from './GC.js'
|
||||
import {
|
||||
readID,
|
||||
createID,
|
||||
writeID,
|
||||
GC,
|
||||
nextID,
|
||||
AbstractRef,
|
||||
AbstractStruct,
|
||||
replaceStruct,
|
||||
addStruct,
|
||||
addToDeleteSet,
|
||||
ItemDeleted,
|
||||
ID, AbstractType, Y, Transaction // eslint-disable-line
|
||||
} from '../internals.js'
|
||||
|
||||
import * as error from 'lib0/error.js'
|
||||
import * as encoding from 'lib0/encoding.js'
|
||||
import * as decoding from 'lib0/decoding.js'
|
||||
import { ItemType } from './ItemType.js' // eslint-disable-line
|
||||
import { AbstractType } from '../types/AbstractType.js' // eslint-disable-line
|
||||
import { Y } from '../utils/Y.js' // eslint-disable-line
|
||||
import { Transaction, nextID } from '../utils/Transaction.js' // eslint-disable-line
|
||||
import * as maplib from 'lib0/map.js'
|
||||
import * as set from 'lib0/set.js'
|
||||
import * as binary from 'lib0/binary.js'
|
||||
import { AbstractRef, AbstractStruct } from './AbstractStruct.js' // eslint-disable-line
|
||||
import * as error from 'lib0/error.js'
|
||||
import { replaceStruct, addStruct } from '../utils/StructStore.js'
|
||||
import { addToDeleteSet } from '../utils/DeleteSet.js'
|
||||
import { ItemDeleted } from './ItemDeleted.js'
|
||||
|
||||
/**
|
||||
* Split leftItem into two items
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { Y } from '../utils/Y.js' // eslint-disable-line
|
||||
import { ID, createID } from '../utils/ID.js' // eslint-disable-line
|
||||
import { Transaction } from '../utils/Transaction.js' // eslint-disable-line
|
||||
|
||||
import {
|
||||
Y, ID, Transaction // eslint-disable-line
|
||||
} from '../internals.js'
|
||||
|
||||
import * as encoding from 'lib0/encoding.js' // eslint-disable-line
|
||||
import * as error from 'lib0/error.js'
|
||||
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
/**
|
||||
* @module structs
|
||||
*/
|
||||
import { AbstractRef, AbstractStruct } from './AbstractStruct.js'
|
||||
import { ID, readID, createID, writeID } from '../utils/ID.js' // eslint-disable-line
|
||||
import { Transaction } from '../utils/Transaction.js' // eslint-disable-line
|
||||
import {
|
||||
AbstractRef,
|
||||
AbstractStruct,
|
||||
createID,
|
||||
writeID,
|
||||
ID // eslint-disable-line
|
||||
} from '../internals.js'
|
||||
|
||||
import * as decoding from 'lib0/decoding.js'
|
||||
import * as encoding from 'lib0/encoding.js'
|
||||
|
||||
|
||||
@@ -4,14 +4,17 @@
|
||||
|
||||
// TODO: ItemBinary should be able to merge with right (similar to other items). Or the other items (ItemJSON) should not be able to merge - extra byte + consistency
|
||||
|
||||
import { AbstractItem, AbstractItemRef } from './AbstractItem.js'
|
||||
import { AbstractType } from '../types/AbstractType.js' // eslint-disable-line
|
||||
import {
|
||||
AbstractItem,
|
||||
AbstractItemRef,
|
||||
getItemCleanEnd,
|
||||
getItemCleanStart,
|
||||
getItemType,
|
||||
Transaction, ID, AbstractType // eslint-disable-line
|
||||
} from '../internals.js'
|
||||
|
||||
import * as encoding from 'lib0/encoding.js'
|
||||
import * as decoding from 'lib0/decoding.js'
|
||||
import { ID } from '../utils/ID.js' // eslint-disable-line
|
||||
import { Y } from '../utils/Y.js' // eslint-disable-line
|
||||
import { Transaction } from '../utils/Transaction.js' // eslint-disable-line
|
||||
import { getItemCleanEnd, getItemCleanStart, getItemType } from '../utils/StructStore.js'
|
||||
|
||||
export const structBinaryRefNumber = 1
|
||||
|
||||
|
||||
@@ -4,13 +4,17 @@
|
||||
|
||||
// TODO: ItemBinary should be able to merge with right (similar to other items). Or the other items (ItemJSON) should not be able to merge - extra byte + consistency
|
||||
|
||||
import { AbstractItem, AbstractItemRef } from './AbstractItem.js'
|
||||
import {
|
||||
AbstractItem,
|
||||
AbstractItemRef,
|
||||
getItemCleanEnd,
|
||||
getItemCleanStart,
|
||||
getItemType,
|
||||
Transaction, ID, AbstractType // eslint-disable-line
|
||||
} from '../internals.js'
|
||||
|
||||
import * as encoding from 'lib0/encoding.js'
|
||||
import * as decoding from 'lib0/decoding.js'
|
||||
import { ID } from '../utils/ID.js' // eslint-disable-line
|
||||
import { getItemCleanEnd, getItemCleanStart, getItemType } from '../utils/StructStore.js'
|
||||
import { AbstractType } from '../types/AbstractType.js' // eslint-disable-line
|
||||
import { Transaction } from '../utils/Transaction.js' // eslint-disable-line
|
||||
|
||||
export const structDeletedRefNumber = 2
|
||||
|
||||
|
||||
@@ -2,15 +2,17 @@
|
||||
* @module structs
|
||||
*/
|
||||
|
||||
import { AbstractType } from '../types/AbstractType.js' // eslint-disable-line
|
||||
import { AbstractItem, AbstractItemRef } from './AbstractItem.js'
|
||||
import { ItemType } from './ItemType.js' // eslint-disable-line
|
||||
import {
|
||||
AbstractItem,
|
||||
AbstractItemRef,
|
||||
getItemCleanEnd,
|
||||
getItemCleanStart,
|
||||
getItemType,
|
||||
Transaction, ID, AbstractType // eslint-disable-line
|
||||
} from '../internals.js'
|
||||
|
||||
import * as encoding from 'lib0/encoding.js'
|
||||
import * as decoding from 'lib0/decoding.js'
|
||||
import { Y } from '../utils/Y.js' // eslint-disable-line
|
||||
import { ID } from '../utils/ID.js' // eslint-disable-line
|
||||
import { getItemCleanEnd, getItemCleanStart, getItemType } from '../utils/StructStore.js'
|
||||
import { Transaction } from '../utils/Transaction.js' // eslint-disable-line
|
||||
|
||||
export const structEmbedRefNumber = 3
|
||||
|
||||
|
||||
@@ -2,15 +2,17 @@
|
||||
* @module structs
|
||||
*/
|
||||
|
||||
import { AbstractType } from '../types/AbstractType.js' // eslint-disable-line
|
||||
import { AbstractItem, AbstractItemRef } from './AbstractItem.js'
|
||||
import {
|
||||
AbstractItem,
|
||||
AbstractItemRef,
|
||||
getItemCleanEnd,
|
||||
getItemCleanStart,
|
||||
getItemType,
|
||||
Transaction, ID, AbstractType // eslint-disable-line
|
||||
} from '../internals.js'
|
||||
|
||||
import * as encoding from 'lib0/encoding.js'
|
||||
import * as decoding from 'lib0/decoding.js'
|
||||
import { Y } from '../utils/Y.js' // eslint-disable-line
|
||||
import { ID } from '../utils/ID.js' // eslint-disable-line
|
||||
import { ItemType } from './ItemType.js' // eslint-disable-line
|
||||
import { getItemCleanEnd, getItemCleanStart, getItemType } from '../utils/StructStore.js'
|
||||
import { Transaction } from '../utils/Transaction.js' // eslint-disable-line
|
||||
|
||||
export const structFormatRefNumber = 4
|
||||
|
||||
|
||||
@@ -2,15 +2,18 @@
|
||||
* @module structs
|
||||
*/
|
||||
|
||||
import { AbstractType } from '../types/AbstractType.js' // eslint-disable-line
|
||||
import { AbstractItem, AbstractItemRef, splitItem } from './AbstractItem.js'
|
||||
import {
|
||||
AbstractItem,
|
||||
AbstractItemRef,
|
||||
getItemCleanEnd,
|
||||
getItemCleanStart,
|
||||
getItemType,
|
||||
splitItem,
|
||||
Transaction, ID, AbstractType // eslint-disable-line
|
||||
} from '../internals.js'
|
||||
|
||||
import * as encoding from 'lib0/encoding.js'
|
||||
import * as decoding from 'lib0/decoding.js'
|
||||
import { Y } from '../utils/Y.js' // eslint-disable-line
|
||||
import { ID } from '../utils/ID.js' // eslint-disable-line
|
||||
import { ItemType } from './ItemType.js' // eslint-disable-line
|
||||
import { getItemCleanEnd, getItemCleanStart, getItemType } from '../utils/StructStore.js'
|
||||
import { Transaction } from '../utils/Transaction.js' // eslint-disable-line
|
||||
|
||||
export const structJSONRefNumber = 5
|
||||
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
/**
|
||||
* @module structs
|
||||
*/
|
||||
import { AbstractType } from '../types/AbstractType.js' // eslint-disable-line
|
||||
import { AbstractItem, AbstractItemRef, splitItem } from './AbstractItem.js'
|
||||
import {
|
||||
AbstractItem,
|
||||
AbstractItemRef,
|
||||
getItemCleanEnd,
|
||||
getItemCleanStart,
|
||||
getItemType,
|
||||
splitItem,
|
||||
Transaction, ID, AbstractType // eslint-disable-line
|
||||
} from '../internals.js'
|
||||
|
||||
import * as encoding from 'lib0/encoding.js'
|
||||
import * as decoding from 'lib0/decoding.js'
|
||||
import { Y } from '../utils/Y.js' // eslint-disable-line
|
||||
import { ID } from '../utils/ID.js' // eslint-disable-line
|
||||
import { ItemType } from './ItemType.js' // eslint-disable-line
|
||||
import { getItemCleanEnd, getItemCleanStart, getItemType } from '../utils/StructStore.js'
|
||||
import { Transaction } from '../utils/Transaction.js' // eslint-disable-line
|
||||
|
||||
export const structStringRefNumber = 6
|
||||
|
||||
|
||||
@@ -4,22 +4,24 @@
|
||||
|
||||
// TODO: ItemBinary should be able to merge with right (similar to other items). Or the other items (ItemJSON) should not be able to merge - extra byte + consistency
|
||||
|
||||
import { ID } from '../utils/ID.js' // eslint-disable-line
|
||||
import { Y } from '../utils/Y.js' // eslint-disable-line
|
||||
import { AbstractType } from '../types/AbstractType.js' // eslint-disable-line
|
||||
import { AbstractItem, AbstractItemRef } from './AbstractItem.js'
|
||||
import {
|
||||
AbstractItem,
|
||||
AbstractItemRef,
|
||||
getItemCleanEnd,
|
||||
getItemCleanStart,
|
||||
getItemType,
|
||||
readYArray,
|
||||
readYMap,
|
||||
readYText,
|
||||
readYXmlElement,
|
||||
readYXmlFragment,
|
||||
readYXmlHook,
|
||||
readYXmlText,
|
||||
Y, GC, ItemDeleted, Transaction, ID, AbstractType // eslint-disable-line
|
||||
} from '../internals.js'
|
||||
|
||||
import * as encoding from 'lib0/encoding.js' // eslint-disable-line
|
||||
import * as decoding from 'lib0/decoding.js'
|
||||
import { readYArray } from '../types/YArray.js'
|
||||
import { readYMap } from '../types/YMap.js'
|
||||
import { readYText } from '../types/YText.js'
|
||||
import { readYXmlElement, readYXmlFragment } from '../types/YXmlElement.js'
|
||||
import { readYXmlHook } from '../types/YXmlHook.js'
|
||||
import { readYXmlText } from '../types/YXmlText.js'
|
||||
import { getItemCleanEnd, getItemCleanStart, getItemType } from '../utils/StructStore.js'
|
||||
import { Transaction } from '../utils/Transaction.js' // eslint-disable-line
|
||||
import { GC } from './GC.js' // eslint-disable-line
|
||||
import { ItemDeleted } from './ItemDeleted.js' // eslint-disable-line
|
||||
|
||||
/**
|
||||
* @param {Y} y
|
||||
|
||||
Reference in New Issue
Block a user