mobx-bonsai
Version:
A fast lightweight alternative to MobX-State-Tree + Y.js two-way binding
17 lines (16 loc) • 392 B
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;
}