morphir-elm
Version:
Elm bindings for Morphir
36 lines (35 loc) • 1.2 kB
TypeScript
import { Set as ISet, ValueObject } from 'immutable';
import BackedDataStructure from './backed-structure';
/**
* This module has functions to help you work with morphir Sets!
*/
export default class Set<T> extends BackedDataStructure<ISet<T>> implements ValueObject {
/**
* Create an empty list.
*/
static empty<T>(): Set<T>;
/**
* Create a Set from an iterable.
* @param iterable the iterable to create the Set from.
* @returns a new Set containing the elements from the iterable.
*/
static from<T>(iterable: Iterable<T>): Set<T>;
static encoder<T>(encoder: (t: T) => any): (set: Set<T>) => any;
static decoder<T>(decoder: (v: any) => T): (input: any) => Set<T>;
private constructor();
/**
* Get the size of this Set.
*/
get size(): number;
/**
* Get an iterator for this Set.
*/
get iterator(): IterableIterator<T>;
add(value: T): Set<T>;
remove(value: T): Set<T>;
union(list: Set<T>): Set<T>;
reduce<R>(reducer: (acc: R, value: T) => R, initialValue: R): R;
equals(other: Set<T>): boolean;
hashCode(): number;
toString(): string;
}