/**
 * Utility type for JSON:API resource flattening.
 *
 * The SDK runtime unwraps JSON:API envelopes via `flattenResource()`:
 *   { id, type, attributes: { a, b }, relationships: { r } }  →  { id, type, a, b, r }
 *
 * Generated types in `_internal/types.gen.ts` keep the nested envelope shape.
 * `FlatResource<T>` mirrors the runtime flattening at the type level so namespace
 * method return types match what callers actually receive.
 *
 * @example
 * ```ts
 * import type { ClinicalMealPlan } from "./_internal/types.gen";
 * import type { FlatResource } from "./json-api";
 *
 * type MealPlan = FlatResource<ClinicalMealPlan>;
 * // MealPlan.status works directly — no .attributes?.status
 * ```
 */
export type FlatResource<T> = T extends {
    id: string;
    type: string;
    attributes?: infer A;
    relationships?: infer R;
} ? Omit<T, "attributes" | "relationships"> & (NonNullable<A> extends Record<string, unknown> ? NonNullable<A> : {}) & (NonNullable<R> extends Record<string, unknown> ? NonNullable<R> : {}) : T;
//# sourceMappingURL=json-api.d.ts.map