API Reference

IIndexValueAccessorinterface

Accessor service for reading or writing values by context and index.

Declaration

export interface IIndexValueAccessor<TContext = unknown, TIndex = unknown> {
  readonly priority: number;
  getResolvedValue(context: TContext, index: TIndex): unknown;
  hasValue(context: TContext, index: TIndex): boolean;
  getValue(context: TContext, index: TIndex): unknown;
  setValue(context: TContext, index: TIndex, value: unknown): void;
  getIndexes(context: TContext, index?: TIndex): IterableIterator<TIndex>;
  applies(context: unknown, index: TIndex): boolean;
}

Import

import type { IIndexValueAccessor } from '@rs-x/core';

Members

7 members in this interface.

readonly priority
propertyreadonly
readonly priority: number

Type

number

applies
method
applies(
  context: unknown,
  index: TIndex
): boolean

Parameters

Name
Type
Required
context
unknown
required
index
TIndex
required

Returns

boolean

getIndexes
method
getIndexes(
  context: TContext,
  index?: TIndex
): IterableIterator<TIndex>

Parameters

Name
Type
Required
context
TContext
required
index?
TIndex
optional

Returns

IterableIterator<TIndex>

getResolvedValue
method
getResolvedValue(
  context: TContext,
  index: TIndex
): unknown

Parameters

Name
Type
Required
context
TContext
required
index
TIndex
required

Returns

unknown

getValue
method
getValue(
  context: TContext,
  index: TIndex
): unknown

Parameters

Name
Type
Required
context
TContext
required
index
TIndex
required

Returns

unknown

hasValue
method
hasValue(
  context: TContext,
  index: TIndex
): boolean

Parameters

Name
Type
Required
context
TContext
required
index
TIndex
required

Returns

boolean

setValue
method
setValue(
  context: TContext,
  index: TIndex,
  value: unknown
): void

Parameters

Name
Type
Required
context
TContext
required
index
TIndex
required
value
unknown
required

Returns

void