Skip to content
Snippets Groups Projects
Commit 56d0e15e authored by David Sehnal's avatar David Sehnal
Browse files

mol-state: wip

parent 60e43d0a
No related branches found
No related tags found
No related merge requests found
File moved
/**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
*/
export interface EventDispatcher {
// TODO
}
\ No newline at end of file
......@@ -7,9 +7,24 @@
import { StateObject } from './object';
import { TransformTree } from './tree/tree';
import { Transform } from './tree/transform';
import { Map as ImmutableMap } from 'immutable';
import { StateContext } from './context/context';
export interface State {
export interface State<ObjectProps = unknown> {
definition: State.Definition<ObjectProps>,
objects: Map<Transform.InstanceId, StateObject>
}
export namespace State {
export type ObjectProps<P> = ImmutableMap<Transform.InstanceId, P>
export interface Definition<P = unknown> {
tree: TransformTree,
objects: Map<Transform.InstanceId, StateObject>,
history: TransformTree[]
// things like object visibility
props: ObjectProps<P>
}
export async function update<P>(context: StateContext, old: State<P>, tree: Definition<P>, props?: ObjectProps<P>): Promise<State<P>> {
throw 'nyi';
}
}
/**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
*/
// TODO: relactive transformer params controller
\ No newline at end of file
......@@ -4,7 +4,7 @@
* @author David Sehnal <david.sehnal@gmail.com>
*/
import { EventDispatcher } from '../context/event';
import { EventDispatcher } from '../event/event';
export interface TransformContext {
/** An event dispatcher for executing child tasks. */
......
......@@ -4,4 +4,6 @@
* @author David Sehnal <david.sehnal@gmail.com>
*/
// TODO
\ No newline at end of file
export interface TreeTransaction {
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment