import { RequestQuery, RequestParameters } from './api'; export interface PolymorphicRelationship { polymorphic: true; } export interface ResourceConfig { type: string; attributes: (keyof T)[]; relationships: Record; } export interface CommonResourceAttributes { id: string; reference: string; reference_origin: string; metadata: Record; created_at: string; updated_at: string; type: string; } export interface CommonPayloadAttributes { reference?: string; reference_origin?: string; metadata?: Record; } export declare type AttributesPayload = { [K in keyof T]?: T[K]; } & CommonPayloadAttributes; export declare type RelationshipsPayload = { [K in keyof T]?: T[K] | string; }; export declare type RelatedResourceInstance = CommonResourceAttributes; export declare type ConcreteResourceInstance = CommonResourceAttributes & T & U; export interface ResourcePagination { items: T[]; total: number; currentPage: number; prevPage: number | null; nextPage: number | null; lastPage: number | null; hasMore: boolean; } export interface ResourceWriteParams { attributes?: AttributesPayload; relationships?: RelationshipsPayload; query?: RequestParameters; } export interface Resource> { find: (id: string, query?: RequestQuery) => Promise; findBy: (query: RequestQuery) => Promise; findAll: (query: RequestQuery) => Promise>; create: (params?: ResourceWriteParams) => Promise; update: (id: string, params: ResourceWriteParams) => Promise; delete: (id: string) => Promise; } export declare const commonResourceFields: (keyof CommonResourceAttributes)[]; export declare const createResource: (config: ResourceConfig) => Resource>; //# sourceMappingURL=resource.d.ts.map