2018-03-18 19:04:10 -07:00
|
|
|
/**
|
2018-09-11 15:27:47 -07:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2018-03-18 19:04:10 -07:00
|
|
|
*
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
2018-07-17 22:41:37 -07:00
|
|
|
#include <unordered_map>
|
2018-03-18 19:04:10 -07:00
|
|
|
|
|
|
|
#include <folly/dynamic.h>
|
|
|
|
|
|
|
|
namespace facebook {
|
|
|
|
namespace react {
|
|
|
|
|
|
|
|
/*
|
|
|
|
* `Tag` and `InstanceHandle` are used to address React Native components.
|
|
|
|
*/
|
|
|
|
using Tag = int32_t;
|
2018-10-09 16:25:13 -07:00
|
|
|
using InstanceHandle = struct InstanceHandleDummyStruct {
|
|
|
|
} *;
|
2018-03-18 19:04:10 -07:00
|
|
|
|
2018-09-26 10:02:04 -07:00
|
|
|
/*
|
|
|
|
* An id of a running Surface instance that is used to refer to the instance.
|
|
|
|
*/
|
|
|
|
using SurfaceId = int32_t;
|
|
|
|
|
2018-03-18 19:04:10 -07:00
|
|
|
/*
|
|
|
|
* `RawProps` represents untyped map with props comes from JavaScript side.
|
|
|
|
*/
|
|
|
|
// TODO(T26954420): Use iterator as underlying type for RawProps.
|
2018-07-17 22:41:37 -07:00
|
|
|
using RawProps = std::unordered_map<std::string, folly::dynamic>;
|
2018-03-18 19:04:10 -07:00
|
|
|
using SharedRawProps = std::shared_ptr<const RawProps>;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Universal component handle which allows to refer to `ComponentDescriptor`s
|
|
|
|
* in maps efficiently.
|
|
|
|
* Practically, it's something that concrete ShadowNode and concrete
|
|
|
|
* ComponentDescriptor have in common.
|
|
|
|
*/
|
2018-08-04 09:30:13 -07:00
|
|
|
using ComponentHandle = int64_t;
|
2018-03-18 19:04:10 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* String identifier for components used for addressing them from
|
|
|
|
* JavaScript side.
|
|
|
|
*/
|
|
|
|
using ComponentName = std::string;
|
|
|
|
|
|
|
|
} // namespace react
|
|
|
|
} // namespace facebook
|