type
stringclasses 7
values | content
stringlengths 4
9.55k
| repo
stringlengths 7
96
| path
stringlengths 4
178
| language
stringclasses 1
value |
|---|---|---|---|---|
FunctionDeclaration
|
export function update<TProps, C extends Record<TProps>, K extends keyof TProps, NSV>(record: C, key: K, notSetValue: NSV, updater: (value: TProps[K] | NSV) => TProps[K]): C;
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
FunctionDeclaration
|
export function update<V>(collection: Array<V>, key: number, updater: (value: V) => V): Array<V>;
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
FunctionDeclaration
|
export function update<V, NSV>(collection: Array<V>, key: number, notSetValue: NSV, updater: (value: V | NSV) => V): Array<V>;
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
FunctionDeclaration
|
export function update<C, K extends keyof C>(object: C, key: K, updater: (value: C[K]) => C[K]): C;
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
FunctionDeclaration
|
export function update<C, K extends keyof C, NSV>(object: C, key: K, notSetValue: NSV, updater: (value: C[K] | NSV) => C[K]): C;
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
FunctionDeclaration
|
export function update<V, C extends {[key: string]: V}, K extends keyof C>(collection: C, key: K, updater: (value: V) => V): {[key: string]: V};
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
FunctionDeclaration
|
export function update<V, C extends {[key: string]: V}, K extends keyof C, NSV>(collection: C, key: K, notSetValue: NSV, updater: (value: V | NSV) => V): {[key: string]: V};
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
FunctionDeclaration
|
/**
* Returns the value at the provided key path starting at the provided
* collection, or notSetValue if the key path is not defined.
*
* A functional alternative to `collection.getIn(keypath)` which will also
* work with plain Objects and Arrays.
*
* <!-- runkit:activate -->
* ```js
* const { getIn } = require('immutable')
* getIn({ x: { y: { z: 123 }}}, ['x', 'y', 'z']) // 123
* getIn({ x: { y: { z: 123 }}}, ['x', 'q', 'p'], 'ifNotSet') // 'ifNotSet'
* ```
*/
export function getIn(collection: any, keyPath: Iterable<any>, notSetValue: any): any;
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
FunctionDeclaration
|
/**
* Returns true if the key path is defined in the provided collection.
*
* A functional alternative to `collection.hasIn(keypath)` which will also
* work with plain Objects and Arrays.
*
* <!-- runkit:activate -->
* ```js
* const { hasIn } = require('immutable')
* hasIn({ x: { y: { z: 123 }}}, ['x', 'y', 'z']) // true
* hasIn({ x: { y: { z: 123 }}}, ['x', 'q', 'p']) // false
* ```
*/
export function hasIn(collection: any, keyPath: Iterable<any>): boolean;
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
FunctionDeclaration
|
/**
* Returns a copy of the collection with the value at the key path removed.
*
* A functional alternative to `collection.removeIn(keypath)` which will also
* work with plain Objects and Arrays.
*
* <!-- runkit:activate -->
* ```js
* const { removeIn } = require('immutable')
* const original = { x: { y: { z: 123 }}}
* removeIn(original, ['x', 'y', 'z']) // { x: { y: {}}}
* console.log(original) // { x: { y: { z: 123 }}}
* ```
*/
export function removeIn<C>(collection: C, keyPath: Iterable<any>): C;
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
FunctionDeclaration
|
/**
* Returns a copy of the collection with the value at the key path set to the
* provided value.
*
* A functional alternative to `collection.setIn(keypath)` which will also
* work with plain Objects and Arrays.
*
* <!-- runkit:activate -->
* ```js
* const { setIn } = require('immutable')
* const original = { x: { y: { z: 123 }}}
* setIn(original, ['x', 'y', 'z'], 456) // { x: { y: { z: 456 }}}
* console.log(original) // { x: { y: { z: 123 }}}
* ```
*/
export function setIn<C>(collection: C, keyPath: Iterable<any>, value: any): C;
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
FunctionDeclaration
|
/**
* Returns a copy of the collection with the value at key path set to the
* result of providing the existing value to the updating function.
*
* A functional alternative to `collection.updateIn(keypath)` which will also
* work with plain Objects and Arrays.
*
* <!-- runkit:activate -->
* ```js
* const { updateIn } = require('immutable')
* const original = { x: { y: { z: 123 }}}
* updateIn(original, ['x', 'y', 'z'], val => val * 6) // { x: { y: { z: 738 }}}
* console.log(original) // { x: { y: { z: 123 }}}
* ```
*/
export function updateIn<C>(collection: C, keyPath: Iterable<any>, updater: (value: any) => any): C;
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
FunctionDeclaration
|
export function updateIn<C>(collection: C, keyPath: Iterable<any>, notSetValue: any, updater: (value: any) => any): C;
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
FunctionDeclaration
|
/**
* Returns a copy of the collection with the remaining collections merged in.
*
* A functional alternative to `collection.merge()` which will also work with
* plain Objects and Arrays.
*
* <!-- runkit:activate -->
* ```js
* const { merge } = require('immutable')
* const original = { x: 123, y: 456 }
* merge(original, { y: 789, z: 'abc' }) // { x: 123, y: 789, z: 'abc' }
* console.log(original) // { x: 123, y: 456 }
* ```
*/
export function merge<C>(
collection: C,
...collections: Array<Iterable<any> | Iterable<[any, any]> | {[key: string]: any}>
): C;
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
FunctionDeclaration
|
/**
* Returns a copy of the collection with the remaining collections merged in,
* calling the `merger` function whenever an existing value is encountered.
*
* A functional alternative to `collection.mergeWith()` which will also work
* with plain Objects and Arrays.
*
* <!-- runkit:activate -->
* ```js
* const { mergeWith } = require('immutable')
* const original = { x: 123, y: 456 }
* mergeWith(
* (oldVal, newVal) => oldVal + newVal,
* original,
* { y: 789, z: 'abc' }
* ) // { x: 123, y: 1245, z: 'abc' }
* console.log(original) // { x: 123, y: 456 }
* ```
*/
export function mergeWith<C>(
merger: (oldVal: any, newVal: any, key: any) => any,
collection: C,
...collections: Array<Iterable<any> | Iterable<[any, any]> | {[key: string]: any}>
): C;
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
FunctionDeclaration
|
/**
* Returns a copy of the collection with the remaining collections merged in
* deeply (recursively).
*
* A functional alternative to `collection.mergeDeep()` which will also work
* with plain Objects and Arrays.
*
* <!-- runkit:activate -->
* ```js
* const { mergeDeep } = require('immutable')
* const original = { x: { y: 123 }}
* mergeDeep(original, { x: { z: 456 }}) // { x: { y: 123, z: 456 }}
* console.log(original) // { x: { y: 123 }}
* ```
*/
export function mergeDeep<C>(
collection: C,
...collections: Array<Iterable<any> | Iterable<[any, any]> | {[key: string]: any}>
): C;
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
FunctionDeclaration
|
/**
* Returns a copy of the collection with the remaining collections merged in
* deeply (recursively), calling the `merger` function whenever an existing
* value is encountered.
*
* A functional alternative to `collection.mergeDeepWith()` which will also
* work with plain Objects and Arrays.
*
* <!-- runkit:activate -->
* ```js
* const { mergeDeepWith } = require('immutable')
* const original = { x: { y: 123 }}
* mergeDeepWith(
* (oldVal, newVal) => oldVal + newVal,
* original,
* { x: { y: 456 }}
* ) // { x: { y: 579 }}
* console.log(original) // { x: { y: 123 }}
* ```
*/
export function mergeDeepWith<C>(
merger: (oldVal: any, newVal: any, key: any) => any,
collection: C,
...collections: Array<Iterable<any> | Iterable<[any, any]> | {[key: string]: any}>
): C;
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface SortedMap<K, V> extends Map<K, V> {
/**
* The number of entries (key/value pairs) in this SortedMap.
*/
readonly size: number;
// Persistent changes
/**
* Returns a new `SortedMap` containing the entries of the provided
* collection-like. The entries will be organized in an optimized tree structure
* with internal nodes and leaves defragmented as much as possible
* while keeping all the consistency rules enforced.
*
* If the collection argument is undefined then the current content
* of this `SortedMap` will be reorganized into an optimized tree structure.
*
* The pack procedure is actually called from the `SortedMap` constructor
* as it is usually faster than a series of set operations. It is recommended
* to explicitly call this method after a large batch of update or delete operations
* to release a portion of the allocated memory and to speed up the consequent get
* operations.
*/
pack(collection?: Iterable<[K, V]>): this;
// Deep persistent changes
// Transient changes
// Reading values
/**
* Returns a sequence representing a portion of this sorted map starting with a specific key
* up to the last entry in the sorted map.
* If the optional parameter backwards is set to true, the returned sequence will
* list the entries backwards, starting with key down to the first entry in the sorted map,
* Example:
* ```js
* > const abc = SortedMap([["A", "a"], ["B", "b"], ["C", "c"], ["D", "d"], ["E", "e"], ["F", "f"], ["G", "g"], ["H", "h"], ["I", "i"], ["J", "j"], ["K", "k"], ["L", "l"], ["M", "m"], ["N", "n"], ["O", "o"], ["P", "p"], ["Q", "q"], ["R", "r"], ["S", "s"], ["T", "t"], ["U", "u"], ["V", "v"], ["W", "w"], ["X", "x"], ["Y", "y"], ["Z", "z"]]);
*
* > abc.from("R");
* Seq { "R": "r", "S": "s", "T": "t", "U": "u", "V": "v", "W": "w", "X": "x", "Y": "y", "Z": "z" }
*
* > abc.from("R", true);
* Seq { "R": "r", "Q": "q", "P": "p", "O": "o", "N": "n", "M": "m", "L": "l", "K": "k", "J": "j", "I": "i", "H": "h", "G": "g", "F": "f", "E": "e", "D": "d", "C": "c", "B": "b", "A": "a" }
* ```
*
* The method from() can be efficiently combined with take() to retrieve the desired number of values or with takeWhile() to retrieve a specific range:
* ```js
* > abc.from("R").take(5);
* Seq { "R": "r", "S": "s", "T": "t", "U": "u", "V": "v" }
*
* > abc.from("R").takeWhile((v, k) => k < "W");
* Seq { "R": "r", "S": "s", "T": "t", "U": "u", "V": "v" }
*
* > abc.from("R", true).take(5);
* Seq { "R": "r", "Q": "q", "P": "p", "O": "o", "N": "n" }
*
* > abc.from("R", true).takeWhile((v, k) => k > "K");
* Seq { "R": "r", "Q": "q", "P": "p", "O": "o", "N": "n", "M": "m", "L": "l" }
* ```
*/
from(key: K, backwards?: boolean): Seq<K, V>;
/**
* Returns a sequence representing a portion of this sorted map starting from numeric index position,
* as if the collection was an array.
* If the optional parameter backwards is set to true, the returned sequence will
* list the entries backwards.
*
* The method is optimized to quickly find the n-th entry inside the b-tree structure
* by checking the computed sizes of underlying nodes.
* Even though the algorithm is not as fast as working with a native array,
* it is faster by orders of magnitude than walking through the first n elements
* of unindexed collection to just skip them. The access time is O(log N).
* Example:
* ```js
* > const abc = SortedMap([["A", "a"], ["B", "b"], ["C", "c"], ["D", "d"], ["E", "e"], ["F", "f"], ["G", "g"], ["H", "h"], ["I", "i"], ["J", "j"], ["K", "k"], ["L", "l"], ["M", "m"], ["N", "n"], ["O", "o"], ["P", "p"], ["Q", "q"], ["R", "r"], ["S", "s"], ["T", "t"], ["U", "u"], ["V", "v"], ["W", "w"], ["X", "x"], ["Y", "y"], ["Z", "z"]]);
*
* > abc.fromIndex(4).take(5);
* Seq { "E": "e", "F": "f", "G": "g", "H": "h", "I": "i" }
*
* > abc.fromIndex(4, true).take(5);
* Seq { "E": "e", "D": "d", "C": "c", "B": "b", "A": "a" }
* ```
*/
fromIndex(index: number, backwards?: boolean): Seq<K, V>;
/**
* Prints out the internal Btree structure of the SortedMap.
* Keeps printing the nodes recursively until `maxDepth` level is reached.
*
* ```js
* const { SortedMap } = require('immutable-sorted')
* const aSortedMap = Range(0, 8).toSortedMap(undefined, {btreeOrder: 4});
* sortedMap.print();
*
* + LEAF[0] (L0)
* - ENTRY[0]: 0
* - ENTRY[1]: 1
* - ENTRY[0]: 2
* + LEAF[1] (L0)
* - ENTRY[0]: 3
* - ENTRY[1]: 4
* - ENTRY[1]: 5
* + LEAF[2] (L0)
* - ENTRY[0]: 6
* - ENTRY[1]: 7
*
* ```
*
*/
print(maxDepth?: number): this;
}
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface OrderedMap<K, V> extends Map<K, V> {
/**
* The number of entries in this OrderedMap.
*/
readonly size: number;
/**
* Returns a new OrderedMap also containing the new key, value pair. If an
* equivalent key already exists in this OrderedMap, it will be replaced
* while maintaining the existing order.
*
* <!-- runkit:activate -->
* ```js
* const { OrderedMap } = require('immutable')
* const originalMap = OrderedMap({a:1, b:1, c:1})
* const updatedMap = originalMap.set('b', 2)
*
* originalMap
* // OrderedMap {a: 1, b: 1, c: 1}
* updatedMap
* // OrderedMap {a: 1, b: 2, c: 1}
* ```
*
* Note: `set` can be used in `withMutations`.
*/
set(key: K, value: V): this;
/**
* Returns a new OrderedMap resulting from merging the provided Collections
* (or JS objects) into this OrderedMap. In other words, this takes each
* entry of each collection and sets it on this OrderedMap.
*
* Note: Values provided to `merge` are shallowly converted before being
* merged. No nested values are altered.
*
* <!-- runkit:activate -->
* ```js
* const { OrderedMap } = require('immutable')
* const one = OrderedMap({ a: 10, b: 20, c: 30 })
* const two = OrderedMap({ b: 40, a: 50, d: 60 })
* one.merge(two) // OrderedMap { "a": 50, "b": 40, "c": 30, "d": 60 }
* two.merge(one) // OrderedMap { "b": 20, "a": 10, "d": 60, "c": 30 }
* ```
*
* Note: `merge` can be used in `withMutations`.
*
* @alias concat
*/
merge<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): OrderedMap<K | KC, V | VC>;
merge<C>(...collections: Array<{[key: string]: C}>): OrderedMap<K | string, V | C>;
concat<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): OrderedMap<K | KC, V | VC>;
concat<C>(...collections: Array<{[key: string]: C}>): OrderedMap<K | string, V | C>;
// Sequence algorithms
/**
* Returns a new OrderedMap with values passed through a
* `mapper` function.
*
* OrderedMap({ a: 1, b: 2 }).map(x => 10 * x)
* // OrderedMap { "a": 10, "b": 20 }
*
* Note: `map()` always returns a new instance, even if it produced the same
* value at every step.
*/
map<M>(
mapper: (value: V, key: K, iter: this) => M,
context?: any
): OrderedMap<K, M>;
/**
* @see Collection.Keyed.mapKeys
*/
mapKeys<M>(
mapper: (key: K, value: V, iter: this) => M,
context?: any
): OrderedMap<M, V>;
/**
* @see Collection.Keyed.mapEntries
*/
mapEntries<KM, VM>(
mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
context?: any
): OrderedMap<KM, VM>;
/**
* Flat-maps the OrderedMap, returning a new OrderedMap.
*
* Similar to `data.map(...).flatten(true)`.
*/
flatMap<KM, VM>(
mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
context?: any
): OrderedMap<KM, VM>;
/**
* Returns a new OrderedMap with only the entries for which the `predicate`
* function returns true.
*
* Note: `filter()` always returns a new instance, even if it results in
* not filtering out any values.
*/
filter<F extends V>(
predicate: (value: V, key: K, iter: this) => value is F,
context?: any
): OrderedMap<K, F>;
filter(
predicate: (value: V, key: K, iter: this) => any,
context?: any
): this;
/**
* @see Collection.Keyed.flip
*/
flip(): OrderedMap<V, K>;
}
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface Set<T> extends Collection.Set<T> {
/**
* The number of items in this Set.
*/
readonly size: number;
// Persistent changes
/**
* Returns a new Set which also includes this value.
*
* Note: `add` can be used in `withMutations`.
*/
add(value: T): this;
/**
* Returns a new Set which excludes this value.
*
* Note: `delete` can be used in `withMutations`.
*
* Note: `delete` **cannot** be safely used in IE8, use `remove` if
* supporting old browsers.
*
* @alias remove
*/
delete(value: T): this;
remove(value: T): this;
/**
* Returns a new Set containing no values.
*
* Note: `clear` can be used in `withMutations`.
*/
clear(): this;
/**
* Returns a Set including any value from `collections` that does not already
* exist in this Set.
*
* Note: `union` can be used in `withMutations`.
* @alias merge
* @alias concat
*/
union<C>(...collections: Array<Iterable<C>>): Set<T | C>;
merge<C>(...collections: Array<Iterable<C>>): Set<T | C>;
concat<C>(...collections: Array<Iterable<C>>): Set<T | C>;
/**
* Returns a Set which has removed any values not also contained
* within `collections`.
*
* Note: `intersect` can be used in `withMutations`.
*/
intersect(...collections: Array<Iterable<T>>): this;
/**
* Returns a Set excluding any values contained within `collections`.
*
* <!-- runkit:activate -->
* ```js
* const { OrderedSet } = require('immutable')
* OrderedSet([ 1, 2, 3 ]).subtract([1, 3])
* // OrderedSet [2]
* ```
*
* Note: `subtract` can be used in `withMutations`.
*/
subtract(...collections: Array<Iterable<T>>): this;
// Transient changes
/**
* Note: Not all methods can be used on a mutable collection or within
* `withMutations`! Check the documentation for each method to see if it
* mentions being safe to use in `withMutations`.
*
* @see `Map#withMutations`
*/
withMutations(mutator: (mutable: this) => any): this;
/**
* Note: Not all methods can be used on a mutable collection or within
* `withMutations`! Check the documentation for each method to see if it
* mentions being safe to use in `withMutations`.
*
* @see `Map#asMutable`
*/
asMutable(): this;
/**
* @see `Map#wasAltered`
*/
wasAltered(): boolean;
/**
* @see `Map#asImmutable`
*/
asImmutable(): this;
// Sequence algorithms
/**
* Returns a new Set with values passed through a
* `mapper` function.
*
* Set([1,2]).map(x => 10 * x)
* // Set [10,20]
*/
map<M>(
mapper: (value: T, key: T, iter: this) => M,
context?: any
): Set<M>;
/**
* Flat-maps the Set, returning a new Set.
*
* Similar to `set.map(...).flatten(true)`.
*/
flatMap<M>(
mapper: (value: T, key: T, iter: this) => Iterable<M>,
context?: any
): Set<M>;
/**
* Returns a new Set with only the values for which the `predicate`
* function returns true.
*
* Note: `filter()` always returns a new instance, even if it results in
* not filtering out any values.
*/
filter<F extends T>(
predicate: (value: T, key: T, iter: this) => value is F,
context?: any
): Set<F>;
filter(
predicate: (value: T, key: T, iter: this) => any,
context?: any
): this;
}
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface SortedSet<T> extends Set<T> {
/**
* The number of items in this SortedSet.
*/
readonly size: number;
// Persistent changes
/**
* Returns a new `SortedSet` containing the values of the provided
* collection-like. The values will be organized in an optimized tree structure
* with internal nodes and leaves defragmented as much as possible
* while keeping all the consistency rules enforced.
*
* If the collection argument is undefined then the current content
* of this `SortedSet` will be reorganized into an optimized tree structure.
*
* The pack procedure is actually called from the `SortedSet` constructor
* as it is usually faster than a series of add operations. It is recommended
* to explicitly call this method after a large batch of add or delete operations
* to release a portion of the allocated memory and to speed up the consequent get
* operations.
*/
pack(collection?: Iterable<T>): this;
/**
* Returns a sequence representing a subset of this sorted set starting with value
* up to the last element in the set.
*
* If the optional parameter backwards is set to true, the returned sequence will
* list the entries backwards, starting with value down to the first element in the set.
*
* Example:
* ```js
* const { SortedSet } = require('immutable-sorted');
*
* const abc = SortedSet(["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]);
*
* > abc.from("R");
* Seq { "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }
*
* > abc.from("R", true);
* Seq { "R", "Q", "P", "O", "N", "M", "L", "K", "J", "I", "H", "G", "F", "E", "D", "C", "B", "A" }
* ```
*
* The method from() can be efficiently combined with take() to retrieve the desired number of values or with takeWhile() to retrieve a specific range:
* ```js
* > abc.from("R").take(5);
* Seq { "R", "S", "T", "U", "V" }
*
* > abc.from("R").takeWhile(s => s < "W");
* Seq { "R", "S", "T", "U", "V" }
*
* > abc.from("R", true).take(5);
* Seq { "R", "Q", "P", "O", "N" }
*
* > abc.from("R", true).takeWhile(s => s > "K");
* Seq { "R", "Q", "P", "O", "N", "M", "L" }
* ```
*/
from(value: T, backwards?: boolean): Seq.Set<T>;
/**
* Returns a sequence representing a portion of this sorted set starting from numeric index position,
* as if the collection was an array.
* If the optional parameter backwards is set to true, the returned sequence will
* list the entries backwards.
*
* The method is optimized to quickly find the n-th entry inside the b-tree structure
* by checking the computed sizes of underlying nodes.
* Even though the algorithm is not as fast as working with a native array,
* it is faster by orders of magnitude than walking through the first n elements
* of unindexed collection to just skip them. The access time is O(log N).
* Example:
* ```js
* > abc.fromIndex(4).take(5);
* Seq { "E", "F", "G", "H", "I" }
*
* > abc.fromIndex(4, true).take(5);
* Seq { "E", "D", "C", "B", "A" }
* ```
*/
fromIndex(index: number, backwards?: boolean): Seq.Set<T>;
}
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface OrderedSet<T> extends Set<T> {
/**
* The number of items in this OrderedSet.
*/
readonly size: number;
/**
* Returns an OrderedSet including any value from `collections` that does
* not already exist in this OrderedSet.
*
* Note: `union` can be used in `withMutations`.
* @alias merge
* @alias concat
*/
union<C>(...collections: Array<Iterable<C>>): OrderedSet<T | C>;
merge<C>(...collections: Array<Iterable<C>>): OrderedSet<T | C>;
concat<C>(...collections: Array<Iterable<C>>): OrderedSet<T | C>;
// Sequence algorithms
/**
* Returns a new Set with values passed through a
* `mapper` function.
*
* OrderedSet([ 1, 2 ]).map(x => 10 * x)
* // OrderedSet [10, 20]
*/
map<M>(
mapper: (value: T, key: T, iter: this) => M,
context?: any
): OrderedSet<M>;
/**
* Flat-maps the OrderedSet, returning a new OrderedSet.
*
* Similar to `set.map(...).flatten(true)`.
*/
flatMap<M>(
mapper: (value: T, key: T, iter: this) => Iterable<M>,
context?: any
): OrderedSet<M>;
/**
* Returns a new OrderedSet with only the values for which the `predicate`
* function returns true.
*
* Note: `filter()` always returns a new instance, even if it results in
* not filtering out any values.
*/
filter<F extends T>(
predicate: (value: T, key: T, iter: this) => value is F,
context?: any
): OrderedSet<F>;
filter(
predicate: (value: T, key: T, iter: this) => any,
context?: any
): this;
/**
* Returns an OrderedSet of the same type "zipped" with the provided
* collections.
*
* Like `zipWith`, but using the default `zipper`: creating an `Array`.
*
* ```js
* const a = OrderedSet([ 1, 2, 3 ])
* const b = OrderedSet([ 4, 5, 6 ])
* const c = a.zip(b)
* // OrderedSet [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ]
* ```
*/
zip<U>(other: Collection<any, U>): OrderedSet<[T,U]>;
zip<U,V>(other1: Collection<any, U>, other2: Collection<any, V>): OrderedSet<[T,U,V]>;
zip(...collections: Array<Collection<any, any>>): OrderedSet<any>;
/**
* Returns a OrderedSet of the same type "zipped" with the provided
* collections.
*
* Unlike `zip`, `zipAll` continues zipping until the longest collection is
* exhausted. Missing values from shorter collections are filled with `undefined`.
*
* ```js
* const a = OrderedSet([ 1, 2 ]);
* const b = OrderedSet([ 3, 4, 5 ]);
* const c = a.zipAll(b); // OrderedSet [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ]
* ```
*
* Note: Since zipAll will return a collection as large as the largest
* input, some results may contain undefined values. TypeScript cannot
* account for these without cases (as of v2.5).
*/
zipAll<U>(other: Collection<any, U>): OrderedSet<[T,U]>;
zipAll<U,V>(other1: Collection<any, U>, other2: Collection<any, V>): OrderedSet<[T,U,V]>;
zipAll(...collections: Array<Collection<any, any>>): OrderedSet<any>;
/**
* Returns an OrderedSet of the same type "zipped" with the provided
* collections by using a custom `zipper` function.
*
* @see Seq.Indexed.zipWith
*/
zipWith<U, Z>(
zipper: (value: T, otherValue: U) => Z,
otherCollection: Collection<any, U>
): OrderedSet<Z>;
zipWith<U, V, Z>(
zipper: (value: T, otherValue: U, thirdValue: V) => Z,
otherCollection: Collection<any, U>,
thirdCollection: Collection<any, V>
): OrderedSet<Z>;
zipWith<Z>(
zipper: (...any: Array<any>) => Z,
...collections: Array<Collection<any, any>>
): OrderedSet<Z>;
}
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface Stack<T> extends Collection.Indexed<T> {
/**
* The number of items in this Stack.
*/
readonly size: number;
// Reading values
/**
* Alias for `Stack.first()`.
*/
peek(): T | undefined;
// Persistent changes
/**
* Returns a new Stack with 0 size and no values.
*
* Note: `clear` can be used in `withMutations`.
*/
clear(): Stack<T>;
/**
* Returns a new Stack with the provided `values` prepended, shifting other
* values ahead to higher indices.
*
* This is very efficient for Stack.
*
* Note: `unshift` can be used in `withMutations`.
*/
unshift(...values: Array<T>): Stack<T>;
/**
* Like `Stack#unshift`, but accepts a collection rather than varargs.
*
* Note: `unshiftAll` can be used in `withMutations`.
*/
unshiftAll(iter: Iterable<T>): Stack<T>;
/**
* Returns a new Stack with a size ones less than this Stack, excluding
* the first item in this Stack, shifting all other values to a lower index.
*
* Note: this differs from `Array#shift` because it returns a new
* Stack rather than the removed value. Use `first()` or `peek()` to get the
* first value in this Stack.
*
* Note: `shift` can be used in `withMutations`.
*/
shift(): Stack<T>;
/**
* Alias for `Stack#unshift` and is not equivalent to `List#push`.
*/
push(...values: Array<T>): Stack<T>;
/**
* Alias for `Stack#unshiftAll`.
*/
pushAll(iter: Iterable<T>): Stack<T>;
/**
* Alias for `Stack#shift` and is not equivalent to `List#pop`.
*/
pop(): Stack<T>;
// Transient changes
/**
* Note: Not all methods can be used on a mutable collection or within
* `withMutations`! Check the documentation for each method to see if it
* mentions being safe to use in `withMutations`.
*
* @see `Map#withMutations`
*/
withMutations(mutator: (mutable: this) => any): this;
/**
* Note: Not all methods can be used on a mutable collection or within
* `withMutations`! Check the documentation for each method to see if it
* mentions being safe to use in `withMutations`.
*
* @see `Map#asMutable`
*/
asMutable(): this;
/**
* @see `Map#wasAltered`
*/
wasAltered(): boolean;
/**
* @see `Map#asImmutable`
*/
asImmutable(): this;
// Sequence algorithms
/**
* Returns a new Stack with other collections concatenated to this one.
*/
concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): Stack<T | C>;
/**
* Returns a new Stack with values passed through a
* `mapper` function.
*
* Stack([ 1, 2 ]).map(x => 10 * x)
* // Stack [ 10, 20 ]
*
* Note: `map()` always returns a new instance, even if it produced the same
* value at every step.
*/
map<M>(
mapper: (value: T, key: number, iter: this) => M,
context?: any
): Stack<M>;
/**
* Flat-maps the Stack, returning a new Stack.
*
* Similar to `stack.map(...).flatten(true)`.
*/
flatMap<M>(
mapper: (value: T, key: number, iter: this) => Iterable<M>,
context?: any
): Stack<M>;
/**
* Returns a new Set with only the values for which the `predicate`
* function returns true.
*
* Note: `filter()` always returns a new instance, even if it results in
* not filtering out any values.
*/
filter<F extends T>(
predicate: (value: T, index: number, iter: this) => value is F,
context?: any
): Set<F>;
filter(
predicate: (value: T, index: number, iter: this) => any,
context?: any
): this;
/**
* Returns a Stack "zipped" with the provided collections.
*
* Like `zipWith`, but using the default `zipper`: creating an `Array`.
*
* ```js
* const a = Stack([ 1, 2, 3 ]);
* const b = Stack([ 4, 5, 6 ]);
* const c = a.zip(b); // Stack [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ]
* ```
*/
zip<U>(other: Collection<any, U>): Stack<[T,U]>;
zip<U,V>(other: Collection<any, U>, other2: Collection<any,V>): Stack<[T,U,V]>;
zip(...collections: Array<Collection<any, any>>): Stack<any>;
/**
* Returns a Stack "zipped" with the provided collections.
*
* Unlike `zip`, `zipAll` continues zipping until the longest collection is
* exhausted. Missing values from shorter collections are filled with `undefined`.
*
* ```js
* const a = Stack([ 1, 2 ]);
* const b = Stack([ 3, 4, 5 ]);
* const c = a.zipAll(b); // Stack [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ]
* ```
*
* Note: Since zipAll will return a collection as large as the largest
* input, some results may contain undefined values. TypeScript cannot
* account for these without cases (as of v2.5).
*/
zipAll<U>(other: Collection<any, U>): Stack<[T,U]>;
zipAll<U,V>(other: Collection<any, U>, other2: Collection<any,V>): Stack<[T,U,V]>;
zipAll(...collections: Array<Collection<any, any>>): Stack<any>;
/**
* Returns a Stack "zipped" with the provided collections by using a
* custom `zipper` function.
*
* ```js
* const a = Stack([ 1, 2, 3 ]);
* const b = Stack([ 4, 5, 6 ]);
* const c = a.zipWith((a, b) => a + b, b);
* // Stack [ 5, 7, 9 ]
* ```
*/
zipWith<U, Z>(
zipper: (value: T, otherValue: U) => Z,
otherCollection: Collection<any, U>
): Stack<Z>;
zipWith<U, V, Z>(
zipper: (value: T, otherValue: U, thirdValue: V) => Z,
otherCollection: Collection<any, U>,
thirdCollection: Collection<any, V>
): Stack<Z>;
zipWith<Z>(
zipper: (...any: Array<any>) => Z,
...collections: Array<Collection<any, any>>
): Stack<Z>;
}
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface Factory<TProps extends Object> {
(values?: Partial<TProps> | Iterable<[string, any]>): Record<TProps> & Readonly<TProps>;
new (values?: Partial<TProps> | Iterable<[string, any]>): Record<TProps> & Readonly<TProps>;
/**
* The name provided to `Record(values, name)` can be accessed with
* `displayName`.
*/
displayName: string;
}
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface Record<TProps extends Object> {
// Reading values
has(key: string): key is keyof TProps & string;
/**
* Returns the value associated with the provided key, which may be the
* default value defined when creating the Record factory function.
*
* If the requested key is not defined by this Record type, then
* notSetValue will be returned if provided. Note that this scenario would
* produce an error when using Flow or TypeScript.
*/
get<K extends keyof TProps>(key: K, notSetValue?: any): TProps[K];
get<T>(key: string, notSetValue: T): T;
// Reading deep values
hasIn(keyPath: Iterable<any>): boolean;
getIn(keyPath: Iterable<any>): any;
// Value equality
equals(other: any): boolean;
hashCode(): number;
// Persistent changes
set<K extends keyof TProps>(key: K, value: TProps[K]): this;
update<K extends keyof TProps>(key: K, updater: (value: TProps[K]) => TProps[K]): this;
merge(...collections: Array<Partial<TProps> | Iterable<[string, any]>>): this;
mergeDeep(...collections: Array<Partial<TProps> | Iterable<[string, any]>>): this;
mergeWith(
merger: (oldVal: any, newVal: any, key: keyof TProps) => any,
...collections: Array<Partial<TProps> | Iterable<[string, any]>>
): this;
mergeDeepWith(
merger: (oldVal: any, newVal: any, key: any) => any,
...collections: Array<Partial<TProps> | Iterable<[string, any]>>
): this;
/**
* Returns a new instance of this Record type with the value for the
* specific key set to its default value.
*
* @alias remove
*/
delete<K extends keyof TProps>(key: K): this;
remove<K extends keyof TProps>(key: K): this;
/**
* Returns a new instance of this Record type with all values set
* to their default values.
*/
clear(): this;
// Deep persistent changes
setIn(keyPath: Iterable<any>, value: any): this;
updateIn(keyPath: Iterable<any>, updater: (value: any) => any): this;
mergeIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
mergeDeepIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
/**
* @alias removeIn
*/
deleteIn(keyPath: Iterable<any>): this;
removeIn(keyPath: Iterable<any>): this;
// Conversion to JavaScript types
/**
* Deeply converts this Record to equivalent native JavaScript Object.
*
* Note: This method may not be overridden. Objects with custom
* serialization to plain JS may override toJSON() instead.
*/
toJS(): { [K in keyof TProps]: any };
/**
* Shallowly converts this Record to equivalent native JavaScript Object.
*/
toJSON(): TProps;
/**
* Shallowly converts this Record to equivalent JavaScript Object.
*/
toObject(): TProps;
// Transient changes
/**
* Note: Not all methods can be used on a mutable collection or within
* `withMutations`! Only `set` may be used mutatively.
*
* @see `Map#withMutations`
*/
withMutations(mutator: (mutable: this) => any): this;
/**
* @see `Map#asMutable`
*/
asMutable(): this;
/**
* @see `Map#wasAltered`
*/
wasAltered(): boolean;
/**
* @see `Map#asImmutable`
*/
asImmutable(): this;
// Sequence algorithms
toSeq(): Seq.Keyed<keyof TProps, TProps[keyof TProps]>;
[Symbol.iterator](): IterableIterator<[keyof TProps, TProps[keyof TProps]]>;
}
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface Keyed<K, V> extends Seq<K, V>, Collection.Keyed<K, V> {
/**
* Deeply converts this Keyed Seq to equivalent native JavaScript Object.
*
* Converts keys to Strings.
*/
toJS(): Object;
/**
* Shallowly converts this Keyed Seq to equivalent native JavaScript Object.
*
* Converts keys to Strings.
*/
toJSON(): { [key: string]: V };
/**
* Shallowly converts this collection to an Array.
*/
toArray(): Array<[K, V]>;
/**
* Returns itself
*/
toSeq(): this;
/**
* Returns a new Seq with other collections concatenated to this one.
*
* All entries will be present in the resulting Seq, even if they
* have the same key.
*/
concat<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): Seq.Keyed<K | KC, V | VC>;
concat<C>(...collections: Array<{[key: string]: C}>): Seq.Keyed<K | string, V | C>;
/**
* Returns a new Seq.Keyed with values passed through a
* `mapper` function.
*
* ```js
* const { Seq } = require('immutable')
* Seq.Keyed({ a: 1, b: 2 }).map(x => 10 * x)
* // Seq { "a": 10, "b": 20 }
* ```
*
* Note: `map()` always returns a new instance, even if it produced the
* same value at every step.
*/
map<M>(
mapper: (value: V, key: K, iter: this) => M,
context?: any
): Seq.Keyed<K, M>;
/**
* @see Collection.Keyed.mapKeys
*/
mapKeys<M>(
mapper: (key: K, value: V, iter: this) => M,
context?: any
): Seq.Keyed<M, V>;
/**
* @see Collection.Keyed.mapEntries
*/
mapEntries<KM, VM>(
mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
context?: any
): Seq.Keyed<KM, VM>;
/**
* Flat-maps the Seq, returning a Seq of the same type.
*
* Similar to `seq.map(...).flatten(true)`.
*/
flatMap<KM, VM>(
mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
context?: any
): Seq.Keyed<KM, VM>;
/**
* Returns a new Seq with only the entries for which the `predicate`
* function returns true.
*
* Note: `filter()` always returns a new instance, even if it results in
* not filtering out any values.
*/
filter<F extends V>(
predicate: (value: V, key: K, iter: this) => value is F,
context?: any
): Seq.Keyed<K, F>;
filter(
predicate: (value: V, key: K, iter: this) => any,
context?: any
): this;
/**
* @see Collection.Keyed.flip
*/
flip(): Seq.Keyed<V, K>;
}
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface Indexed<T> extends Seq<number, T>, Collection.Indexed<T> {
/**
* Deeply converts this Indexed Seq to equivalent native JavaScript Array.
*/
toJS(): Array<any>;
/**
* Shallowly converts this Indexed Seq to equivalent native JavaScript Array.
*/
toJSON(): Array<T>;
/**
* Shallowly converts this collection to an Array.
*/
toArray(): Array<T>;
/**
* Returns itself
*/
toSeq(): this
/**
* Returns a new Seq with other collections concatenated to this one.
*/
concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): Seq.Indexed<T | C>;
/**
* Returns a new Seq.Indexed with values passed through a
* `mapper` function.
*
* ```js
* const { Seq } = require('immutable')
* Seq.Indexed([ 1, 2 ]).map(x => 10 * x)
* // Seq [ 10, 20 ]
* ```
*
* Note: `map()` always returns a new instance, even if it produced the
* same value at every step.
*/
map<M>(
mapper: (value: T, key: number, iter: this) => M,
context?: any
): Seq.Indexed<M>;
/**
* Flat-maps the Seq, returning a a Seq of the same type.
*
* Similar to `seq.map(...).flatten(true)`.
*/
flatMap<M>(
mapper: (value: T, key: number, iter: this) => Iterable<M>,
context?: any
): Seq.Indexed<M>;
/**
* Returns a new Seq with only the values for which the `predicate`
* function returns true.
*
* Note: `filter()` always returns a new instance, even if it results in
* not filtering out any values.
*/
filter<F extends T>(
predicate: (value: T, index: number, iter: this) => value is F,
context?: any
): Seq.Indexed<F>;
filter(
predicate: (value: T, index: number, iter: this) => any,
context?: any
): this;
/**
* Returns a Seq "zipped" with the provided collections.
*
* Like `zipWith`, but using the default `zipper`: creating an `Array`.
*
* ```js
* const a = Seq([ 1, 2, 3 ]);
* const b = Seq([ 4, 5, 6 ]);
* const c = a.zip(b); // Seq [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ]
* ```
*/
zip<U>(other: Collection<any, U>): Seq.Indexed<[T,U]>;
zip<U,V>(other: Collection<any, U>, other2: Collection<any, V>): Seq.Indexed<[T,U,V]>;
zip(...collections: Array<Collection<any, any>>): Seq.Indexed<any>;
/**
* Returns a Seq "zipped" with the provided collections.
*
* Unlike `zip`, `zipAll` continues zipping until the longest collection is
* exhausted. Missing values from shorter collections are filled with `undefined`.
*
* ```js
* const a = Seq([ 1, 2 ]);
* const b = Seq([ 3, 4, 5 ]);
* const c = a.zipAll(b); // Seq [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ]
* ```
*/
zipAll<U>(other: Collection<any, U>): Seq.Indexed<[T,U]>;
zipAll<U,V>(other: Collection<any, U>, other2: Collection<any, V>): Seq.Indexed<[T,U,V]>;
zipAll(...collections: Array<Collection<any, any>>): Seq.Indexed<any>;
/**
* Returns a Seq "zipped" with the provided collections by using a
* custom `zipper` function.
*
* ```js
* const a = Seq([ 1, 2, 3 ]);
* const b = Seq([ 4, 5, 6 ]);
* const c = a.zipWith((a, b) => a + b, b);
* // Seq [ 5, 7, 9 ]
* ```
*/
zipWith<U, Z>(
zipper: (value: T, otherValue: U) => Z,
otherCollection: Collection<any, U>
): Seq.Indexed<Z>;
zipWith<U, V, Z>(
zipper: (value: T, otherValue: U, thirdValue: V) => Z,
otherCollection: Collection<any, U>,
thirdCollection: Collection<any, V>
): Seq.Indexed<Z>;
zipWith<Z>(
zipper: (...any: Array<any>) => Z,
...collections: Array<Collection<any, any>>
): Seq.Indexed<Z>;
}
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface Set<T> extends Seq<T, T>, Collection.Set<T> {
/**
* Deeply converts this Set Seq to equivalent native JavaScript Array.
*/
toJS(): Array<any>;
/**
* Shallowly converts this Set Seq to equivalent native JavaScript Array.
*/
toJSON(): Array<T>;
/**
* Shallowly converts this collection to an Array.
*/
toArray(): Array<T>;
/**
* Returns itself
*/
toSeq(): this
/**
* Returns a new Seq with other collections concatenated to this one.
*
* All entries will be present in the resulting Seq, even if they
* are duplicates.
*/
concat<U>(...collections: Array<Iterable<U>>): Seq.Set<T | U>;
/**
* Returns a new Seq.Set with values passed through a
* `mapper` function.
*
* ```js
* Seq.Set([ 1, 2 ]).map(x => 10 * x)
* // Seq { 10, 20 }
* ```
*
* Note: `map()` always returns a new instance, even if it produced the
* same value at every step.
*/
map<M>(
mapper: (value: T, key: T, iter: this) => M,
context?: any
): Seq.Set<M>;
/**
* Flat-maps the Seq, returning a Seq of the same type.
*
* Similar to `seq.map(...).flatten(true)`.
*/
flatMap<M>(
mapper: (value: T, key: T, iter: this) => Iterable<M>,
context?: any
): Seq.Set<M>;
/**
* Returns a new Seq with only the values for which the `predicate`
* function returns true.
*
* Note: `filter()` always returns a new instance, even if it results in
* not filtering out any values.
*/
filter<F extends T>(
predicate: (value: T, key: T, iter: this) => value is F,
context?: any
): Seq.Set<F>;
filter(
predicate: (value: T, key: T, iter: this) => any,
context?: any
): this;
}
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface Seq<K, V> extends Collection<K, V> {
/**
* Some Seqs can describe their size lazily. When this is the case,
* size will be an integer. Otherwise it will be undefined.
*
* For example, Seqs returned from `map()` or `reverse()`
* preserve the size of the original `Seq` while `filter()` does not.
*
* Note: `Range`, `Repeat` and `Seq`s made from `Array`s and `Object`s will
* always have a size.
*/
readonly size: number | undefined;
// Force evaluation
/**
* Because Sequences are lazy and designed to be chained together, they do
* not cache their results. For example, this map function is called a total
* of 6 times, as each `join` iterates the Seq of three values.
*
* var squares = Seq([ 1, 2, 3 ]).map(x => x * x)
* squares.join() + squares.join()
*
* If you know a `Seq` will be used multiple times, it may be more
* efficient to first cache it in memory. Here, the map function is called
* only 3 times.
*
* var squares = Seq([ 1, 2, 3 ]).map(x => x * x).cacheResult()
* squares.join() + squares.join()
*
* Use this method judiciously, as it must fully evaluate a Seq which can be
* a burden on memory and possibly performance.
*
* Note: after calling `cacheResult`, a Seq will always have a `size`.
*/
cacheResult(): this;
// Sequence algorithms
/**
* Returns a new Seq with values passed through a
* `mapper` function.
*
* ```js
* const { Seq } = require('immutable')
* Seq([ 1, 2 ]).map(x => 10 * x)
* // Seq [ 10, 20 ]
* ```
*
* Note: `map()` always returns a new instance, even if it produced the same
* value at every step.
*/
map<M>(
mapper: (value: V, key: K, iter: this) => M,
context?: any
): Seq<K, M>;
/**
* Returns a new Seq with values passed through a
* `mapper` function.
*
* ```js
* const { Seq } = require('immutable')
* Seq([ 1, 2 ]).map(x => 10 * x)
* // Seq [ 10, 20 ]
* ```
*
* Note: `map()` always returns a new instance, even if it produced the same
* value at every step.
* Note: used only for sets.
*/
map<M>(
mapper: (value: V, key: K, iter: this) => M,
context?: any
): Seq<M, M>;
/**
* Flat-maps the Seq, returning a Seq of the same type.
*
* Similar to `seq.map(...).flatten(true)`.
*/
flatMap<M>(
mapper: (value: V, key: K, iter: this) => Iterable<M>,
context?: any
): Seq<K, M>;
/**
* Flat-maps the Seq, returning a Seq of the same type.
*
* Similar to `seq.map(...).flatten(true)`.
* Note: Used only for sets.
*/
flatMap<M>(
mapper: (value: V, key: K, iter: this) => Iterable<M>,
context?: any
): Seq<M, M>;
/**
* Returns a new Seq with only the values for which the `predicate`
* function returns true.
*
* Note: `filter()` always returns a new instance, even if it results in
* not filtering out any values.
*/
filter<F extends V>(
predicate: (value: V, key: K, iter: this) => value is F,
context?: any
): Seq<K, F>;
filter(
predicate: (value: V, key: K, iter: this) => any,
context?: any
): this;
}
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface Keyed<K, V> extends Collection<K, V> {
/**
* Deeply converts this Keyed collection to equivalent native JavaScript Object.
*
* Converts keys to Strings.
*/
toJS(): Object;
/**
* Shallowly converts this Keyed collection to equivalent native JavaScript Object.
*
* Converts keys to Strings.
*/
toJSON(): { [key: string]: V };
/**
* Shallowly converts this collection to an Array.
*/
toArray(): Array<[K, V]>;
/**
* Returns Seq.Keyed.
* @override
*/
toSeq(): Seq.Keyed<K, V>;
// Sequence functions
/**
* Returns a new Collection.Keyed of the same type where the keys and values
* have been flipped.
*
* <!-- runkit:activate -->
* ```js
* const { Map } = require('immutable')
* Map({ a: 'z', b: 'y' }).flip()
* // Map { "z": "a", "y": "b" }
* ```
*/
flip(): Collection.Keyed<V, K>;
/**
* Returns a new Collection with other collections concatenated to this one.
*/
concat<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): Collection.Keyed<K | KC, V | VC>;
concat<C>(...collections: Array<{[key: string]: C}>): Collection.Keyed<K | string, V | C>;
/**
* Returns a new Collection.Keyed with values passed through a
* `mapper` function.
*
* ```js
* const { Collection } = require('immutable')
* Collection.Keyed({ a: 1, b: 2 }).map(x => 10 * x)
* // Seq { "a": 10, "b": 20 }
* ```
*
* Note: `map()` always returns a new instance, even if it produced the
* same value at every step.
*/
map<M>(
mapper: (value: V, key: K, iter: this) => M,
context?: any
): Collection.Keyed<K, M>;
/**
* Returns a new Collection.Keyed of the same type with keys passed through
* a `mapper` function.
*
* <!-- runkit:activate -->
* ```js
* const { Map } = require('immutable')
* Map({ a: 1, b: 2 }).mapKeys(x => x.toUpperCase())
* // Map { "A": 1, "B": 2 }
* ```
*
* Note: `mapKeys()` always returns a new instance, even if it produced
* the same key at every step.
*/
mapKeys<M>(
mapper: (key: K, value: V, iter: this) => M,
context?: any
): Collection.Keyed<M, V>;
/**
* Returns a new Collection.Keyed of the same type with entries
* ([key, value] tuples) passed through a `mapper` function.
*
* <!-- runkit:activate -->
* ```js
* const { Map } = require('immutable')
* Map({ a: 1, b: 2 })
* .mapEntries(([ k, v ]) => [ k.toUpperCase(), v * 2 ])
* // Map { "A": 2, "B": 4 }
* ```
*
* Note: `mapEntries()` always returns a new instance, even if it produced
* the same entry at every step.
*/
mapEntries<KM, VM>(
mapper: (entry: [K, V], index: number, iter: this) => [KM, VM],
context?: any
): Collection.Keyed<KM, VM>;
/**
* Flat-maps the Collection, returning a Collection of the same type.
*
* Similar to `collection.map(...).flatten(true)`.
*/
flatMap<KM, VM>(
mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>,
context?: any
): Collection.Keyed<KM, VM>;
/**
* Returns a new Collection with only the values for which the `predicate`
* function returns true.
*
* Note: `filter()` always returns a new instance, even if it results in
* not filtering out any values.
*/
filter<F extends V>(
predicate: (value: V, key: K, iter: this) => value is F,
context?: any
): Collection.Keyed<K, F>;
filter(
predicate: (value: V, key: K, iter: this) => any,
context?: any
): this;
[Symbol.iterator](): IterableIterator<[K, V]>;
}
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface Set<T> extends Collection<T, T> {
/**
* Deeply converts this Set collection to equivalent native JavaScript Array.
*/
toJS(): Array<any>;
/**
* Shallowly converts this Set collection to equivalent native JavaScript Array.
*/
toJSON(): Array<T>;
/**
* Shallowly converts this collection to an Array.
*/
toArray(): Array<T>;
/**
* Returns Seq.Set.
* @override
*/
toSeq(): Seq.Set<T>;
// Sequence algorithms
/**
* Returns a new Collection with other collections concatenated to this one.
*/
concat<U>(...collections: Array<Iterable<U>>): Collection.Set<T | U>;
/**
* Returns a new Collection.Set with values passed through a
* `mapper` function.
*
* ```
* Collection.Set([ 1, 2 ]).map(x => 10 * x)
* // Seq { 1, 2 }
* ```
*
* Note: `map()` always returns a new instance, even if it produced the
* same value at every step.
*/
map<M>(
mapper: (value: T, key: T, iter: this) => M,
context?: any
): Collection.Set<M>;
/**
* Flat-maps the Collection, returning a Collection of the same type.
*
* Similar to `collection.map(...).flatten(true)`.
*/
flatMap<M>(
mapper: (value: T, key: T, iter: this) => Iterable<M>,
context?: any
): Collection.Set<M>;
/**
* Returns a new Collection with only the values for which the `predicate`
* function returns true.
*
* Note: `filter()` always returns a new instance, even if it results in
* not filtering out any values.
*/
filter<F extends T>(
predicate: (value: T, key: T, iter: this) => value is F,
context?: any
): Collection.Set<F>;
filter(
predicate: (value: T, key: T, iter: this) => any,
context?: any
): this;
[Symbol.iterator](): IterableIterator<T>;
}
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
InterfaceDeclaration
|
/**
* The interface to fulfill to qualify as a Value Object.
*/
export interface ValueObject {
/**
* True if this and the other Collection have value equality, as defined
* by `Immutable.is()`.
*
* Note: This is equivalent to `Immutable.is(this, other)`, but provided to
* allow for chained expressions.
*/
equals(other: any): boolean;
/**
* Computes and returns the hashed identity for this Collection.
*
* The `hashCode` of a Collection is used to determine potential equality,
* and is used when adding this to a `Set` or as a key in a `Map`, enabling
* lookup via a different instance.
*
* <!-- runkit:activate -->
* ```js
* const { List, Set } = require('immutable');
* const a = List([ 1, 2, 3 ]);
* const b = List([ 1, 2, 3 ]);
* assert.notStrictEqual(a, b); // different instances
* const set = Set([ a ]);
* assert.equal(set.has(b), true);
* ```
*
* Note: hashCode() MUST return a Uint32 number. The easiest way to
* guarantee this is to return `myHash | 0` from a custom implementation.
*
* If two values have the same `hashCode`, they are [not guaranteed
* to be equal][Hash Collision]. If two values have different `hashCode`s,
* they must not be equal.
*
* Note: `hashCode()` is not guaranteed to always be called before
* `equals()`. Most but not all Immutable.js collections use hash codes to
* organize their internal data structures, while all Immutable.js
* collections use equality during lookups.
*
* [Hash Collision]: http://en.wikipedia.org/wiki/Collision_(computer_science)
*/
hashCode(): number;
}
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
TypeAliasDeclaration
|
/**
* RecordOf<T> is used in TypeScript to define interfaces expecting an
* instance of record with type T.
*
* This is equivalent to an instance of a record created by a Record Factory.
*/
export type RecordOf<TProps extends Object> = Record<TProps> &
Readonly<TProps>;
|
applitopia/immutable-sorted
|
type-definitions/Immutable.d.ts
|
TypeScript
|
ClassDeclaration
|
export class HelpCategory {
constructor(private jar: HttpService) {}
public getAll(): Observable<IHelpCategory[]> {
return this.jar.get<IHelpCategory[]>('help/categories');
}
public create(data: { name: string; description: string }): Observable<IHelpCategory> {
return this.jar.post<IHelpCategory>('help/categories', data);
}
public update(category: IHelpCategory): Observable<IHelpCategory> {
return this.jar.patch<IHelpCategory>(`help/categories/${category.id}`, pick(category, ['name', 'description', 'order']));
}
public destroy(category: IHelpCategory): Observable<void> {
return this.jar.delete<void>(`help/categories/${category.id}`);
}
}
|
StreamJar/frontend-common
|
packages/@streamjar/frontend-common-core/src/models/help-category.model.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface IHelpCategory extends Identifiable, Dated {
name: string;
description: string;
order: number;
slug: string;
}
|
StreamJar/frontend-common
|
packages/@streamjar/frontend-common-core/src/models/help-category.model.ts
|
TypeScript
|
MethodDeclaration
|
public getAll(): Observable<IHelpCategory[]> {
return this.jar.get<IHelpCategory[]>('help/categories');
}
|
StreamJar/frontend-common
|
packages/@streamjar/frontend-common-core/src/models/help-category.model.ts
|
TypeScript
|
MethodDeclaration
|
public create(data: { name: string; description: string }): Observable<IHelpCategory> {
return this.jar.post<IHelpCategory>('help/categories', data);
}
|
StreamJar/frontend-common
|
packages/@streamjar/frontend-common-core/src/models/help-category.model.ts
|
TypeScript
|
MethodDeclaration
|
public update(category: IHelpCategory): Observable<IHelpCategory> {
return this.jar.patch<IHelpCategory>(`help/categories/${category.id}`, pick(category, ['name', 'description', 'order']));
}
|
StreamJar/frontend-common
|
packages/@streamjar/frontend-common-core/src/models/help-category.model.ts
|
TypeScript
|
MethodDeclaration
|
public destroy(category: IHelpCategory): Observable<void> {
return this.jar.delete<void>(`help/categories/${category.id}`);
}
|
StreamJar/frontend-common
|
packages/@streamjar/frontend-common-core/src/models/help-category.model.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface comments{
uid?: string;
stars?: number;
uidUser?: string;
uidRecipe?: string;
comment?: string;
difficult?: number;
timeStamp?: any;
displayName?: string;
userRecipe?: string;
}
|
iHector1/yummy
|
src/app/shared/models/comments.interface.ts
|
TypeScript
|
InterfaceDeclaration
|
interface Jovo {
$googleAction?: GoogleAction;
/**
* Returns googleAction instance
* @returns {GoogleAction}
*/
googleAction(): GoogleAction;
/**
* Type of platform is Google Action
* @public
* @return {boolean} isGoogleAction
*/
isGoogleAction(): boolean;
}
|
Braimah-Abiola/jovo-framework
|
jovo-platforms/jovo-platform-googleassistant/src/index.ts
|
TypeScript
|
InterfaceDeclaration
|
/**
* Sets alexa handlers
* @public
* @param {*} handler
*/
interface BaseApp {
setGoogleAssistantHandler(...handler: Handler[]): this;
}
|
Braimah-Abiola/jovo-framework
|
jovo-platforms/jovo-platform-googleassistant/src/index.ts
|
TypeScript
|
InterfaceDeclaration
|
interface GoogleAction {
/**
* Ask for name
* @public
* @param {string} optContext
*/
askForName(optContext?: string): this;
/**
* Ask for zipcode and city
* @public
* @param {string} optContext
*/
askForZipCodeAndCity(optContext?: string): this;
/**
* Ask for name permission
* @public
* @param {string} optContext
*/
askForNamePermission(optContext?: string): this;
/**
* Ask for coarse location permission
* @public
* @param {string} optContext
*/
askForCoarseLocation(optContext?: string): this;
/**
* Ask for precise permissions
* @public
* @param {string} optContext
*/
askForPreciseLocation(optContext?: string): this;
/**
* Calls askForNotification(intent, name, text)
*
* @public
* @param {string} intent // intent for which you want to send notifications
*/
askForUpdate(intent: string): this;
/**
* Ask for notification permission
* @public
* @param {string} intent // intent for which you want to send notifications
*/
askForNotification(intent: string): this;
/**
* Ask for permissions
* @public
* @param {'NAME'|'DEVICE_COARSE_LOCATION'|'DEVICE_PRECISE_LOCATION'} permissions
* @param {string} optContext
*/
askForPermission(permissions: string[], optContext?: string): this;
/**
* Returns true if permission granted
* @return {boolean}
*/
isPermissionGranted(): boolean;
/**
* Ask form sign in
* @public
* @param {string} optContext
*/
askForSignIn(optContext?: string): this;
/**
* Returns sign in status after sign in
* @public
* @return {boolean}
*/
getSignInStatus(): string;
/**
* Returns sign in cancelled
* @public
* @return {boolean}
*/
isSignInCancelled(): boolean;
/**
* Returns sign in denied
* @public
* @return {boolean}
*/
isSignInDenied(): boolean;
/**
* Returns sign in ok
* @public
* @return {null|string}
*/
isSignInOk(): boolean;
/**
* Ask for date time
* @public
* @param {*} questions
*/
askForDateTime(questions: {
requestDatetimeText: string;
requestDateText: string;
requestTimeText: string;
}): this;
/**
* Return date time confirmation value
* @returns {string}
*/
getDateTime(): string;
/**
* Return place confirmation value
* @return {object}
*/
getPlace(): object | undefined;
/**
* Ask for confirmation
* @public
* @param {*} text
*/
askForConfirmation(text: string): this;
/**
* Return confirmation status
* @returns {boolean}
*/
isConfirmed(): boolean;
/**
* Ask for place
* @param {string} requestPrompt
* @param {string} permissionContext
* @returns {this}
*/
askForPlace(requestPrompt: string, permissionContext?: string): this;
/**
* Return device object
* @returns {Device}
*/
getDevice(): Device;
}
|
Braimah-Abiola/jovo-framework
|
jovo-platforms/jovo-platform-googleassistant/src/index.ts
|
TypeScript
|
InterfaceDeclaration
|
interface GoogleAction {
/**
* Adds basic card to response
* Works only with SCREEN_OUTPUT devices
* @public
* @param {BasicCard} basicCard
* @return {GoogleAction}
*/
showBasicCard(basicCard: BasicCard): this;
/**
* Adds suggestion chips to response
* Works only with SCREEN_OUTPUT devices
* @public
* @param {Array<String>} chips
* @return {GoogleAction}
*/
showSuggestionChips(chips: string[]): this;
/**
* Adds link out suggestion chip to response
* @public
* @param {string} destinationName
* @param {string} url
* @return {GoogleAction}
*/
showLinkOutSuggestion(destinationName: string, url: string): this;
/**
* Adds carousel element to response
* Works only with SCREEN_OUTPUT devices
* @public
* @param {Carousel} carousel
* @return {GoogleAction}
*/
showCarousel(carousel: Carousel): this;
/**
* Adds carousel browse element to response
* Works only with SCREEN_OUTPUT devices
* @public
* @param {Carousel} carouselBrowse
* @return {GoogleAction}
*/
showCarouselBrowse(carouselBrowse: CarouselBrowse): this;
/**
* Implementation of generic withSimpleTable
* Shows a simple table card to the response object
* @public
* @param {string} title
* @param {string} subtitle
* @param {array} columnHeaders
* @param {array} rowsText
* @return {GoogleAction} this
*/
showSimpleTable(
title: string,
subtitle: string,
columnHeaders: string[],
rowsText: string[][],
): this;
/**
* Adds table to response
* Works only with SCREEN_OUTPUT devices
* @public
* @param {Table} table
* @return {GoogleAction}
*/
showTable(table: Table): this;
/**
* Adds list element to response
* Works only with SCREEN_OUTPUT devices
* @public
* @param {List} list
* @return {GoogleAction}
*/
showList(list: List): this;
/**
* Returns token of the request
* (Touched/Selected Element )
* @public
* @return {*}
*/
getSelectedElementId(): string;
}
|
Braimah-Abiola/jovo-framework
|
jovo-platforms/jovo-platform-googleassistant/src/index.ts
|
TypeScript
|
InterfaceDeclaration
|
interface GoogleAction {
displayText(displayText: string): this;
richResponse(richResponse: RichResponse): this;
appendResponse(responseItem: Item): this;
appendSimpleResponse(simpleResponse: SimpleResponse): this;
addSessionEntity(
name: string,
value: string,
synonyms: string[],
entityOverrideMode?: EntityOverrideMode,
): this;
addSessionEntityTypes(sessionEntityTypes: SessionEntityType[]): this;
addSessionEntityType(sessionEntityType: SessionEntityType): this;
}
|
Braimah-Abiola/jovo-framework
|
jovo-platforms/jovo-platform-googleassistant/src/index.ts
|
TypeScript
|
InterfaceDeclaration
|
interface GoogleAction {
$audioPlayer?: MediaResponse;
$mediaResponse?: MediaResponse;
$updates?: Updates;
audioPlayer(): MediaResponse | undefined;
mediaResponse(): MediaResponse | undefined;
}
|
Braimah-Abiola/jovo-framework
|
jovo-platforms/jovo-platform-googleassistant/src/index.ts
|
TypeScript
|
InterfaceDeclaration
|
interface GoogleAction {
$transaction?: Transaction;
}
|
Braimah-Abiola/jovo-framework
|
jovo-platforms/jovo-platform-googleassistant/src/index.ts
|
TypeScript
|
InterfaceDeclaration
|
interface GoogleAction {
htmlResponse(obj: {
url?: string;
data?: Record<string, any>; // tslint:disable-line
suppress?: boolean;
}): this;
}
|
Braimah-Abiola/jovo-framework
|
jovo-platforms/jovo-platform-googleassistant/src/index.ts
|
TypeScript
|
InterfaceDeclaration
|
interface GoogleAction {
newSurface(capabilities: string[], context: string, notificationTitle: string): this;
isNewSurfaceConfirmed(): boolean;
}
|
Braimah-Abiola/jovo-framework
|
jovo-platforms/jovo-platform-googleassistant/src/index.ts
|
TypeScript
|
InterfaceDeclaration
|
interface GoogleAction {
$notification?: Notification;
notification(): Notification | undefined;
}
|
Braimah-Abiola/jovo-framework
|
jovo-platforms/jovo-platform-googleassistant/src/index.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface AppGoogleAssistantConfig {
GoogleAssistant?: Config;
}
|
Braimah-Abiola/jovo-framework
|
jovo-platforms/jovo-platform-googleassistant/src/index.ts
|
TypeScript
|
InterfaceDeclaration
|
interface Output {
GoogleAssistant: {
AskForPermission?: {
permissions: string[];
optContext: string;
};
AskForUpdatePermission?: {
intent: string;
arguments?: object;
};
AskForRegisterUpdate?: {
intent: string;
frequency: string;
};
AskForSignIn?: {
optContext: string;
};
AskForDateTime?: {
requestDatetimeText: string;
requestDateText: string;
requestTimeText: string;
};
AskForConfirmation?: string;
AskForPlace?: {
requestPrompt: string;
permissionContext: string;
};
card?: {
BasicCard?: BasicCard;
};
SuggestionChips?: string[];
LinkOutSuggestion?: {
destinationName: string;
url: string;
};
CarouselBrowse?: CarouselBrowse;
Carousel?: Carousel;
Table?: Table;
List?: List;
MediaResponse?: MediaObject;
// transactions
AskForDeliveryAddress?: {
reason: string;
};
TransactionDecision?: {
orderOptions?: OrderOptions;
paymentOptions: PaymentOptions;
proposedOrder: any; // tslint:disable-line
};
TransactionRequirementsCheck?: {};
TransactionDigitalPurchaseRequirementsCheck?: {};
TransactionOrder?: {
order: Order;
presentationOptions?: PresentationOptions;
orderOptions?: OrderOptions;
paymentParameters?: PaymentParameters;
};
TransactionOrderUpdate?: {
orderUpdate: OrderUpdateV3;
};
OrderUpdate?: {
orderUpdate: OrderUpdate;
speech: string;
};
CompletePurchase?: {
skuId: SkuId;
};
HtmlResponse?: {
url?: string;
data?: Record<string, any>; // tslint:disable-line
suppress?: boolean;
};
NewSurface?: {
capabilities: string[];
context: string;
notificationTitle: string;
};
RichResponse?: RichResponse;
ResponseAppender?: Item[];
SessionEntityTypes?: SessionEntityType[];
};
}
|
Braimah-Abiola/jovo-framework
|
jovo-platforms/jovo-platform-googleassistant/src/index.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface AppPlatformConfig extends AppGoogleAssistantConfig {}
|
Braimah-Abiola/jovo-framework
|
jovo-platforms/jovo-platform-googleassistant/src/index.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface ExtensiblePluginConfigs extends AppGoogleAssistantConfig {}
|
Braimah-Abiola/jovo-framework
|
jovo-platforms/jovo-platform-googleassistant/src/index.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface ProdutorModel {
categoria: string;
cep: string;
cidade: string;
cpf: string;
endereco: string;
nascimento: string;
nome: string;
telefone: string;
}
|
teoitinga/ares-suporte-net
|
src/app/shared/models/produtor-model.ts
|
TypeScript
|
ClassDeclaration
|
/**
* This class represents the main application component.
*/
@Component({
moduleId: module.id,
selector: 'jg-app',
templateUrl: 'app.component.html',
styleUrls: ['app.component.css'],
})
export class AppComponent {
}
|
Anrymart/jgauss
|
src/client/app/app.component.ts
|
TypeScript
|
ArrowFunction
|
(secret: string): boolean => {
try {
return isValidPrivate(Buffer.from(filterOx(secret), "hex"));
} catch (error) {
return false;
}
}
|
JCCDex/jcc_wallet
|
src/moac/index.ts
|
TypeScript
|
ArrowFunction
|
(address: string): boolean => {
return /^(0x)?[0-9a-fA-F]{40}$/.test(filterOx(address));
}
|
JCCDex/jcc_wallet
|
src/moac/index.ts
|
TypeScript
|
ArrowFunction
|
(secret: string): string | null => {
secret = filterOx(secret);
if (!isValidSecret(secret)) {
return null;
}
const buffer = privateToAddress(Buffer.from(secret, "hex"));
const decodeAddress = bufferToHex(buffer);
return decodeAddress;
}
|
JCCDex/jcc_wallet
|
src/moac/index.ts
|
TypeScript
|
ArrowFunction
|
(): IWalletModel => {
const _w = Wallet.generate();
return { address: _w.getAddressString(), secret: _w.getPrivateKeyString() };
}
|
JCCDex/jcc_wallet
|
src/moac/index.ts
|
TypeScript
|
ClassDeclaration
|
export class Mutable extends TestSuite {
constructor() {
super(false); // override useFreeze
}
set(obj, key, val) {
obj[key] = val;
return obj;
}
setDeep(obj, key1, key2, val) {
obj[key1][key2] = val;
return obj;
}
setIn(obj, path, val) {
let idx, j, ptr, ref1;
ptr = obj;
for (idx = j = 0, ref1 = path.length - 1; 0 <= ref1 ? j < ref1 : j > ref1; idx = 0 <= ref1 ? ++j : --j) {
ptr = ptr[path[idx]];
}
ptr[path[path.length - 1]] = val;
return obj;
}
merge(obj1, obj2) {
const ref1 = Object.keys(obj2);
const results1: any[] = [];
for (let j = 0, len = ref1.length; j < len; j++) {
const key = ref1[j];
results1.push(obj1[key] = obj2[key]);
}
return results1;
}
setAt(arr, idx, val) {
arr[idx] = val;
return arr;
}
setAtDeep(arr, idx1, idx2, val) {
arr[idx1][idx2] = val;
return arr;
}
}
|
conordickinson/immutable-benchmarks
|
src/Mutable.ts
|
TypeScript
|
MethodDeclaration
|
set(obj, key, val) {
obj[key] = val;
return obj;
}
|
conordickinson/immutable-benchmarks
|
src/Mutable.ts
|
TypeScript
|
MethodDeclaration
|
setDeep(obj, key1, key2, val) {
obj[key1][key2] = val;
return obj;
}
|
conordickinson/immutable-benchmarks
|
src/Mutable.ts
|
TypeScript
|
MethodDeclaration
|
setIn(obj, path, val) {
let idx, j, ptr, ref1;
ptr = obj;
for (idx = j = 0, ref1 = path.length - 1; 0 <= ref1 ? j < ref1 : j > ref1; idx = 0 <= ref1 ? ++j : --j) {
ptr = ptr[path[idx]];
}
ptr[path[path.length - 1]] = val;
return obj;
}
|
conordickinson/immutable-benchmarks
|
src/Mutable.ts
|
TypeScript
|
MethodDeclaration
|
merge(obj1, obj2) {
const ref1 = Object.keys(obj2);
const results1: any[] = [];
for (let j = 0, len = ref1.length; j < len; j++) {
const key = ref1[j];
results1.push(obj1[key] = obj2[key]);
}
return results1;
}
|
conordickinson/immutable-benchmarks
|
src/Mutable.ts
|
TypeScript
|
MethodDeclaration
|
setAt(arr, idx, val) {
arr[idx] = val;
return arr;
}
|
conordickinson/immutable-benchmarks
|
src/Mutable.ts
|
TypeScript
|
MethodDeclaration
|
setAtDeep(arr, idx1, idx2, val) {
arr[idx1][idx2] = val;
return arr;
}
|
conordickinson/immutable-benchmarks
|
src/Mutable.ts
|
TypeScript
|
MethodDeclaration
|
/**
* @deprecated v1.7.6
*
*/
setup(): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Register options and optgroups
*
*/
setupOptions(options?: TomOption[], optgroups?: TomOption[]): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Sets up default rendering functions.
*/
setupTemplates(): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Maps fired events to callbacks provided
* in the settings used when creating the control.
*/
setupCallbacks(): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Triggered when the main control element
* has a click event.
*
*/
onClick(): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* @deprecated v1.7
*
*/
onMouseDown(): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Triggered when the value of the control has been changed.
* This should propagate the event to the original DOM
* input / select element.
*/
onChange(): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Triggered on <input> paste.
*
*/
onPaste(e: MouseEvent | KeyboardEvent): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Triggered on <input> keypress.
*
*/
onKeyPress(e: KeyboardEvent): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Triggered on <input> keydown.
*
*/
onKeyDown(e: KeyboardEvent): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Triggered on <input> keyup.
*
*/
onKeyUp(e: MouseEvent | KeyboardEvent): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Triggered on <input> focus.
*
*/
onFocus(e?: MouseEvent | KeyboardEvent): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Triggered on <input> blur.
*
*/
onBlur(): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Triggered when the user clicks on an option
* in the autocomplete dropdown menu.
*
*/
onOptionSelect(evt: MouseEvent | KeyboardEvent, option: HTMLElement): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Triggered when the user clicks on an item
* that has been selected.
*
*/
onItemSelect(evt?: MouseEvent, item?: TomItem): boolean;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Determines whether or not to invoke
* the user-provided option provider / loader
*
* Note, there is a subtle difference between
* this.canLoad() and this.settings.shouldLoad();
*
* - settings.shouldLoad() is a user-input validator.
* When false is returned, the not_loading template
* will be added to the dropdown
*
* - canLoad() is lower level validator that checks
* the Tom Select instance. There is no inherent user
* feedback when canLoad returns false
*
*/
canLoad(value: string): boolean;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Invokes the user-provided option provider / loader.
*
*/
load(value: string): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Invoked by the user-provided option provider
*
*/
loadCallback(options: TomOption[], optgroups: TomOption[]): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Sets the input field of the control to the specified value.
*
*/
setTextboxValue(value?: string): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Returns the value of the control. If multiple items
* can be selected (e.g. <select multiple>), this returns
* an array. If only one item can be selected, this
* returns a string.
*
*/
getValue(): string | string[];
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Resets the selected items to the given value.
*
*/
setValue(value: string | string[], silent?: boolean): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Resets the number of max items to the given value
*
*/
setMaxItems(value: null | number): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Sets the selected item.
*
*/
setActiveItem(item?: TomItem, e?: MouseEvent | KeyboardEvent): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Set the active and last-active classes
*
*/
setActiveItemClass(item: TomItem): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Remove active item
*
*/
removeActiveItem(item: TomItem): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Clears all the active items
*
*/
clearActiveItems(): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Sets the selected item in the dropdown menu
* of available options.
*
*/
setActiveOption(option: null | HTMLElement): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Sets the dropdown_content scrollTop to display the option
*
*/
scrollToOption(option: null | HTMLElement, behavior?: string): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Scroll the dropdown to the given position
*
*/
scroll(scrollTop: number, behavior?: string): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Clears the active option
*
*/
clearActiveOption(): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Selects all items (CTRL + A).
*/
selectAll(): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Determines if the control_input should be in a hidden or visible state
*
*/
inputState(): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Hides the input element out of view, while
* retaining its focus.
* @deprecated 1.3
*/
hideInput(): void;
|
Denis9822/northeastorchestra
|
public/assets/vendor/tom-select/dist/types/tom-select.d.ts
|
TypeScript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.