Files
react-native/packages/react-native-codegen/src/parsers/flow/methods.js
T
Michał Osadnik 11ff5670a9 Prepare a skeleton for native modules schema json generating
Summary: It's a skeleton for preparing schema json from native modules. Right not it does nothing, but it should considered as a kind of workplace for further work

Reviewed By: TheSavior, cpojer, RSNara

Differential Revision: D16107216

fbshipit-source-id: 12717d015e7409d980ef16cccd81330fa978b0b1
2019-07-04 05:41:16 -07:00

34 lines
710 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.
*
* @flow strict-local
* @format
*/
'use strict';
import type {MethodTypeShape} from '../../CodegenSchema.js';
function buildMethodSchema(property) {
return undefined;
}
// $FlowFixMe there's no flowtype for ASTs
type PropAST = Object;
function getMethods(
typeDefinition: $ReadOnlyArray<PropAST>,
): $ReadOnlyArray<MethodTypeShape> {
return typeDefinition
.filter(property => property.type === 'ObjectTypeProperty')
.map(buildMethodSchema)
.filter(Boolean);
}
module.exports = {
getMethods,
};