parent
a59ecce233
commit
10ec863635
@ -1,20 +0,0 @@ |
||||
import type { Dataset } from "@rdfjs/types"; |
||||
import type { ObjectNode } from "@ldo/rdf-utils"; |
||||
import type { ArrayProxyTarget } from "./createArrayHandler"; |
||||
import type { |
||||
_getNodeAtIndex, |
||||
_getUnderlyingArrayTarget, |
||||
_getUnderlyingDataset, |
||||
_getUnderlyingMatch, |
||||
_proxyContext, |
||||
} from "../types"; |
||||
import { _getUnderlyingNode } from "../types"; |
||||
import type { ProxyContext } from "../ProxyContext"; |
||||
|
||||
export type ArrayProxy = Array<unknown> & { |
||||
readonly [_getUnderlyingDataset]: Dataset; |
||||
readonly [_getUnderlyingMatch]: ArrayProxyTarget[0]; |
||||
readonly [_getNodeAtIndex]: (index: number) => ObjectNode | undefined; |
||||
readonly [_getUnderlyingArrayTarget]: ArrayProxyTarget; |
||||
[_proxyContext]: ProxyContext; |
||||
}; |
@ -1,219 +0,0 @@ |
||||
import type { ArrayProxyTarget } from "./createArrayHandler"; |
||||
import type { ObjectJsonRepresentation } from "../util/nodeToJsonldRepresentation"; |
||||
import { nodeToJsonldRepresentation } from "../util/nodeToJsonldRepresentation"; |
||||
import { modifyArray } from "./modifyArray"; |
||||
import type { ProxyContext } from "../ProxyContext"; |
||||
|
||||
export type methodBuilder<Return> = ( |
||||
target: ArrayProxyTarget, |
||||
key: string, |
||||
proxyContext: ProxyContext, |
||||
) => Return; |
||||
|
||||
export interface ArrayMethodBuildersType { |
||||
copyWithin: methodBuilder<Array<ObjectJsonRepresentation>["copyWithin"]>; |
||||
fill: methodBuilder<Array<ObjectJsonRepresentation>["fill"]>; |
||||
pop: methodBuilder<Array<ObjectJsonRepresentation>["pop"]>; |
||||
push: methodBuilder<Array<ObjectJsonRepresentation>["push"]>; |
||||
reverse: methodBuilder<Array<ObjectJsonRepresentation>["reverse"]>; |
||||
shift: methodBuilder<Array<ObjectJsonRepresentation>["shift"]>; |
||||
sort: methodBuilder<Array<ObjectJsonRepresentation>["sort"]>; |
||||
splice: methodBuilder<Array<ObjectJsonRepresentation>["splice"]>; |
||||
unshift: methodBuilder<Array<ObjectJsonRepresentation>["unshift"]>; |
||||
} |
||||
|
||||
export const methodNames: Set<keyof ArrayMethodBuildersType> = new Set([ |
||||
"copyWithin", |
||||
"fill", |
||||
"pop", |
||||
"push", |
||||
"reverse", |
||||
"shift", |
||||
"sort", |
||||
"splice", |
||||
"unshift", |
||||
]); |
||||
|
||||
export const arrayMethodsBuilders: ArrayMethodBuildersType = { |
||||
copyWithin: (target, key, proxyContext) => { |
||||
return (targetIndex, start, end) => { |
||||
return modifyArray( |
||||
{ |
||||
target, |
||||
key, |
||||
quadsToDelete: (quads) => { |
||||
const oldQuads = [...quads]; |
||||
const newQuadSet = new Set( |
||||
quads.copyWithin(targetIndex, start, end), |
||||
); |
||||
return oldQuads.filter((oldQuad) => !newQuadSet.has(oldQuad)); |
||||
}, |
||||
modifyCoreArray: (coreArray) => { |
||||
coreArray.copyWithin(targetIndex, start, end); |
||||
return proxyContext.createArrayProxy( |
||||
target[0], |
||||
target[2], |
||||
) as ObjectJsonRepresentation[]; |
||||
}, |
||||
}, |
||||
proxyContext, |
||||
); |
||||
}; |
||||
}, |
||||
fill: (target, key, proxyContext) => { |
||||
return (value, start, end) => { |
||||
return modifyArray( |
||||
{ |
||||
target, |
||||
key, |
||||
toAdd: [value], |
||||
quadsToDelete: (quads) => { |
||||
return quads.slice(start, end); |
||||
}, |
||||
modifyCoreArray: (coreArray, addedValues) => { |
||||
coreArray.fill(addedValues[0], start, end); |
||||
return proxyContext.createArrayProxy( |
||||
target[0], |
||||
target[2], |
||||
) as ObjectJsonRepresentation[]; |
||||
}, |
||||
}, |
||||
proxyContext, |
||||
); |
||||
}; |
||||
}, |
||||
pop: (target, key, proxyContext) => { |
||||
return () => { |
||||
return modifyArray( |
||||
{ |
||||
target, |
||||
key, |
||||
quadsToDelete: (quads) => { |
||||
return quads[quads.length - 1] ? [quads[quads.length - 1]] : []; |
||||
}, |
||||
modifyCoreArray: (coreArray) => { |
||||
const popped = coreArray.pop(); |
||||
return popped |
||||
? nodeToJsonldRepresentation(popped, proxyContext) |
||||
: undefined; |
||||
}, |
||||
}, |
||||
proxyContext, |
||||
); |
||||
}; |
||||
}, |
||||
push: (target, key, proxyContext) => { |
||||
return (...args) => { |
||||
return modifyArray( |
||||
{ |
||||
target, |
||||
key, |
||||
toAdd: args, |
||||
modifyCoreArray: (coreArray, addedValues) => { |
||||
coreArray.push(...addedValues); |
||||
return proxyContext.createArrayProxy(target[0], target[2]).length; |
||||
}, |
||||
}, |
||||
proxyContext, |
||||
); |
||||
}; |
||||
}, |
||||
reverse: (target, _key, proxyContext) => { |
||||
return () => { |
||||
target[1].reverse(); |
||||
return proxyContext.createArrayProxy( |
||||
target[0], |
||||
target[2], |
||||
) as ObjectJsonRepresentation[]; |
||||
}; |
||||
}, |
||||
shift: (target, key, proxyContext) => { |
||||
return () => { |
||||
return modifyArray( |
||||
{ |
||||
target, |
||||
key, |
||||
quadsToDelete: (quads) => { |
||||
return quads[0] ? [quads[0]] : []; |
||||
}, |
||||
modifyCoreArray: (coreArray) => { |
||||
const shifted = coreArray.shift(); |
||||
return shifted |
||||
? nodeToJsonldRepresentation(shifted, proxyContext) |
||||
: undefined; |
||||
}, |
||||
}, |
||||
proxyContext, |
||||
); |
||||
}; |
||||
}, |
||||
sort: (target, _key, proxyContext) => { |
||||
return (compareFunction) => { |
||||
if (compareFunction) { |
||||
target[1].sort((a, b) => { |
||||
return compareFunction( |
||||
nodeToJsonldRepresentation(a, proxyContext), |
||||
nodeToJsonldRepresentation(b, proxyContext), |
||||
); |
||||
}); |
||||
} else if (target) { |
||||
target[1].sort((a, b) => { |
||||
const aReal = nodeToJsonldRepresentation(a, proxyContext); |
||||
const bReal = nodeToJsonldRepresentation(b, proxyContext); |
||||
if (aReal > bReal) { |
||||
return 1; |
||||
} else if (bReal > aReal) { |
||||
return -1; |
||||
} else { |
||||
return 0; |
||||
} |
||||
}); |
||||
} |
||||
return proxyContext.createArrayProxy( |
||||
target[0], |
||||
target[2], |
||||
) as ObjectJsonRepresentation[]; |
||||
}; |
||||
}, |
||||
splice: (target, key, proxyContext) => { |
||||
return (start, deleteCount, ...items: ObjectJsonRepresentation[]) => { |
||||
return modifyArray( |
||||
{ |
||||
target, |
||||
key, |
||||
toAdd: items, |
||||
quadsToDelete: (quads) => { |
||||
return quads.splice(start, deleteCount); |
||||
}, |
||||
modifyCoreArray: (coreArray, addedValues) => { |
||||
const spliced = coreArray.splice( |
||||
start, |
||||
deleteCount || 0, |
||||
...addedValues, |
||||
); |
||||
return spliced.map((node) => { |
||||
return nodeToJsonldRepresentation(node, proxyContext); |
||||
}); |
||||
}, |
||||
}, |
||||
proxyContext, |
||||
); |
||||
}; |
||||
}, |
||||
unshift: (target, key, proxyContext) => { |
||||
return (...args) => { |
||||
return modifyArray( |
||||
{ |
||||
target, |
||||
key, |
||||
toAdd: args, |
||||
modifyCoreArray: (coreArray, addedValues) => { |
||||
coreArray.unshift(...addedValues); |
||||
return proxyContext.createArrayProxy(target[0], target[2]).length; |
||||
}, |
||||
}, |
||||
proxyContext, |
||||
); |
||||
}; |
||||
}, |
||||
}; |
@ -0,0 +1,158 @@ |
||||
/* eslint-disable @typescript-eslint/no-explicit-any */ |
||||
export class BasicLdSet<T> extends Set<T> implements LdSet<T> { |
||||
every<S extends T>( |
||||
predicate: (value: T, set: LdSet<T>) => value is S, |
||||
thisArg?: any, |
||||
): this is LdSet<S>; |
||||
every( |
||||
predicate: (value: T, set: LdSet<T>) => unknown, |
||||
thisArg?: any, |
||||
): boolean; |
||||
every(predicate: (value: T, set: LdSet<T>) => any, thisArg?: any): boolean { |
||||
for (const value of this) { |
||||
if (!predicate.call(thisArg, value, this)) return false; |
||||
} |
||||
return true; |
||||
} |
||||
|
||||
some( |
||||
predicate: (value: T, set: LdSet<T>) => unknown, |
||||
thisArg?: any, |
||||
): boolean { |
||||
for (const value of this) { |
||||
if (predicate.call(thisArg, value, this)) return true; |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
forEach( |
||||
callbackfn: (value: T, value2: T, set: LdSet<T>) => void, |
||||
thisArg?: any, |
||||
): void { |
||||
for (const value of this) { |
||||
callbackfn.call(thisArg, value, value, this); |
||||
} |
||||
} |
||||
|
||||
map<U>(callbackfn: (value: T, set: LdSet<T>) => U, thisArg?: any): LdSet<U> { |
||||
const newSet = new BasicLdSet<U>(); |
||||
for (const value of this) { |
||||
newSet.add(callbackfn.call(thisArg, value, this)); |
||||
} |
||||
return newSet; |
||||
} |
||||
|
||||
filter<S extends T>( |
||||
predicate: (value: T, set: LdSet<T>) => value is S, |
||||
thisArg?: any, |
||||
): LdSet<S>; |
||||
filter( |
||||
predicate: (value: T, set: LdSet<T>) => unknown, |
||||
thisArg?: any, |
||||
): LdSet<T>; |
||||
filter( |
||||
predicate: (value: T, set: LdSet<T>) => any, |
||||
thisArg?: unknown, |
||||
): LdSet<T> { |
||||
const newSet = new BasicLdSet<T>(); |
||||
for (const value of this) { |
||||
if (predicate.call(thisArg, value, this)) newSet.add(value); |
||||
} |
||||
return newSet; |
||||
} |
||||
|
||||
reduce( |
||||
callbackfn: (previousValue: T, currentValue: T, set: LdSet<T>) => T, |
||||
): T; |
||||
reduce( |
||||
callbackfn: (previousValue: T, currentValue: T, set: LdSet<T>) => T, |
||||
initialValue: T, |
||||
): T; |
||||
reduce<U>( |
||||
callbackfn: (previousValue: U, currentValue: T, set: LdSet<T>) => U, |
||||
initialValue: U, |
||||
): U; |
||||
reduce(callbackfn: any, initialValue?: any): any { |
||||
const iterator = this[Symbol.iterator](); |
||||
let accumulator; |
||||
|
||||
if (initialValue === undefined) { |
||||
const first = iterator.next(); |
||||
if (first.done) { |
||||
throw new TypeError("Reduce of empty collection with no initial value"); |
||||
} |
||||
accumulator = first.value; |
||||
} else { |
||||
accumulator = initialValue; |
||||
} |
||||
|
||||
let result = iterator.next(); |
||||
while (!result.done) { |
||||
accumulator = callbackfn(accumulator, result.value, this); |
||||
result = iterator.next(); |
||||
} |
||||
|
||||
return accumulator; |
||||
} |
||||
|
||||
difference(other: Set<T>): LdSet<T> { |
||||
return this.filter((value) => !other.has(value)); |
||||
} |
||||
|
||||
intersection(other: Set<T>): LdSet<T> { |
||||
const newSet = new BasicLdSet<T>(); |
||||
const iteratingSet = this.size < other.size ? this : other; |
||||
const comparingSet = this.size < other.size ? other : this; |
||||
for (const value of iteratingSet) { |
||||
if (comparingSet.has(value)) { |
||||
newSet.add(value); |
||||
} |
||||
} |
||||
return newSet; |
||||
} |
||||
|
||||
isDisjointFrom(other: Set<T>): boolean { |
||||
const iteratingSet = this.size < other.size ? this : other; |
||||
const comparingSet = this.size < other.size ? other : this; |
||||
for (const value of iteratingSet) { |
||||
if (comparingSet.has(value)) return false; |
||||
} |
||||
return true; |
||||
} |
||||
|
||||
isSubsetOf(other: Set<T>): boolean { |
||||
if (this.size > other.size) return false; |
||||
for (const value of this) { |
||||
if (!other.has(value)) return false; |
||||
} |
||||
return true; |
||||
} |
||||
|
||||
isSupersetOf(other: Set<T>): boolean { |
||||
if (this.size < other.size) return false; |
||||
for (const value of other) { |
||||
if (!this.has(value)) return false; |
||||
} |
||||
return true; |
||||
} |
||||
|
||||
symmetricDifference(other: Set<T>): LdSet<T> { |
||||
const newSet = new BasicLdSet<T>(); |
||||
this.forEach((value) => newSet.add(value)); |
||||
other.forEach((value) => { |
||||
if (newSet.has(value)) { |
||||
newSet.delete(value); |
||||
} else { |
||||
newSet.add(value); |
||||
} |
||||
}); |
||||
return newSet; |
||||
} |
||||
|
||||
union(other: Set<T>): LdSet<T> { |
||||
const newSet = new BasicLdSet<T>(); |
||||
this.forEach((value) => newSet.add(value)); |
||||
other.forEach((value) => newSet.add(value)); |
||||
return newSet; |
||||
} |
||||
} |
@ -0,0 +1,178 @@ |
||||
/* eslint-disable @typescript-eslint/no-explicit-any */ |
||||
/** |
||||
* An abract representation for a set of Linked Data Objects |
||||
*/ |
||||
interface LdSet<T> extends Set<T> { |
||||
/** |
||||
* =========================================================================== |
||||
* BASE METHODS |
||||
* =========================================================================== |
||||
*/ |
||||
/** |
||||
* Appends a new element with a specified value to the end of the Set. |
||||
*/ |
||||
add(value: T): this; |
||||
/** |
||||
* Clears the set of value |
||||
*/ |
||||
clear(): void; |
||||
/** |
||||
* Removes a specified value from the Set. |
||||
* @returns Returns true if an element in the Set existed and has been removed, or false if the element does not exist. |
||||
*/ |
||||
delete(value: T): boolean; |
||||
/** |
||||
* @returns a boolean indicating whether an element with the specified value exists in the Set or not. |
||||
*/ |
||||
has(value: T): boolean; |
||||
/** |
||||
* @returns the number of (unique) elements in Set. |
||||
*/ |
||||
readonly size: number; |
||||
/** Iterates over values in the set. */ |
||||
[Symbol.iterator](): SetIterator<T>; |
||||
/** |
||||
* Returns an iterable of [v,v] pairs for every value `v` in the set. |
||||
*/ |
||||
entries(): SetIterator<[T, T]>; |
||||
/** |
||||
* Despite its name, returns an iterable of the values in the set. |
||||
*/ |
||||
keys(): SetIterator<T>; |
||||
/** |
||||
* Returns an iterable of values in the set. |
||||
*/ |
||||
values(): SetIterator<T>; |
||||
/** |
||||
* =========================================================================== |
||||
* ITERATOR METHODS |
||||
* These methods mimic array methods |
||||
* =========================================================================== |
||||
*/ |
||||
/** |
||||
* Determines whether all the members of an set satisfy the specified test. |
||||
* @param predicate A function that accepts up to two arguments. The every method calls |
||||
* the predicate function for each element in the set until the predicate returns a value |
||||
* which is coercible to the Boolean value false, or until the end of the set. |
||||
* @param thisArg An object to which the this keyword can refer in the predicate function. |
||||
* If thisArg is omitted, undefined is used as the this value. |
||||
*/ |
||||
every<S extends T>( |
||||
predicate: (value: T, set: LdSet<T>) => value is S, |
||||
thisArg?: any, |
||||
): this is LdSet<S>; |
||||
/** |
||||
* Determines whether all the members of an set satisfy the specified test. |
||||
* @param predicate A function that accepts up to two arguments. The every method calls |
||||
* the predicate function for each element in the set until the predicate returns a value |
||||
* which is coercible to the Boolean value false, or until the end of the set. |
||||
* @param thisArg An object to which the this keyword can refer in the predicate function. |
||||
* If thisArg is omitted, undefined is used as the this value. |
||||
*/ |
||||
every( |
||||
predicate: (value: T, set: LdSet<T>) => unknown, |
||||
thisArg?: any, |
||||
): boolean; |
||||
/** |
||||
* Determines whether the specified callback function returns true for any element of a set. |
||||
* @param predicate A function that accepts up to two arguments. The some method calls |
||||
* the predicate function for each element in the set until the predicate returns a value |
||||
* which is coercible to the Boolean value true, or until the end of the set. |
||||
* @param thisArg An object to which the this keyword can refer in the predicate function. |
||||
* If thisArg is omitted, undefined is used as the this value. |
||||
*/ |
||||
some(predicate: (value: T, set: LdSet<T>) => unknown, thisArg?: any): boolean; |
||||
/** |
||||
* Performs the specified action for each element in an set. |
||||
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the set. A "value2" is provided for parity with the base set. |
||||
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. |
||||
*/ |
||||
forEach( |
||||
callbackfn: (value: T, value2: T, set: LdSet<T>) => void, |
||||
thisArg?: any, |
||||
): void; |
||||
/** |
||||
* Calls a defined callback function on each element of an set, and returns a set that contains the results. |
||||
* @param callbackfn A function that accepts up to two arguments. The map method calls the callbackfn function one time for each element in the set. |
||||
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. |
||||
*/ |
||||
map<U>(callbackfn: (value: T, set: LdSet<T>) => U, thisArg?: any): LdSet<U>; |
||||
/** |
||||
* Returns the elements of a set that meet the condition specified in a callback function. |
||||
* @param predicate A function that accepts up to two arguments. The filter method calls the predicate function one time for each element in the set. |
||||
* @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. |
||||
*/ |
||||
filter<S extends T>( |
||||
predicate: (value: T, set: LdSet<T>) => value is S, |
||||
thisArg?: any, |
||||
): LdSet<S>; |
||||
/** |
||||
* Returns the elements of a set that meet the condition specified in a callback function. |
||||
* @param predicate A function that accepts up to two arguments. The filter method calls the predicate function one time for each element in the set. |
||||
* @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. |
||||
*/ |
||||
filter( |
||||
predicate: (value: T, set: LdSet<T>) => unknown, |
||||
thisArg?: any, |
||||
): LdSet<T>; |
||||
/** |
||||
* Calls the specified callback function for all the elements in a set. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
||||
* @param callbackfn A function that accepts up to three arguments. The reduce method calls the callbackfn function one time for each element in the set. |
||||
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. |
||||
*/ |
||||
reduce( |
||||
callbackfn: (previousValue: T, currentValue: T, set: LdSet<T>) => T, |
||||
): T; |
||||
/** |
||||
* Calls the specified callback function for all the elements in a set. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
||||
* @param callbackfn A function that accepts up to three arguments. The reduce method calls the callbackfn function one time for each element in the set. |
||||
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. |
||||
*/ |
||||
reduce( |
||||
callbackfn: (previousValue: T, currentValue: T, set: LdSet<T>) => T, |
||||
initialValue: T, |
||||
): T; |
||||
/** |
||||
* Calls the specified callback function for all the elements in a set. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
||||
* @param callbackfn A function that accepts up to three arguments. The reduce method calls the callbackfn function one time for each element in the set. |
||||
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. |
||||
*/ |
||||
reduce<U>( |
||||
callbackfn: (previousValue: U, currentValue: T, array: LdSet<T>) => U, |
||||
initialValue: U, |
||||
): U; |
||||
|
||||
/** |
||||
* =========================================================================== |
||||
* EXTENDED SET METHODS |
||||
* =========================================================================== |
||||
*/ |
||||
/** |
||||
* Returns a new set containing elements in this set but not in the given set. |
||||
*/ |
||||
difference(other: Set<T>): LdSet<T>; |
||||
/** |
||||
* returns a new set containing elements in both this set and the given set. |
||||
*/ |
||||
intersection(other: Set<T>): LdSet<T>; |
||||
/** |
||||
* Returns a boolean indicating if this set has no elements in common with the given set. |
||||
*/ |
||||
isDisjointFrom(other: Set<T>): boolean; |
||||
/** |
||||
* Returns a boolean indicating if all elements of this set are in the given set. |
||||
*/ |
||||
isSubsetOf(other: Set<T>): boolean; |
||||
/** |
||||
* Returns a boolean indicating if all elements of the given set are in this set. |
||||
*/ |
||||
isSupersetOf(other: Set<T>): boolean; |
||||
/** |
||||
* Returns a new set containing elements which are in either this set or the given set, but not in both. |
||||
*/ |
||||
symmetricDifference(other: Set<T>): LdSet<T>; |
||||
/** |
||||
* Returns a new set containing elements which are in either or both of this set and the given set. |
||||
*/ |
||||
union(other: Set<T>): LdSet<T>; |
||||
} |
@ -0,0 +1,141 @@ |
||||
/** |
||||
* This file handles the underlying functionality of a set, including hidden |
||||
* helper methods |
||||
*/ |
||||
import type { Dataset } from "@rdfjs/types"; |
||||
import type { ObjectNode, QuadMatch } from "@ldo/rdf-utils"; |
||||
import type { ArrayProxyTarget } from "./createArrayHandler"; |
||||
import type { |
||||
_getNodeAtIndex, |
||||
_getUnderlyingArrayTarget, |
||||
_getUnderlyingDataset, |
||||
_getUnderlyingMatch, |
||||
_proxyContext, |
||||
} from "../types"; |
||||
import { _getUnderlyingNode } from "../types"; |
||||
import type { ProxyContext } from "../ProxyContext"; |
||||
|
||||
export class SetProxy<T> implements LdSet<T> { |
||||
context: ProxyContext; |
||||
quadMatch: QuadMatch; |
||||
isSubjectOriented?: boolean; |
||||
isLangStringSet?: boolean; |
||||
|
||||
constructor( |
||||
context: ProxyContext, |
||||
quadMatch: QuadMatch, |
||||
isSubjectOriented?: boolean, |
||||
isLangStringSet?: boolean, |
||||
) { |
||||
this.context = context; |
||||
this.quadMatch = quadMatch; |
||||
this.isSubjectOriented = isSubjectOriented; |
||||
this.isLangStringSet = isLangStringSet; |
||||
} |
||||
|
||||
add(value: T): this { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
clear(): void { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
delete(value: T): boolean { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
has(value: T): boolean { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
get size(): number { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
entries(): SetIterator<[T, T]> { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
keys(): SetIterator<T> { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
values(): SetIterator<T> { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
every<S extends T>(predicate: (value: T, set: LdSet<T>) => value is S, thisArg?: any): this is LdSet<S>; |
||||
|
||||
every(predicate: (value: T, set: LdSet<T>) => unknown, thisArg?: any): boolean; |
||||
every(predicate: unknown, thisArg?: unknown): boolean { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
some(predicate: (value: T, set: LdSet<T>) => unknown, thisArg?: any): boolean { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
forEach(callbackfn: (value: T, value2: T, set: LdSet<T>) => void, thisArg?: any): void { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
map<U>(callbackfn: (value: T, set: LdSet<T>) => U, thisArg?: any): LdSet<T> { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
filter<S extends T>(predicate: (value: T, set: LdSet<T>) => value is S, thisArg?: any): LdSet<S>; |
||||
filter(predicate: (value: T, set: LdSet<T>) => unknown, thisArg?: any): LdSet<T>; |
||||
filter(predicate: unknown, thisArg?: unknown): LdSet<T> | LdSet<S> { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
reduce(callbackfn: (previousValue: T, currentValue: T, set: LdSet<T>) => T): T; |
||||
reduce(callbackfn: (previousValue: T, currentValue: T, set: LdSet<T>) => T, initialValue: T): T; |
||||
reduce<U>(callbackfn: (previousValue: U, currentValue: T, array: LdSet<T>) => U, initialValue: U): U; |
||||
reduce(callbackfn: unknown, initialValue?: unknown): T | U { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
difference(other: Set<T>): LdSet<T> { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
intersection(other: Set<T>): LdSet<T> { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
isDisjointFrom(other: Set<T>): boolean { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
isSubsetOf(other: Set<T>): boolean { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
isSupersetOf(other: Set<T>): boolean { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
symmetricDifference(other: Set<T>): LdSet<T> { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
union(other: Set<T>): LdSet<T> { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
[Symbol.iterator](): SetIterator<T> { |
||||
throw new Error("Method not implemented."); |
||||
} |
||||
|
||||
[Symbol.toStringTag]: string; |
||||
} |
||||
|
||||
export type ArrayProxy = Array<unknown> & { |
||||
readonly [_getUnderlyingDataset]: Dataset; |
||||
readonly [_getUnderlyingMatch]: ArrayProxyTarget[0]; |
||||
readonly [_getNodeAtIndex]: (index: number) => ObjectNode | undefined; |
||||
readonly [_getUnderlyingArrayTarget]: ArrayProxyTarget; |
||||
[_proxyContext]: ProxyContext; |
||||
}; |
@ -1,7 +1,7 @@ |
||||
{ |
||||
"extends": "../../tsconfig.base.json", |
||||
"compilerOptions": { |
||||
"outDir": "./dist" |
||||
"outDir": "./dist", |
||||
}, |
||||
"include": ["./src"] |
||||
} |
Loading…
Reference in new issue