~evanj/wigly

wigly/index.d.ts -rw-r--r-- 835 bytes
0777ca6fEvan M Jones Merge pull request #1 from mini-eggs/dependabot/npm_and_yarn/lodash.merge-4.6.2 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
export as namespace wigly;

export interface VNode<Props = {}> {
  name: string;
  props: Props;
  children: Array<VNode>;
  element: Element | null;
  key: string | null;
  type: number;
}

export type Children = VNode | string | number | null;

export function h<Props>(
  name: string,
  props?: Props | null,
  ...children: Array<Children | Children[]>
): VNode<Props>;

export function render(
  rootComponent: VNode,
  container: Element
): Promise<Element>;

export function state<StateValue>(
  initialValue: StateValue | (() => StateValue)
): [StateValue, (nextValue: StateValue) => void];

export function effect(effectHandle: (el: Element) => Function | void): void;

declare global {
  namespace JSX {
    interface Element extends VNode<any> {}
    interface IntrinsicElements {
      [elemName: string]: any;
    }
  }
}