import type { OpenAPIV3_1 } from 'openapi-types'; type SchemaObject = OpenAPIV3_1.SchemaObject; type ReferenceObject = OpenAPIV3_1.ReferenceObject; type PropMap = Record; /** * Returns true when a component schema X has at least one readOnly or writeOnly property * (in its direct properties or an inline-object allOf member). When true, two variants * should be emitted: X (read shape) and XWritable (write shape). * Does not recurse into $ref targets: only direct flags are inspected here. * The transitive case (container whose nested $refs reach a split schema) is handled * separately in buildWritableVariantMap via a fixpoint pass. */ export declare function schemaHasSplitProperties(schema: SchemaObject | ReferenceObject): boolean; /** * Extract the raw (un-sanitized) component schema name from a component $ref. * Returns undefined when the ref is not a standard component schema ref. * E.g. '#/components/schemas/CreateUserRequest' -> 'CreateUserRequest' */ export declare function rawSchemaNameFromRef(ref: string): string | undefined; /** * Given a component schema $ref and a writable-variant map, resolve the type name * to use for a request body. When the referenced schema has a writable variant * (i.e. it has readOnly or writeOnly properties), returns the XWritable name. * Otherwise returns undefined (caller falls back to the plain ref type name). */ export declare function resolveBodyRefToWritableName(ref: string, writableVariantMap: Map): string | undefined; /** * Build a map from raw schema name to the resolved unique XWritable variant name. * Includes schemas that have readOnly or writeOnly properties directly (the "leaf" case) * AND container schemas whose nested component $refs transitively reach a split schema * (the "transitive container" case). XWritable names are uniquified against all top-level * schema safe names so they never collide. * * The transitive detection runs a fixpoint: starting from the direct-split seed, it * repeatedly adds any schema whose nested component ref names intersect the current split * set, until no new additions occur. A visited guard prevents infinite loops on cyclic refs. */ export declare function buildWritableVariantMap(spec: OpenAPIV3_1.Document): Map; /** * Filter a schema's direct properties for the read (response) shape: excludes writeOnly props. * For allOf schemas use filterAllOfMembersForRead instead. */ export declare function readShapeProperties(schema: SchemaObject): PropMap; /** * Return the schema's allOf array with writeOnly properties removed from inline (non-$ref) * members. $ref members are kept unchanged. Used to rebuild the read-shape type for allOf schemas. */ export declare function filterAllOfMembersForRead(schema: SchemaObject): Array; /** * Collect all effective write-shape properties for a schema: direct properties plus inline * allOf member properties, excluding readOnly ones. Required is the union of the direct * `required` and each inline allOf member's `required`. */ export declare function effectiveWriteProperties(schema: SchemaObject): { props: PropMap; required: Set; }; export {}; //# sourceMappingURL=writable-variants.d.ts.map