UNPKG

nitro-codegen

Version:

The code-generator for react-native-nitro-modules.

10 lines (9 loc) 454 B
import { createNamedType } from './createType.js'; export function getInterfaceProperties(language, interfaceType) { return interfaceType.getProperties().map((prop) => { const declaration = prop.getValueDeclarationOrThrow(); const propType = prop.getTypeAtLocation(declaration); const refType = createNamedType(language, prop.getName(), propType, prop.isOptional() || propType.isNullable()); return refType; }); }