export function isSerializableInterface()

in src/jsii2schema.ts [496:509]


export function isSerializableInterface(type: jsiiReflect.Type | undefined, errorPrefix?: string): type is jsiiReflect.InterfaceType {
  if (!type || !(type instanceof jsiiReflect.InterfaceType)) {
    return false;
  }

  if (type.allMethods.length > 0) {
    return false;
  }

  return type.allProperties.every(p =>
    isSerializableTypeReference(p.type, errorPrefix)
      || isConstruct(p.type)
      || p.optional);
}