import * as Latest from "./latest"; import type { DereferencedNonOptionalTypeShapeOrReference, TypeShapeOrReference } from "./types"; export type UnwrappedReference = { shape: DereferencedNonOptionalTypeShapeOrReference; availability: Latest.Availability | undefined; descriptions: string[]; visitedTypeIds: Set; isOptional: boolean; isNullable: boolean; default?: unknown; }; export type UnwrappedObjectType = { properties: Latest.ObjectProperty[]; extraProperties: Latest.TypeReference | null | undefined; descriptions: string[]; visitedTypeIds: Set; }; /** * A TypeShape or TypeReference might be an alias or reference to another type. * This function unwraps the reference, including any optional wrappers, to get the actual shape. * * When optionals are detected, attempt to find the default value for the shape. * Since aliases can be recursive, the first default value found is returned, which can be contained in: * - the optional wrapper * - the type reference id * - the primitive or literal shape itself * * @param typeRef to unwrap * @param types from the API definition * @returns UnwrappedReference containing the shape, whether it is optional, and the default value if it exists */ export declare function unwrapReference(typeRef: TypeShapeOrReference, types: Record): UnwrappedReference; export declare function unwrapReference(typeRef: TypeShapeOrReference | undefined, types: Record): UnwrappedReference | undefined; /** * Dereferences extended objects and returns all properties of the object. * If an object extends another object, the properties of the extended object will be sorted alphabetically. * Additionally, required properties will come before optional properties. * * @param object to dereference * @param types from the API definition * @returns the properties of the object, including properties from extended objects */ export declare function unwrapObjectType(object: Latest.ObjectType, types: Record, parentVisitedTypeIds?: Set): UnwrappedObjectType; /** * The discriminant of a discriminated union is converted to a literal type, *prepended* to the additional properties. */ export declare function unwrapDiscriminatedUnionVariant(union: Pick, variant: Latest.DiscriminatedUnionVariant, types: Record): UnwrappedObjectType; //# sourceMappingURL=unwrap.d.ts.map