export type JsonPrimitive = string | number | boolean | null;

export type JsonValue =
  | JsonPrimitive
  | { readonly [key: string]: JsonValue }
  | readonly JsonValue[];

export interface ApiErrorBody {
  readonly message: string;
  readonly code?: string;
  readonly details?: JsonValue;
}

export interface ApiListResponse<TItem> {
  readonly rows: readonly TItem[];
  readonly count: number;
}

export type ApiRequestBody = object | readonly unknown[];
