fix typings and lib0 resolution
This commit is contained in:
parent
2001bec8eb
commit
cb70d7bad3
3494
package-lock.json
generated
3494
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -78,16 +78,17 @@
|
|||||||
"lib0": "^0.2.49"
|
"lib0": "^0.2.49"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-commonjs": "^17.0.0",
|
"@rollup/plugin-commonjs": "^24.0.1",
|
||||||
"@rollup/plugin-node-resolve": "^11.2.1",
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||||
|
"@types/node": "^18.15.5",
|
||||||
"concurrently": "^3.6.1",
|
"concurrently": "^3.6.1",
|
||||||
"typescript": "^4.9.5",
|
|
||||||
"http-server": "^0.12.3",
|
"http-server": "^0.12.3",
|
||||||
"jsdoc": "^3.6.7",
|
"jsdoc": "^3.6.7",
|
||||||
"markdownlint-cli": "^0.23.2",
|
"markdownlint-cli": "^0.23.2",
|
||||||
"rollup": "^2.60.0",
|
"rollup": "^3.20.0",
|
||||||
"standard": "^16.0.4",
|
"standard": "^16.0.4",
|
||||||
"tui-jsdoc-template": "^1.2.2",
|
"tui-jsdoc-template": "^1.2.2",
|
||||||
|
"typescript": "^4.9.5",
|
||||||
"y-protocols": "^1.0.5"
|
"y-protocols": "^1.0.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ export default [{
|
|||||||
plugins: [
|
plugins: [
|
||||||
debugResolve,
|
debugResolve,
|
||||||
nodeResolve({
|
nodeResolve({
|
||||||
mainFields: ['module', 'browser', 'main']
|
mainFields: ['browser', 'module', 'main']
|
||||||
}),
|
}),
|
||||||
commonjs()
|
commonjs()
|
||||||
]
|
]
|
||||||
@ -103,9 +103,10 @@ export default [{
|
|||||||
plugins: [
|
plugins: [
|
||||||
debugResolve,
|
debugResolve,
|
||||||
nodeResolve({
|
nodeResolve({
|
||||||
mainFields: ['module', 'main']
|
mainFields: ['node', 'module', 'main'],
|
||||||
|
exportConditions: ['node', 'module', 'import', 'default']
|
||||||
}),
|
}),
|
||||||
commonjs()
|
commonjs()
|
||||||
],
|
],
|
||||||
external: ['isomorphic.js']
|
external: id => /^lib0\//.test(id)
|
||||||
}]
|
}]
|
||||||
|
@ -171,7 +171,7 @@ export const mergeDeleteSets = dss => {
|
|||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
export const addToDeleteSet = (ds, client, clock, length) => {
|
export const addToDeleteSet = (ds, client, clock, length) => {
|
||||||
map.setIfUndefined(ds.clients, client, () => []).push(new DeleteItem(clock, length))
|
map.setIfUndefined(ds.clients, client, () => /** @type {Array<DeleteItem>} */ ([])).push(new DeleteItem(clock, length))
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createDeleteSet = () => new DeleteSet()
|
export const createDeleteSet = () => new DeleteSet()
|
||||||
@ -251,7 +251,7 @@ export const readDeleteSet = decoder => {
|
|||||||
const client = decoding.readVarUint(decoder.restDecoder)
|
const client = decoding.readVarUint(decoder.restDecoder)
|
||||||
const numberOfDeletes = decoding.readVarUint(decoder.restDecoder)
|
const numberOfDeletes = decoding.readVarUint(decoder.restDecoder)
|
||||||
if (numberOfDeletes > 0) {
|
if (numberOfDeletes > 0) {
|
||||||
const dsField = map.setIfUndefined(ds.clients, client, () => [])
|
const dsField = map.setIfUndefined(ds.clients, client, () => /** @type {Array<DeleteItem>} */ ([]))
|
||||||
for (let i = 0; i < numberOfDeletes; i++) {
|
for (let i = 0; i < numberOfDeletes; i++) {
|
||||||
dsField.push(new DeleteItem(decoder.readDsClock(), decoder.readDsLen()))
|
dsField.push(new DeleteItem(decoder.readDsClock(), decoder.readDsLen()))
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-env node */
|
||||||
|
|
||||||
import * as map from './y-map.tests.js'
|
import * as map from './y-map.tests.js'
|
||||||
import * as array from './y-array.tests.js'
|
import * as array from './y-array.tests.js'
|
||||||
|
@ -134,7 +134,7 @@ export class TestYInstance extends Y.Doc {
|
|||||||
* @param {TestYInstance} remoteClient
|
* @param {TestYInstance} remoteClient
|
||||||
*/
|
*/
|
||||||
_receive (message, remoteClient) {
|
_receive (message, remoteClient) {
|
||||||
map.setIfUndefined(this.receiving, remoteClient, () => []).push(message)
|
map.setIfUndefined(this.receiving, remoteClient, () => /** @type {Array<Uint8Array>} */ ([])).push(message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user