@liveblocks/client
Advanced tools
Comparing version 0.12.0-beta.7 to 0.12.0-beta.8
@@ -164,4 +164,14 @@ import { Op, SerializedCrdtWithId, SerializedList } from "./live"; | ||
toArray(): T[]; | ||
every(predicate: (value: T, index: number) => unknown): boolean; | ||
filter(predicate: (value: T, index: number) => unknown): T[]; | ||
find(predicate: (value: T, index: number) => unknown): T | undefined; | ||
findIndex(predicate: (value: T, index: number) => unknown): number; | ||
forEach(callbackfn: (value: T, index: number) => void): void; | ||
get(index: number): T; | ||
indexOf(searchElement: T, fromIndex?: number): number; | ||
lastIndexOf(searchElement: T, fromIndex?: number): number; | ||
map<U>(callback: (value: T, index: number) => U): U[]; | ||
some(predicate: (value: T, index: number) => unknown): boolean; | ||
[Symbol.iterator](): IterableIterator<T>; | ||
} | ||
export {}; |
@@ -13,3 +13,3 @@ "use strict"; | ||
}; | ||
var _Doc_instances, _Doc_clock, _Doc_items, _Doc_root, _Doc_actor, _Doc_dispatch, _Doc_applyCreateRegister, _Doc_applyDeleteRecordKey, _Doc_applyUpdateRecord, _Doc_applyCreateMap, _Doc_applyCreateList, _Doc_applyCreateObject, _Doc_applyDeleteRecord, _Doc_applySetParentKey, _AbstractCrdt_listeners, _AbstractCrdt_deepListeners, _AbstractCrdt_parent, _AbstractCrdt_doc, _AbstractCrdt_id, _LiveObject_map, _LiveMap_map, _LiveRegister_data, _LiveList_items; | ||
var _Doc_instances, _Doc_clock, _Doc_items, _Doc_root, _Doc_actor, _Doc_dispatch, _Doc_applyCreateRegister, _Doc_applyDeleteRecordKey, _Doc_applyUpdateRecord, _Doc_applyCreateMap, _Doc_applyCreateList, _Doc_applyCreateObject, _Doc_applyDeleteRecord, _Doc_applySetParentKey, _AbstractCrdt_listeners, _AbstractCrdt_deepListeners, _AbstractCrdt_parent, _AbstractCrdt_doc, _AbstractCrdt_id, _LiveObject_map, _LiveMap_map, _LiveRegister_data, _LiveList_items, _LiveListIterator_innerIterator; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -936,8 +936,58 @@ exports.LiveList = exports.LiveMap = exports.LiveObject = exports.Doc = void 0; | ||
} | ||
every(predicate) { | ||
return this.toArray().every(predicate); | ||
} | ||
filter(predicate) { | ||
return this.toArray().filter(predicate); | ||
} | ||
find(predicate) { | ||
return this.toArray().find(predicate); | ||
} | ||
findIndex(predicate) { | ||
return this.toArray().findIndex(predicate); | ||
} | ||
forEach(callbackfn) { | ||
return this.toArray().forEach(callbackfn); | ||
} | ||
get(index) { | ||
return selfOrRegisterValue(__classPrivateFieldGet(this, _LiveList_items, "f")[index][0]); | ||
} | ||
indexOf(searchElement, fromIndex) { | ||
return this.toArray().indexOf(searchElement, fromIndex); | ||
} | ||
lastIndexOf(searchElement, fromIndex) { | ||
return this.toArray().lastIndexOf(searchElement, fromIndex); | ||
} | ||
map(callback) { | ||
return __classPrivateFieldGet(this, _LiveList_items, "f").map((entry, i) => callback(selfOrRegisterValue(entry[0]), i)); | ||
} | ||
some(predicate) { | ||
return this.toArray().some(predicate); | ||
} | ||
[(_LiveList_items = new WeakMap(), Symbol.iterator)]() { | ||
return new LiveListIterator(__classPrivateFieldGet(this, _LiveList_items, "f")); | ||
} | ||
} | ||
exports.LiveList = LiveList; | ||
_LiveList_items = new WeakMap(); | ||
class LiveListIterator { | ||
constructor(items) { | ||
_LiveListIterator_innerIterator.set(this, void 0); | ||
__classPrivateFieldSet(this, _LiveListIterator_innerIterator, items[Symbol.iterator](), "f"); | ||
} | ||
[(_LiveListIterator_innerIterator = new WeakMap(), Symbol.iterator)]() { | ||
return this; | ||
} | ||
next() { | ||
const result = __classPrivateFieldGet(this, _LiveListIterator_innerIterator, "f").next(); | ||
if (result.done) { | ||
return { | ||
done: true, | ||
value: undefined, | ||
}; | ||
} | ||
return { | ||
value: selfOrRegisterValue(result.value[0]), | ||
}; | ||
} | ||
} | ||
function deserialize(entry, parentToChildren, doc) { | ||
@@ -944,0 +994,0 @@ switch (entry[1].type) { |
import { Others, Presence, ClientOptions, Room, MyPresenceCallback, OthersEventCallback, AuthEndpoint, EventCallback, User, Connection, ErrorCallback, AuthenticationToken, ConnectionCallback } from "./types"; | ||
import { ClientMessage, Op } from "./live"; | ||
import { LiveObject } from "./doc"; | ||
declare type IdFactory = () => string; | ||
@@ -85,3 +84,3 @@ export declare type State = { | ||
getStorage: <TRoot>() => Promise<{ | ||
root: LiveObject<TRoot>; | ||
root: import("./doc").LiveObject<TRoot>; | ||
}>; | ||
@@ -88,0 +87,0 @@ selectors: { |
@@ -164,4 +164,14 @@ import { Op, SerializedCrdtWithId, SerializedList } from "./live"; | ||
toArray(): T[]; | ||
every(predicate: (value: T, index: number) => unknown): boolean; | ||
filter(predicate: (value: T, index: number) => unknown): T[]; | ||
find(predicate: (value: T, index: number) => unknown): T | undefined; | ||
findIndex(predicate: (value: T, index: number) => unknown): number; | ||
forEach(callbackfn: (value: T, index: number) => void): void; | ||
get(index: number): T; | ||
indexOf(searchElement: T, fromIndex?: number): number; | ||
lastIndexOf(searchElement: T, fromIndex?: number): number; | ||
map<U>(callback: (value: T, index: number) => U): U[]; | ||
some(predicate: (value: T, index: number) => unknown): boolean; | ||
[Symbol.iterator](): IterableIterator<T>; | ||
} | ||
export {}; |
@@ -12,3 +12,3 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { | ||
}; | ||
var _Doc_instances, _Doc_clock, _Doc_items, _Doc_root, _Doc_actor, _Doc_dispatch, _Doc_applyCreateRegister, _Doc_applyDeleteRecordKey, _Doc_applyUpdateRecord, _Doc_applyCreateMap, _Doc_applyCreateList, _Doc_applyCreateObject, _Doc_applyDeleteRecord, _Doc_applySetParentKey, _AbstractCrdt_listeners, _AbstractCrdt_deepListeners, _AbstractCrdt_parent, _AbstractCrdt_doc, _AbstractCrdt_id, _LiveObject_map, _LiveMap_map, _LiveRegister_data, _LiveList_items; | ||
var _Doc_instances, _Doc_clock, _Doc_items, _Doc_root, _Doc_actor, _Doc_dispatch, _Doc_applyCreateRegister, _Doc_applyDeleteRecordKey, _Doc_applyUpdateRecord, _Doc_applyCreateMap, _Doc_applyCreateList, _Doc_applyCreateObject, _Doc_applyDeleteRecord, _Doc_applySetParentKey, _AbstractCrdt_listeners, _AbstractCrdt_deepListeners, _AbstractCrdt_parent, _AbstractCrdt_doc, _AbstractCrdt_id, _LiveObject_map, _LiveMap_map, _LiveRegister_data, _LiveList_items, _LiveListIterator_innerIterator; | ||
import { remove } from "./utils"; | ||
@@ -930,7 +930,57 @@ import { CrdtType, OpType, } from "./live"; | ||
} | ||
every(predicate) { | ||
return this.toArray().every(predicate); | ||
} | ||
filter(predicate) { | ||
return this.toArray().filter(predicate); | ||
} | ||
find(predicate) { | ||
return this.toArray().find(predicate); | ||
} | ||
findIndex(predicate) { | ||
return this.toArray().findIndex(predicate); | ||
} | ||
forEach(callbackfn) { | ||
return this.toArray().forEach(callbackfn); | ||
} | ||
get(index) { | ||
return selfOrRegisterValue(__classPrivateFieldGet(this, _LiveList_items, "f")[index][0]); | ||
} | ||
indexOf(searchElement, fromIndex) { | ||
return this.toArray().indexOf(searchElement, fromIndex); | ||
} | ||
lastIndexOf(searchElement, fromIndex) { | ||
return this.toArray().lastIndexOf(searchElement, fromIndex); | ||
} | ||
map(callback) { | ||
return __classPrivateFieldGet(this, _LiveList_items, "f").map((entry, i) => callback(selfOrRegisterValue(entry[0]), i)); | ||
} | ||
some(predicate) { | ||
return this.toArray().some(predicate); | ||
} | ||
[(_LiveList_items = new WeakMap(), Symbol.iterator)]() { | ||
return new LiveListIterator(__classPrivateFieldGet(this, _LiveList_items, "f")); | ||
} | ||
} | ||
_LiveList_items = new WeakMap(); | ||
class LiveListIterator { | ||
constructor(items) { | ||
_LiveListIterator_innerIterator.set(this, void 0); | ||
__classPrivateFieldSet(this, _LiveListIterator_innerIterator, items[Symbol.iterator](), "f"); | ||
} | ||
[(_LiveListIterator_innerIterator = new WeakMap(), Symbol.iterator)]() { | ||
return this; | ||
} | ||
next() { | ||
const result = __classPrivateFieldGet(this, _LiveListIterator_innerIterator, "f").next(); | ||
if (result.done) { | ||
return { | ||
done: true, | ||
value: undefined, | ||
}; | ||
} | ||
return { | ||
value: selfOrRegisterValue(result.value[0]), | ||
}; | ||
} | ||
} | ||
function deserialize(entry, parentToChildren, doc) { | ||
@@ -937,0 +987,0 @@ switch (entry[1].type) { |
import { Others, Presence, ClientOptions, Room, MyPresenceCallback, OthersEventCallback, AuthEndpoint, EventCallback, User, Connection, ErrorCallback, AuthenticationToken, ConnectionCallback } from "./types"; | ||
import { ClientMessage, Op } from "./live"; | ||
import { LiveObject } from "./doc"; | ||
declare type IdFactory = () => string; | ||
@@ -85,3 +84,3 @@ export declare type State = { | ||
getStorage: <TRoot>() => Promise<{ | ||
root: LiveObject<TRoot>; | ||
root: import("./doc").LiveObject<TRoot>; | ||
}>; | ||
@@ -88,0 +87,0 @@ selectors: { |
{ | ||
"name": "@liveblocks/client", | ||
"version": "0.12.0-beta.7", | ||
"version": "0.12.0-beta.8", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib/cjs/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
199163
5581