import { JSONSchema4 } from 'json-schema'; /** * Many schemas define a type as an array of types to indicate union types. * To avoid having the type generator be aware of that, we transform those types * into their corresponding typescript definitions. * * -------------------------------------------------- * * Strictly speaking, these definitions are meant to allow the literal 'null' value * to be used in addition to the actual types. However, since union types are not supported * in jsii, allowing this would mean falling back to 'any' and loosing all type safety for such * properties. Transforming it into a single concrete optional type provides both type safety and * the option to omit the property. What it doesn't allow is explicitly passing 'null', which might * be desired in some cases. For now we prefer type safety over that. * * 1. ['null', ''] -> optional '' * 2. ['null', '', ''] -> optional 'any' * * This is the normal jsii conversion, nothing much we can do here. * * 3. ['', ''] -> 'any' */ export declare function reduceNullTypeArray(def: JSONSchema4): JSONSchema4;