FabricUIManager.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @flow strict-local
  8. * @format
  9. */
  10. 'use strict';
  11. import type {
  12. MeasureOnSuccessCallback,
  13. MeasureInWindowOnSuccessCallback,
  14. MeasureLayoutOnSuccessCallback,
  15. } from '../Renderer/shims/ReactNativeTypes';
  16. // TODO: type these properly.
  17. type Node = {...};
  18. type NodeSet = Array<Node>;
  19. type NodeProps = {...};
  20. type InstanceHandle = {...};
  21. type Spec = {|
  22. +createNode: (
  23. reactTag: number,
  24. viewName: string,
  25. rootTag: number,
  26. props: NodeProps,
  27. instanceHandle: InstanceHandle,
  28. ) => Node,
  29. +cloneNode: (node: Node) => Node,
  30. +cloneNodeWithNewChildren: (node: Node) => Node,
  31. +cloneNodeWithNewProps: (node: Node, newProps: NodeProps) => Node,
  32. +cloneNodeWithNewChildrenAndProps: (node: Node, newProps: NodeProps) => Node,
  33. +createChildSet: (rootTag: number) => NodeSet,
  34. +appendChild: (parentNode: Node, child: Node) => Node,
  35. +appendChildToSet: (childSet: NodeSet, child: Node) => void,
  36. +completeRoot: (rootTag: number, childSet: NodeSet) => void,
  37. +setNativeProps: (node: Node, nativeProps: NodeProps) => void,
  38. +measure: (node: Node, callback: MeasureOnSuccessCallback) => void,
  39. +measureInWindow: (
  40. node: Node,
  41. callback: MeasureInWindowOnSuccessCallback,
  42. ) => void,
  43. +measureLayout: (
  44. node: Node,
  45. relativeNode: Node,
  46. onFail: () => void,
  47. onSuccess: MeasureLayoutOnSuccessCallback,
  48. ) => void,
  49. |};
  50. const FabricUIManager: ?Spec = global.nativeFabricUIManager;
  51. module.exports = FabricUIManager;