@hydra-cg/heracles.ts > TypesCollection
Provides a collection of types that can be filtered with relevant criteria.
class:
FilterableCollection<string>
↳ TypesCollection
⊕ new TypesCollection(types?: Iterable<string>): TypesCollection
Overrides FilterableCollection.constructor
Defined in DataModel/Collections/TypesCollection.ts:13
Initializes a new instance of the TypesCollection class with initial collections of types to filter.
Parameters:
| Name | Type | 
|---|---|
| Optionaltypes | Iterable<string> | 
Returns: TypesCollection
<Static> empty● empty: TypesCollection = new TypesCollection()
Defined in DataModel/Collections/TypesCollection.ts:13
Defines an empty types collection.
constant: {TypesCollection}
get isCollection(): boolean
Defined in DataModel/Collections/TypesCollection.ts:37
Gets a value indicating that resource owning this type’s collection has hydra:Collection type.
Returns: boolean
get length(): number
Inherited from FilterableCollection.length
Defined in DataModel/Collections/FilterableCollection.ts:38
Gets the number of items in this collection.
readonly:
Returns: number
▸ __@iterator(): Iterator<string>
Inherited from FilterableCollection.[@iterator](/Heracles.ts/classes/filterablecollection.html#_iterator)
Defined in DataModel/Collections/FilterableCollection.ts:111
inheritdoc:
Returns: Iterator<string>
▸ any(): boolean
Inherited from FilterableCollection.any
Defined in DataModel/Collections/FilterableCollection.ts:52
Checks whether this collection has any items fitlered.
Returns: boolean
▸ contains(type: string): boolean
Defined in DataModel/Collections/TypesCollection.ts:46
Checks whether this collection has a given type.
Parameters:
| Name | Type | Description | 
|---|---|---|
| type | string | Type to look for. | 
Returns: boolean
<Protected> createInstance▸ createInstance(items: Iterable<string>): TypesCollection
Overrides FilterableCollection.createInstance
Defined in DataModel/Collections/TypesCollection.ts:54
Parameters:
| Name | Type | 
|---|---|
| items | Iterable<string> | 
Returns: TypesCollection
▸ except(type: string): TypesCollection
Defined in DataModel/Collections/TypesCollection.ts:50
Parameters:
| Name | Type | 
|---|---|
| type | string | 
Returns: TypesCollection
▸ first(): string
Inherited from FilterableCollection.first
Defined in DataModel/Collections/FilterableCollection.ts:60
Gets the first item of the collection or null if there are no items matching the criteria.
Returns: string
▸ last(): string
Inherited from FilterableCollection.last
Defined in DataModel/Collections/FilterableCollection.ts:69
Gets the last item of the collection or null if there are no items matching the criteria.
Returns: string
<Protected> narrowFiltersWith▸ narrowFiltersWith<TValue>(predicate: string, matchEvaluator: function): FilterableCollection<string>
▸ narrowFiltersWith(predicate: string, value: string | RegExp): FilterableCollection<string>
Inherited from FilterableCollection.narrowFiltersWith
Defined in DataModel/Collections/FilterableCollection.ts:129
Creates a new instance of the FilterableCollection with filter made narrower with given predicate.
Type parameters:
Parameters:
| Name | Type | Description | 
|---|---|---|
| predicate | string | Predicate of the filter. | 
| matchEvaluator | function | Match evaluator of the predicate to filter. | 
Returns: FilterableCollection<string>
Inherited from FilterableCollection.narrowFiltersWith
Defined in DataModel/Collections/FilterableCollection.ts:140
Creates a new instance of the FilterableCollection with filter made narrower with given predicate.
Parameters:
| Name | Type | Description | 
|---|---|---|
| predicate | string | Predicate of the filter. | 
| value | string|RegExp | Either value or regular expression to match the value of the predicate to filter. | 
Returns: FilterableCollection<string>
▸ toArray(): string[]
Inherited from FilterableCollection.toArray
Defined in DataModel/Collections/FilterableCollection.ts:101
Flattens this collection to a standard array.
Returns: string[]
▸ where(matchEvaluator: function): FilterableCollection<string>
Inherited from FilterableCollection.where
Defined in DataModel/Collections/FilterableCollection.ts:83
Filters the collection with a generic match evaluator.
Parameters:
| Name | Type | Description | 
|---|---|---|
| matchEvaluator | function | Match evaluation delegate. | 
Returns: FilterableCollection<string>