tsonik
Version:
A TypeScript client library for the Iconik API based on Swagger documentation
35 lines • 1.08 kB
TypeScript
import { Tsonik } from '../client';
import { ApiResponse, PaginatedResponse } from '../types';
/**
* Base class for all Iconik API resources
*/
export declare abstract class BaseResource {
protected client: Tsonik;
protected basePath: string;
constructor(client: Tsonik, basePath: string);
/**
* Get a single resource by ID
*/
get<T = unknown>(id: string): Promise<ApiResponse<T>>;
/**
* List resources with optional query parameters
*/
list<T = unknown>(params?: unknown): Promise<ApiResponse<PaginatedResponse<T>>>;
/**
* Create a new resource
*/
create<T = unknown>(data: unknown): Promise<ApiResponse<T>>;
/**
* Update a resource by ID
*/
update<T = unknown>(id: string, data: unknown): Promise<ApiResponse<T>>;
/**
* Partially update a resource by ID
*/
patch<T = unknown>(id: string, data: unknown): Promise<ApiResponse<T>>;
/**
* Delete a resource by ID
*/
delete<T = void>(id: string): Promise<ApiResponse<T>>;
}
//# sourceMappingURL=base.d.ts.map