    import IndexedShadowImpl from 'f.lux/src/IndexedShadowImpl.js'

public class | source

# IndexedShadowImpl

#### Extends:

ShadowImpl → IndexedShadowImpl

## Constructor Summary

Public Constructor
public | constructor(time: *, property: *, name: *, state: *, parent: *, shader: *, prev: *) |

## Member Summary

Public Members
public | [_automounted]: boolean |
public | [_impls]: *[] |
public | [_length]: * |
public | [_mapped]: boolean |
public | [_nextMapping]: * |
public get | length: * |

## Method Summary

Public Methods
public | addChildren(start: *, num: *) |
public | automountChildren(prev: *) |
public | childAt(idx: *): * |
public | childCount(): * |
public | childMapping(): * |
public | children(): undefined[] |
public | clear() |
public | concat(values: ...*): * |
public | defaults(newItems: *) |
public | defineChildProperties(prev: *, inCtor: *) |
public | defineChildProperty(idx: *, elementShader: *, state: *, prev: *, inCtor: boolean) |
public | getChild(idx: *): * |
public | isMapped(): * |
public | keys(): * |
public | merge(newItems: *): * |
public | moveChildren(start: *, deleteCount: *, addCount: *) |
public | onReshadow(prev: *) |
public | pop(): * |
public | push(values: ...*): * |
public | remove(idx: *): * |
public | removeChildren(start: *, num: *) |
public | shift(): * |
public | splice(start: *, deleteCount: *, newItems: ...*): * |
public | toJSON(): {...undefined: Object, "type": string, "length": *, "mapped": *} |
public | unshift(values: ...*): * |
public | values(): undefined[] |

## Inherited Summary

From class ShadowImpl
public | [_access]: * |
public | [_cache]: {} |
public | [_changed]: boolean |
public | [_dead]: boolean |
public | [_didShadowCalled]: boolean |
public | [_futureState]: * |
public | [_invalid]: boolean |
public | [_name]: * |
public | [_nextName]: * |
public | [_preventUpdates]: boolean |
public | [_previousTime]: * |
public | [_property]: * |
public | [_readonly]: * |
public | [_replaced]: boolean |
public | [_scheduled]: boolean |
public | [_shadow]: * |
public | [_state]: * |
public | [_time]: * |
public | [_createShadow](): * |
public | [_defineProperty](prev: *) Maps the getter and setter (if appropriate) onto the parent property. |
public | [_modelForUpdate](): * Gets the next model state for the property. |
public | [_scheduleUpdate](): * Schedules an UPDATE action with the store. |
public | [_setupShadow](prev: *, inCtor: *): * |
public | access(): * |
public | assign(nextState: *, name: *): * Replace the value of this property. |
public | automountChildren() Invoked during defineProperty() to define children properties marked for automount |
public | blockFurtherChildUpdates() Prevents all children from being able to obtain model in update() callbacks. |
public | blockFurtherUpdates(replaced: *) Prevents this property and descendents from providing a model to update() callbacks. |
public | cache(): * |
public | changeParent(newParent: *) |
public | childCount(): number Subclasses should implement this method in such a way as not to trigger a mapping. |
public | children() Gets the implementation objects managed by this property. |
public | copyState(): * Creates a deep clone of the current property state. |
public | createCopy(time: *, newModel: *, parentImpl: *): * Create a copy of the internals during reshadowing when the property has not changed during the update process but some descendant has been modified. |
public | defaults(state: *) Merges a new state into this property by using the 'state' parameter to set default values, ie it will not overwrite any existing values. |
public | defineChildProperties(prev: ShadowImpl, inCtor: boolean) Maps all child properties onto this property using Object.defineProperty(). |
public | definePropertyGetValue(state: *): * Invoked on shadow getter access to obtain the get value. |
public | definePropertySetValue(newValue: *) Invoked on shadow property assignment to perform the replacement f.lux action. |
public | didShadow(time: *, newRoot: *) |
public | dispatchUpdate(action: *) Intended for use by update() and replaying actions. |
public | dotPath(): * Helpful debugging utility that returns the path joined by '.'. |
public | ensureMounted() |
public | findByPath(path: *): * |
public | getChild(name: *): * Gets a child implementation matching a property name or undefined if no such property exists. |
public | hasChildren(): * Gets if the property has an child properties (not whether child properties are supported). |
public | hasPendingChanges(): * Gets if an update has occurred directly to this property. |
public | invalidate(childImpl: *, source: *) Marks property and ancestors as invalid. |
public | isActive(): * Gets if the property represents live data. |
public | isIsolated(): * |
public | isLeaf(): * |
public | isMapped(): boolean Gets if defineChildProperties() has been invoked. |
public | isPrimitive(): boolean Gets if this property type reprsents a primitive javascript type. |
public | isRoot(): * |
public | isUpdatable(): boolean Gets whether the property value supports calls to update(). |
public | isValid(): * Gets if this property or one of its child properties has pending updates. |
public | keys() Gets the keys/indices for this property. |
public | latest(): * |
public | merge(state: *) Merges a new state into this property. |
public | name(): * |
public | nextName(): * Gets the name after all model updates are performed. |
public | nextState(): * Gets the model as it will be once all pending changes are recorded with the store. |
public | obsolete(callback: *) Marks this property as obsolete. |
public | obsoleteChildren() |
public | obsoleteTree(callback: *) Marks the entire subtree as inactive, aka dead. |
public | onReplaced() Hook for when this property is no longer represented in the system state. |
public | onReshadow(prev: *) Property has just been reshadowed. |
public | onUpdate() Hook for when this property is no longer represented in the system state due to a state update - not a replacement. |
public | owner(): * |
public | parent(): * |
public | path(): * Gets an array with the property names/indices from the root to this property. |
public | property(): * |
public | readonly(): * |
public | replaced(): * |
public | reshadowed(prev: *) Invoked by reshadow() function for invalid parent property implementations when the directly managed state did not change. |
public | root(): * |
public | setReadonly(readonly: *) Sets the readonly flag which will prevent a 'set' function being set in defineProeprty(). |
public | setupPropertyAccess(prev: *) Creates shadow properties for root properties and sets this property on the parent property for non-root properties. |
public | shader(state: *): * Gets the shader needed to recreate the shadow property for the state. |
public | shadow(): * Gets the user facing property represented by this implementation object. |
public | slashPath(): * Helpful debugging utility that returns the path joined by '.'. |
public | state(): * |
public | store(): * |
public | switchName() Transfers the nextName to the name attribute. |
public | time(): * |
public | toJSON(): {"name": *, "path": *, "active": *, "valid": *, "state": *} Gets a compact version of this internal's state. It does NOT provide a JSON representation of the model state. The actual Property.toJSON() method returns the model JSON representation. |
public | toString(): * |
public | update(callback: *): boolean Makes changes to the next property state. |
public | updateName(name: *) Changes the name this property will have after updates. |
public | updated() Marks this property as dead. |
public | updatesAllowed(): boolean Gets if shadow property is allowing state updates. |
public | waitFor(callback: *) Invokes a callback once all pending changes have occurred. |
public | willShadow(parentWillUnshadow: boolean) Invoked by the shadowing process to invoke appropriate Property life-cycle methods. |

## Public Constructors

### public constructor(time: *, property: *, name: *, state: *, parent: *, shader: *, prev: *) source

#### Override:

ShadowImpl#constructor

#### Params:

Name | Type | Attribute | Description
time | * |  |
property | * |  |
name | * |  |
state | * |  |
parent | * |  |
shader | * |  |
prev | * |  |

## Public Members

### public [_automounted]: boolean source

### public [_impls]: *[] source

### public [_length]: * source

### public [_mapped]: boolean source

### public [_nextMapping]: * source

### public get length: * source

## Public Methods

### public addChildren(start: *, num: *) source

#### Params:

Name | Type | Attribute | Description
start | * |  |
num | * |  |

### public automountChildren(prev: *) source

Invoked during defineProperty() to define children properties marked for automount

#### Override:

ShadowImpl#automountChildren

#### Params:

Name | Type | Attribute | Description
prev | * |  |

### public childAt(idx: *): * source

#### Params:

Name | Type | Attribute | Description
idx | * |  |

#### Return:

*

### public childCount(): * source

Subclasses should implement this method in such a way as not to trigger a mapping.

#### Override:

ShadowImpl#childCount

#### Return:

*

### public childMapping(): * source

#### Return:

*

### public children(): undefined[] source

Gets the implementation objects managed by this property.

#### Override:

ShadowImpl#children

#### Return:

undefined[]

### public clear() source

### public concat(values: ...*): * source

#### Params:

Name | Type | Attribute | Description
values | ...* |  |

#### Return:

*

### public defaults(newItems: *) source

Merges a new state into this property by using the 'state' parameter to set default values, ie it will not overwrite any existing values. Useful when model objects arrive from external sources, such as an asyncrhonous save or a websocket based update.

#### Override:

ShadowImpl#defaults

#### Params:

Name | Type | Attribute | Description
newItems | * |  |

### public defineChildProperties(prev: *, inCtor: *) source

Maps all child properties onto this property using Object.defineProperty().

#### Override:

ShadowImpl#defineChildProperties

#### Params:

Name | Type | Attribute | Description
prev | * |  |
inCtor | * |  |

### public defineChildProperty(idx: *, elementShader: *, state: *, prev: *, inCtor: boolean) source

#### Params:

Name | Type | Attribute | Description
idx | * |  |
elementShader | * |  |
state | * |  |
prev | * |  |

inCtor

boolean

- optional
- default: false

### public getChild(idx: *): * source

Gets a child implementation matching a property name or undefined if no such property exists.

#### Override:

ShadowImpl#getChild

#### Params:

Name | Type | Attribute | Description
idx | * |  |

#### Return:

*

### public isMapped(): * source

Gets if defineChildProperties() has been invoked.

#### Override:

ShadowImpl#isMapped

#### Return:

*

### public keys(): * source

Gets the keys/indices for this property.

Implementation note: Subclasses should implement this method in such a way as not to trigger a mapping.

#### Override:

ShadowImpl#keys

#### Return:

*

### public merge(newItems: *): * source

Merges a new state into this property. Useful when model objects arrive from external sources, such as an asyncrhonous save or a websocket based update.

#### Override:

ShadowImpl#merge

#### Params:

Name | Type | Attribute | Description
newItems | * |  |

#### Return:

*

### public moveChildren(start: *, deleteCount: *, addCount: *) source

#### Params:

Name | Type | Attribute | Description
start | * |  |
deleteCount | * |  |
addCount | * |  |

### public onReshadow(prev: *) source

Property has just been reshadowed.

#### Override:

ShadowImpl#onReshadow

#### Params:

Name | Type | Attribute | Description
prev | * |  |

### public pop(): * source

#### Return:

*

### public push(values: ...*): * source

#### Params:

Name | Type | Attribute | Description
values | ...* |  |

#### Return:

*

### public remove(idx: *): * source

#### Params:

Name | Type | Attribute | Description
idx | * |  |

#### Return:

*

### public removeChildren(start: *, num: *) source

#### Params:

Name | Type | Attribute | Description
start | * |  |
num | * |  |

### public shift(): * source

#### Return:

*

### public splice(start: *, deleteCount: *, newItems: ...*): * source

#### Params:

Name | Type | Attribute | Description
start | * |  |
deleteCount | * |  |
newItems | ...* |  |

#### Return:

*

### public toJSON(): {...undefined: Object, "type": string, "length": *, "mapped": *} source

Gets a compact version of this internal's state. It does NOT provide a JSON representation of the model state. The actual Property.toJSON() method returns the model JSON representation.

#### Override:

ShadowImpl#toJSON

#### Return:

{...undefined: Object, "type": string, "length": *, "mapped": *}

### public unshift(values: ...*): * source

#### Params:

Name | Type | Attribute | Description
values | ...* |  |

#### Return:

*

### public values(): undefined[] source

#### Return:

undefined[]