@fjell/lib
Version:
Server-side Library for Fjell
20 lines (19 loc) • 1.92 kB
TypeScript
import { AffectedKeys, Coordinate, Operations as CoreOperations, CreateOptions, Item, OperationParams } from "@fjell/types";
import { isComKey, isPriKey } from "@fjell/core";
import { Registry } from "./Registry";
import { ActionMethod, AllActionMethod, AllFacetMethod, FacetMethod, FinderMethod, Options } from "./Options";
/**
* Lib Operations interface extends core Operations.
* Inherits all standard operation methods from @fjell/core.
*/
export interface Operations<V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never> extends CoreOperations<V, S, L1, L2, L3, L4, L5> {
finders: Record<string, FinderMethod<V, S, L1, L2, L3, L4, L5>>;
actions: Record<string, ActionMethod<V, S, L1, L2, L3, L4, L5>>;
facets: Record<string, FacetMethod<V, S, L1, L2, L3, L4, L5>>;
allActions: Record<string, AllActionMethod<V, S, L1, L2, L3, L4, L5>>;
allFacets: Record<string, AllFacetMethod<L1, L2, L3, L4, L5>>;
}
export type { OperationParams, AffectedKeys, CreateOptions };
export { isPriKey, isComKey };
export declare const wrapOperations: <V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(toWrap: Operations<V, S, L1, L2, L3, L4, L5>, options: Options<V, S, L1, L2, L3, L4, L5>, coordinate: Coordinate<S, L1, L2, L3, L4, L5>, registry: Registry) => Operations<V, S, L1, L2, L3, L4, L5>;
export declare const createReadOnlyOperations: <V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(toWrap: Operations<V, S, L1, L2, L3, L4, L5>) => Operations<V, S, L1, L2, L3, L4, L5>;