import { EnumValue } from './enum-value'; import { GenType } from './gen-type'; import { OpenAPIObject, SchemaObject } from './openapi-typings'; import { Options } from './options'; import { Property } from './property'; /** * Context to generate a model */ export declare class Model extends GenType { openApi: OpenAPIObject; schema: SchemaObject; isSimple: boolean; isEnum: boolean; isObject: boolean; simpleType: string; enumValues: EnumValue[]; enumArrayName?: string; enumArrayFileName?: string; elementType: string; properties: Property[]; additionalPropertiesType: string; orphanRequiredProperties: string[]; constructor(openApi: OpenAPIObject, name: string, schema: SchemaObject, options: Options); protected initPathToRoot(): string; protected skipImport(name: string): boolean; /** * Returns the appropriate type name for a referenced model, considering import aliases */ getImportTypeName(referencedModelName: string): string; private collectObject; private _additionalPropertiesSchema?; /** * Finalizes additional properties type after all property types are resolved */ private finalizeAdditionalPropertiesType; /** * Collects names of required properties whose declaration is not inline in an * allOf member, so they cannot be marked as required directly and must be * enforced afterwards via `Required>` in the template. * * The first case is an allOf member that only lists `required` names without * declaring the properties themselves (they live in another, usually * referenced, member). * * The second case is a name listed in the enclosing schema's own `required` * array whose property is declared in a referenced member. Names declared * inline (as a direct property or within an allOf member) are handled directly * while building the intersection type (see gen-utils' tsType), and names that * don't resolve to any declared property are left untouched. See issue #395. */ private collectOrphanRequiredProperties; /** * Recursively collects the names of properties declared by a schema, following * references and allOf members. Used to tell whether a required name actually * resolves to a property that is a usable key of the generated intersection type. */ private collectDeclaredPropertyNames; }