๐Ÿ“ฆ facebook / react-native

๐Ÿ“„ react-dom_v17.x.x.js ยท 141 lines
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141declare module 'react-dom' {
  import type {Component} from 'react';

  declare var version: string;

  declare function findDOMNode(
    componentOrElement: Element | ?Component<any, any>
  ): null | Element | Text;

  declare function render<ElementType: React.ElementType>(
    element: ExactReactElement_DEPRECATED<ElementType>,
    container: Element,
    callback?: () => void
  ): React.ElementRef<ElementType>;

  declare function hydrate<ElementType: React.ElementType>(
    element: ExactReactElement_DEPRECATED<ElementType>,
    container: Element,
    callback?: () => void
  ): React.ElementRef<ElementType>;

  declare function createPortal(
    node: React.Node,
    container: Element
  ): React.Portal;

  declare function unmountComponentAtNode(container: any): boolean;

  declare function unstable_batchedUpdates<A, B, C, D, E>(
    callback: (a: A, b: B, c: C, d: D, e: E) => mixed,
    a: A,
    b: B,
    c: C,
    d: D,
    e: E
  ): void;

  declare function unstable_renderSubtreeIntoContainer<
    ElementType: React.ElementType
  >(
    parentComponent: Component<any, any>,
    nextElement: ExactReactElement_DEPRECATED<ElementType>,
    container: any,
    callback?: () => void
  ): React.ElementRef<ElementType>;
}

declare module 'react-dom/server' {
  declare var version: string;

  declare function renderToString(element: React.Node): string;

  declare function renderToStaticMarkup(element: React.Node): string;

  declare function renderToNodeStream(element: React.Node): stream$Readable;

  declare function renderToStaticNodeStream(
    element: React.Node
  ): stream$Readable;
}

declare module 'react-dom/test-utils' {
  import type {Component} from 'react';

  declare interface Thenable {
    then(resolve: () => mixed, reject?: () => mixed): mixed,
  }

  declare var Simulate: {
    [eventName: string]: (
      element: Element,
      eventData?: { [key: string]: mixed, ... }
    ) => void,
    ...
  };

  declare function renderIntoDocument(
    instance: React.MixedElement
  ): Component<any, any>;

  declare function mockComponent(
    componentClass: React.ElementType,
    mockTagName?: string
  ): { [key: string]: mixed, ... };

  declare function isElement(element: React.MixedElement): boolean;

  declare function isElementOfType(
    element: React.MixedElement,
    componentClass: React.ElementType
  ): boolean;

  declare function isDOMComponent(instance: any): boolean;

  declare function isCompositeComponent(
    instance: Component<any, any>
  ): boolean;

  declare function isCompositeComponentWithType(
    instance: Component<any, any>,
    componentClass: React.ElementType
  ): boolean;

  declare function findAllInRenderedTree(
    tree: Component<any, any>,
    test: (child: Component<any, any>) => boolean
  ): Array<Component<any, any>>;

  declare function scryRenderedDOMComponentsWithClass(
    tree: Component<any, any>,
    className: string
  ): Array<Element>;

  declare function findRenderedDOMComponentWithClass(
    tree: Component<any, any>,
    className: string
  ): ?Element;

  declare function scryRenderedDOMComponentsWithTag(
    tree: Component<any, any>,
    tagName: string
  ): Array<Element>;

  declare function findRenderedDOMComponentWithTag(
    tree: Component<any, any>,
    tagName: string
  ): ?Element;

  declare function scryRenderedComponentsWithType(
    tree: Component<any, any>,
    componentClass: React.ElementType
  ): Array<Component<any, any>>;

  declare function findRenderedComponentWithType(
    tree: Component<any, any>,
    componentClass: React.ElementType
  ): ?Component<any, any>;

  declare function act(callback: () => void | Thenable): Thenable;
}