import { AnyColumn } from "drizzle-orm";
import { SelectQuery } from "@db/types/db-types";
import { WithId } from "../../../../fd-toolbox-core/types/resource-with-id";
import { ODataConfig } from "../../../../fd-toolbox/odata/odataconfig";
import { GetResourceConfig } from "../services/get-resource-config";
/**
 * Gets resources from database by resourceName.
 *
 * @template T - type of the resource
 *
 * @param resourceName - name of the resource
 *
 * @returns array of T resources
 */
export declare function getResourcesByName<T>(resourceName: string): Promise<any>;
/**
 * Gets a resource by its id and resourceName from database.
 *
 * @template T - type of the resource
 *
 * @param {@link GetResourceConfig} - config for getting the resource
 */
export declare function getResource<T extends WithId>(getResourceConfig: GetResourceConfig): Promise<T>;
/**
 * @param throwIfNotFound - true
 */
export declare function getResource<T extends WithId>(getResourceConfig: GetResourceConfig, throwIfNotFound: true): Promise<T>;
/**
 * @param throwIfNotFound - (optional) whether to throw error when resource is not found. Default value - true
 *
 * @throws error if throwIfNotFound is true and resource is not found
 */
export declare function getResource<T extends WithId>(getResourceConfig: GetResourceConfig, throwIfNotFound: boolean): Promise<T | undefined>;
/**
 * Retrieves a list of resources from the specified table using OData query configuration.
 *
 * @template T - The type of resource returned, extending {@link WithId}.
 *
 * @param resourceName - The name of the resource to query.
 * @param oDataConfig - Configuration object defining how resources should be queried.
 *
 * @returns A promise resolving to an array of resources matching the OData query.
 *
 */
export declare function getResourcesWithOData<T extends WithId>(resourceName: string, oDataConfig: ODataConfig): Promise<T[]>;
/** @monorepo-internal */
export declare function getResourcesByFieldId<T extends WithId>(resourceName: string, propertyName: string, resourceId: string): Promise<T[]>;
/** @monorepo-internal */
export declare function findResourceById<T extends WithId>(resourceName: string, resourceMetaId: string): Promise<any>;
/** @monorepo-internal */
export declare function hasAnyResource(name: string): Promise<boolean>;
/** @monorepo-internal */
export declare function getResourcesByField<T>(tableName: string, fieldName: AnyColumn, fieldValue: string): Promise<T[]>;
/** @internal */
export declare function createResourceDirectlyInDb<T extends WithId>(resource: T, resourceName: string, throwOnConflict?: boolean): Promise<T>;
/**
 * Updates resource in Database by its resource name.
 *
 * @template T - type of resource
 *
 * @param resource - updated resource
 * @param resourceName - name of updated resource
 */
export declare function updateResource<T extends WithId>(resource: T, resourceName: string): Promise<T>;
/** @internal */
export declare function deleteResource(resourceId: string, resourceName: string): Promise<unknown>;
/** @monorepo-internal */
export declare function deleteResources(resourcesName: string, resourceIds: string[]): Promise<any>;
export declare function getTable(resourceName: string): Promise<TableWithId>;
/** @monorepo-internal */
export declare function execQuery<T>(query: SelectQuery): Promise<T>;
