lucid-extension-sdk
Advanced tools
Comparing version 0.0.133 to 0.0.134
{ | ||
"name": "lucid-extension-sdk", | ||
"version": "0.0.133", | ||
"version": "0.0.134", | ||
"description": "Utility classes for writing Lucid Software editor extensions", | ||
@@ -5,0 +5,0 @@ "main": "sdk/index.js", |
@@ -6,2 +6,3 @@ import { SerializedFieldType } from '../core/data/serializedfield/serializedfields'; | ||
import { DataItemProxy } from './dataitemproxy'; | ||
import { PatchCollectionProxy } from './patchcollectionproxy'; | ||
import { SchemaDefinition } from './schemadefinition'; | ||
@@ -35,2 +36,7 @@ /** | ||
/** | ||
* @returns information about any changes made locally to the collection that have not been synchronized | ||
* with the external data source. | ||
*/ | ||
getLocalChanges(): PatchCollectionProxy | undefined; | ||
/** | ||
* The data items in this collection, organized by their primary key. The primary key is usually calculated | ||
@@ -37,0 +43,0 @@ * from the content of the data item, but may differ from the expected value in some circumstances, e.g. if |
@@ -7,3 +7,5 @@ "use strict"; | ||
const propertystoreproxy_1 = require("../document/propertystoreproxy"); | ||
const branchedcollectionid_1 = require("./branchedcollectionid"); | ||
const dataitemproxy_1 = require("./dataitemproxy"); | ||
const patchcollectionproxy_1 = require("./patchcollectionproxy"); | ||
const schemadefinition_1 = require("./schemadefinition"); | ||
@@ -55,2 +57,14 @@ /** | ||
} | ||
/** | ||
* @returns information about any changes made locally to the collection that have not been synchronized | ||
* with the external data source. | ||
*/ | ||
getLocalChanges() { | ||
const patchCollectionId = (0, branchedcollectionid_1.patchCollectionIdFromPossibleBranchedCollectionId)(this.id); | ||
const original = this.getBranchedFrom(); | ||
if (!patchCollectionId || !original) { | ||
return undefined; | ||
} | ||
return new patchcollectionproxy_1.PatchCollectionProxy(this.client, this, new CollectionProxy(patchCollectionId, this.client), original); | ||
} | ||
patchItems(patch) { | ||
@@ -57,0 +71,0 @@ var _a, _b; |
@@ -13,2 +13,3 @@ /** | ||
find(filter: (item: VALUE, key: KEY) => boolean): VALUE | undefined; | ||
filter(filter: (item: VALUE, key: KEY) => boolean): VALUE[]; | ||
keys(): KEY[]; | ||
@@ -15,0 +16,0 @@ get size(): number; |
@@ -38,2 +38,11 @@ "use strict"; | ||
} | ||
filter(filter) { | ||
const filtered = []; | ||
for (const [key, value] of this) { | ||
if (filter(value, key)) { | ||
filtered.push(value); | ||
} | ||
} | ||
return filtered; | ||
} | ||
keys() { | ||
@@ -40,0 +49,0 @@ return this.getKeys(); |
544949
232
12481