Skip to content

Instantly share code, notes, and snippets.

@dagda1
Last active March 7, 2019 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dagda1/3b632906b53905ece716d00d7f7d9c15 to your computer and use it in GitHub Desktop.
Save dagda1/3b632906b53905ece716d00d7f7d9c15 to your computer and use it in GitHub Desktop.
import * as React from 'react';
import { Config } from 'kapellmeister';
import { GetInterpolator } from '..';
export type MakeState<T> = { [P in keyof T]: T[P] extends number | string ? T[P] | T[P][] : MakeState<T[P]> };
export interface INodeGroupProps<T = any, State = any> {
data: T[];
keyAccessor: (data: T, index: number) => string | number;
start: (data: T, index: number) => State & Partial<Config>;
enter?: (data: T, index: number) => MakeState<State> & Partial<Config>;
update?: (data: T, index: number) => MakeState<State> & Partial<Config>;
leave?: (data: T, index: number) => MakeState<State> & Partial<Config>;
children: (nodes: T & { key: string | number; data: T; state: State }[]) => React.ReactElement<any>;
}
export declare class INodeGroup<T = any, State = any> extends React.Component<INodeGroupProps<T, State>> {}
export default INodeGroup;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment