/**
* Payload CMS Data Provider Implementation
*
* Integrates Payload CMS with QwickApps React Framework data binding system.
* Fetches content from Payload REST API and transforms it to match framework schemas.
*
* Copyright (c) 2025 QwickApps.com. All rights reserved.
*/
import { Model } from '@qwickapps/schema';
import { DataResponse, IDataProvider, SelectOptions } from '@qwickapps/schema';
/**
* Configuration for Payload Data Provider
*/
export interface PayloadDataProviderConfig {
/** Base URL for Payload API (e.g., "http://localhost:3000/api") */
apiUrl?: string;
/** Enable debug logging */
debug?: boolean;
}
/**
* Payload CMS-based data provider for QwickApps Framework
*
* Fetches data from Payload REST API and provides it to framework components
* via the standard IDataProvider interface.
*
* Usage:
* ```tsx
* const payloadProvider = new PayloadDataProvider({
* apiUrl: 'http://localhost:3000/api'
* });
*
*
*
*
* ```
*/
export declare class PayloadDataProvider implements IDataProvider {
private apiUrl;
private debug;
constructor(config?: PayloadDataProviderConfig);
/**
* Get single data item by slug
*
* For Payload, slug can be:
* - Collection name (e.g., "hero-blocks") - returns first item
* - Collection with ID (e.g., "hero-blocks/1") - returns specific item
* - Nested path (e.g., "pages.home.hero") - navigates nested structure
*/
get(slug: string): Promise>;
/**
* Select multiple data items with query options
*
* Maps framework SelectOptions to Payload API query parameters
*/
select(schema: string, options?: SelectOptions): Promise>;
/**
* Parse slug into collection, ID, and nested path
*/
private parseSlug;
/**
* Navigate nested path in object
*/
private navigatePath;
/**
* Transform Payload data to match framework expectations
*
* Payload returns data with metadata (id, createdAt, updatedAt, etc.)
* This method can transform it to match framework component props
*/
private transformPayloadData;
}
//# sourceMappingURL=PayloadDataProvider.d.ts.map