mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Following out internal communication we decided to change logic of current parser to consider types which extend 'TurboModule' instead of looking at default exports. It also cassed for minor changes i n testing logic and updating snapshots. Reviewed By: rickhanlonii Differential Revision: D16200939 fbshipit-source-id: a21cbfc461647df2b9210c0eca4c2c95c285dfe1
39 lines
757 B
JavaScript
39 lines
757 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
* @flow
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import type {SchemaType, MethodTypeShape} from '../../../CodegenSchema.js';
|
|
|
|
export type NativeModuleSchemaBuilderConfig = $ReadOnly<{|
|
|
properties: $ReadOnlyArray<MethodTypeShape>,
|
|
|}>;
|
|
|
|
function buildModuleSchema(
|
|
{properties}: NativeModuleSchemaBuilderConfig,
|
|
moduleName: string,
|
|
): SchemaType {
|
|
return {
|
|
modules: {
|
|
[`Native${moduleName}`]: {
|
|
nativeModules: {
|
|
[moduleName]: {
|
|
properties,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
}
|
|
|
|
module.exports = {
|
|
buildModuleSchema,
|
|
};
|