mobx-bonsai
Version:
A fast lightweight alternative to MobX-State-Tree + Y.js two-way binding
18 lines (16 loc) • 374 B
text/typescript
import { PathElement } from "./pathTypes"
/**
* Path from an object to its immediate parent.
*
* @template T Parent object type.
*/
export interface ParentPath<T extends object> {
/**
* Parent object.
*/
readonly parent: T
/**
* Property name (if the parent is an object) or index number (if the parent is an array).
*/
readonly path: PathElement
}