Skip to content

Commit

Permalink
Refine options Flow type
Browse files Browse the repository at this point in the history
  • Loading branch information
reyronald committed Sep 5, 2018
1 parent 30c0fd7 commit b862bd3
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/preact.js.flow
Expand Up @@ -9,5 +9,20 @@ declare function render(vnode: Node, parent: Element, toReplace?: Element): Elem
export { h, createElement, cloneElement, Component, render };
export default { h, createElement, cloneElement, Component, render };

declare type VNode<P> = {
nodeName: string | Function,
children: Array<VNode<P> | string>,
key?: string | number | void,
attributes: P,
};

declare export function rerender(): void;
declare export var options: Object;
declare export var options: {
syncComponentUpdates?: boolean,
vnode?: (vnode: VNode<any>) => void,
afterMount?: (component: Component) => void,
afterUpdate?: (component: Component) => void,
beforeUnmount?: (component: Component) => void,
debounceRendering?: (rerender: () => void) => void,
event?: (event: Event) => Event | void,
};

0 comments on commit b862bd3

Please sign in to comment.