import * as _tanstack_react_query from '@tanstack/react-query';
import { S as SerializedContentType, a as SerializedContentItemWithType } from '../../../../shared/stack.B8QD11QU.js';
import 'zod';

interface UseContentTypesResult {
    contentTypes: (SerializedContentType & {
        itemCount: number;
    })[];
    isLoading: boolean;
    error: Error | null;
    refetch: () => void;
}
/**
 * Hook for fetching all content types
 */
declare function useContentTypes(): UseContentTypesResult;
/**
 * Suspense variant of useContentTypes
 */
declare function useSuspenseContentTypes(): {
    contentTypes: (SerializedContentType & {
        itemCount: number;
    })[];
    refetch: () => Promise<unknown>;
};
/**
 * Hook for fetching a single content type by slug
 */
declare function useContentType(slug: string): {
    contentType: SerializedContentType | null;
    isLoading: boolean;
    error: Error | null;
    refetch: () => void;
};
interface UseContentOptions {
    /** Number of items per page (default: 10) */
    limit?: number;
    /** Whether to enable the query (default: true) */
    enabled?: boolean;
}
/**
 * Result type for useContent hook with load more functionality
 * @template TData - The type of parsedData (defaults to Record<string, unknown>)
 */
interface UseContentResult<TData = Record<string, unknown>> {
    /** Array of all loaded content items */
    items: SerializedContentItemWithType<TData>[];
    /** Total number of items available */
    total: number;
    /** Whether the initial load is in progress */
    isLoading: boolean;
    /** Error if the query failed */
    error: Error | null;
    /** Function to load the next page of items */
    loadMore: () => void;
    /** Whether there are more items to load */
    hasMore: boolean;
    /** Whether the next page is being loaded */
    isLoadingMore: boolean;
    /** Function to refetch all items */
    refetch: () => void;
}
/**
 * Hook for fetching paginated content items with load more functionality.
 * Uses React Query's infinite query for efficient pagination.
 *
 * @template TMap - A type map of content type slugs to their data types
 * @template TSlug - The content type slug (inferred from typeSlug parameter)
 *
 * @example
 * ```typescript
 * // Without type safety (backward compatible)
 * const { items, loadMore, hasMore, isLoadingMore } = useContent("product")
 *
 * // With type safety using a type map
 * type MyCMSTypes = {
 *   product: { name: string; price: number }
 *   testimonial: { author: string; quote: string }
 * }
 * const { items, loadMore, hasMore } = useContent<MyCMSTypes, "product">("product")
 * // items[0].parsedData.name is string
 * // items[0].parsedData.price is number
 * ```
 */
declare function useContent<TMap extends Record<string, Record<string, unknown>> = Record<string, Record<string, unknown>>, TSlug extends keyof TMap = keyof TMap>(typeSlug: TSlug & string, options?: UseContentOptions): UseContentResult<TMap[TSlug]>;
/**
 * Suspense variant of useContent with load more functionality.
 *
 * @template TMap - A type map of content type slugs to their data types
 * @template TSlug - The content type slug (inferred from typeSlug parameter)
 */
declare function useSuspenseContent<TMap extends Record<string, Record<string, unknown>> = Record<string, Record<string, unknown>>, TSlug extends keyof TMap = keyof TMap>(typeSlug: TSlug & string, options?: UseContentOptions): {
    items: SerializedContentItemWithType<TMap[TSlug]>[];
    total: number;
    loadMore: () => Promise<unknown>;
    hasMore: boolean;
    isLoadingMore: boolean;
    refetch: () => Promise<unknown>;
};
/**
 * Hook for fetching a single content item by ID with optional type safety.
 *
 * @template TMap - A type map of content type slugs to their data types
 * @template TSlug - The content type slug (inferred from typeSlug parameter)
 *
 * @example
 * ```typescript
 * type MyCMSTypes = { product: { name: string; price: number } }
 * const { item } = useContentItem<MyCMSTypes, "product">("product", "some-id")
 * // item?.parsedData.name is string
 * ```
 */
declare function useContentItem<TMap extends Record<string, Record<string, unknown>> = Record<string, Record<string, unknown>>, TSlug extends keyof TMap = keyof TMap>(typeSlug: TSlug & string, id: string): {
    item: SerializedContentItemWithType<TMap[TSlug]> | null;
    isLoading: boolean;
    error: Error | null;
    refetch: () => void;
};
/**
 * Suspense variant of useContentItem with optional type safety.
 *
 * @template TMap - A type map of content type slugs to their data types
 * @template TSlug - The content type slug (inferred from typeSlug parameter)
 */
declare function useSuspenseContentItem<TMap extends Record<string, Record<string, unknown>> = Record<string, Record<string, unknown>>, TSlug extends keyof TMap = keyof TMap>(typeSlug: TSlug & string, id: string): {
    item: SerializedContentItemWithType<TMap[TSlug]> | null;
    refetch: () => Promise<unknown>;
};
/**
 * Hook for fetching a content item by slug with optional type safety.
 *
 * @template TMap - A type map of content type slugs to their data types
 * @template TSlug - The content type slug (inferred from typeSlug parameter)
 *
 * @example
 * ```typescript
 * type MyCMSTypes = { product: { name: string; price: number } }
 * const { item } = useContentItemBySlug<MyCMSTypes, "product">("product", "my-product")
 * // item?.parsedData.price is number
 * ```
 */
declare function useContentItemBySlug<TMap extends Record<string, Record<string, unknown>> = Record<string, Record<string, unknown>>, TSlug extends keyof TMap = keyof TMap>(typeSlug: TSlug & string, slug: string): {
    item: SerializedContentItemWithType<TMap[TSlug]> | null;
    isLoading: boolean;
    error: Error | null;
    refetch: () => void;
};
/**
 * Hook for creating a content item with optional type safety.
 *
 * @template TData - The type of the content data (defaults to Record<string, unknown>)
 *
 * @example
 * ```typescript
 * type ProductData = { name: string; price: number }
 * const createProduct = useCreateContent<ProductData>("product")
 *
 * // TypeScript will enforce the correct shape
 * createProduct.mutate({
 *   slug: "my-product",
 *   data: { name: "Widget", price: 29.99 }
 * })
 * ```
 */
declare function useCreateContent<TData = Record<string, unknown>>(typeSlug: string): _tanstack_react_query.UseMutationResult<SerializedContentItemWithType<TData>, Error, {
    slug: string;
    data: TData;
}, unknown>;
/**
 * Hook for updating a content item with optional type safety.
 *
 * @template TData - The type of the content data (defaults to Record<string, unknown>)
 *
 * @example
 * ```typescript
 * type ProductData = { name: string; price: number }
 * const updateProduct = useUpdateContent<ProductData>("product")
 *
 * updateProduct.mutate({
 *   id: "item-id",
 *   data: { data: { name: "Updated Widget", price: 39.99 } }
 * })
 * ```
 */
declare function useUpdateContent<TData = Record<string, unknown>>(typeSlug: string): _tanstack_react_query.UseMutationResult<SerializedContentItemWithType<TData>, Error, {
    id: string;
    data: {
        slug?: string;
        data?: TData;
    };
}, unknown>;
/**
 * Hook for deleting a content item
 */
declare function useDeleteContent(typeSlug: string): _tanstack_react_query.UseMutationResult<{
    success: boolean;
}, Error, string, unknown>;
/**
 * Content item with populated relations
 */
interface ContentItemWithRelations<TData = Record<string, unknown>> extends SerializedContentItemWithType<TData> {
    _relations?: Record<string, SerializedContentItemWithType[]>;
}
/**
 * Hook for fetching a content item with its relations populated.
 * Use this when you need to display related items alongside the main item.
 *
 * @template TMap - A type map of content type slugs to their data types
 * @template TSlug - The content type slug (inferred from typeSlug parameter)
 *
 * @example
 * ```typescript
 * type MyCMSTypes = {
 *   resource: { name: string; categoryIds: Array<{ id: string }> }
 *   category: { name: string }
 * }
 * const { item } = useContentItemPopulated<MyCMSTypes, "resource">("resource", "some-id")
 * // item?._relations?.categoryIds contains populated category items
 * ```
 */
declare function useContentItemPopulated<TMap extends Record<string, Record<string, unknown>> = Record<string, Record<string, unknown>>, TSlug extends keyof TMap = keyof TMap>(typeSlug: TSlug & string, id: string): {
    item: ContentItemWithRelations<TMap[TSlug]> | null;
    isLoading: boolean;
    error: Error | null;
    refetch: () => void;
};
/**
 * Suspense variant of useContentItemPopulated
 */
declare function useSuspenseContentItemPopulated<TMap extends Record<string, Record<string, unknown>> = Record<string, Record<string, unknown>>, TSlug extends keyof TMap = keyof TMap>(typeSlug: TSlug & string, id: string): {
    item: ContentItemWithRelations<TMap[TSlug]> | null;
    refetch: () => Promise<unknown>;
};
/**
 * Options for useContentByRelation hook
 */
interface UseContentByRelationOptions {
    /** Number of items per page (default: 20) */
    limit?: number;
    /** Whether to enable the query (default: true) */
    enabled?: boolean;
}
/**
 * Hook for fetching content items that have a specific relation.
 * Useful for "filter by category" functionality.
 *
 * @template TMap - A type map of content type slugs to their data types
 * @template TSlug - The content type slug (inferred from typeSlug parameter)
 *
 * @example
 * ```typescript
 * // Get all resources in a specific category
 * const { items } = useContentByRelation("resource", "categoryIds", categoryId)
 * ```
 */
declare function useContentByRelation<TMap extends Record<string, Record<string, unknown>> = Record<string, Record<string, unknown>>, TSlug extends keyof TMap = keyof TMap>(typeSlug: TSlug & string, fieldName: string, targetId: string, options?: UseContentByRelationOptions): {
    items: SerializedContentItemWithType<TMap[TSlug]>[];
    total: number;
    isLoading: boolean;
    error: Error | null;
    loadMore: () => void;
    hasMore: boolean;
    isLoadingMore: boolean;
    refetch: () => void;
};
/**
 * Suspense variant of useContentByRelation
 */
declare function useSuspenseContentByRelation<TMap extends Record<string, Record<string, unknown>> = Record<string, Record<string, unknown>>, TSlug extends keyof TMap = keyof TMap>(typeSlug: TSlug & string, fieldName: string, targetId: string, options?: UseContentByRelationOptions): {
    items: SerializedContentItemWithType<TMap[TSlug]>[];
    total: number;
    loadMore: () => Promise<unknown>;
    hasMore: boolean;
    isLoadingMore: boolean;
    refetch: () => Promise<unknown>;
};

export { useContent, useContentByRelation, useContentItem, useContentItemBySlug, useContentItemPopulated, useContentType, useContentTypes, useCreateContent, useDeleteContent, useSuspenseContent, useSuspenseContentByRelation, useSuspenseContentItem, useSuspenseContentItemPopulated, useSuspenseContentTypes, useUpdateContent };
export type { ContentItemWithRelations, UseContentByRelationOptions, UseContentOptions, UseContentResult, UseContentTypesResult };
