UNPKG

@enonic/mock-xp

Version:

Mock Enonic XP API JavaScript Library

27 lines (26 loc) 1.99 kB
import type { ByteSource, CreateNodeParams, DuplicateParams, FindChildrenParams, FindNodesByParentResult, GetBinaryParams, ModifyNodeParams, MoveNodeParams, Node, NodeVersion, PushNodeParams, PushNodesResult, RefreshMode, SetChildOrderParams, SetRootPermissionsParams } from '@enonic-types/lib-node'; import type { GetActiveVersionParamObject, Log, NodeQueryParams, NodeQueryResponse, RepoConnection as RepoConnectionInterface, RepoNodeWithData } from '../types'; import type { Branch } from './Branch'; export declare class RepoConnection implements RepoConnectionInterface { private branch; readonly log: Log; constructor({ branch, }: { branch: Branch; }); create<NodeData = unknown>(param: CreateNodeParams<NodeData>): Node<NodeData>; delete(keys: string | string[]): string[]; duplicate<NodeData = Record<string, unknown>>({ nodeId, name, parent, dataProcessor, refresh }: DuplicateParams<NodeData>): Node<NodeData>; exists(key: string): boolean; findChildren({ count, parentKey, start, }: FindChildrenParams): FindNodesByParentResult; get(...keys: string[]): RepoNodeWithData | RepoNodeWithData[]; getActiveVersion({ key }: GetActiveVersionParamObject): NodeVersion | null; _getSingle<T = Node>(key: string): T; getBinary({ binaryReference, key, }: GetBinaryParams): ByteSource; modify<NodeData = Record<string, unknown>>({ key, editor }: ModifyNodeParams<NodeData>): Node<NodeData>; move({ source, target }: MoveNodeParams): boolean; push({ key, keys, target, }: PushNodeParams): PushNodesResult; query({ aggregations, count, explain, filters, highlight, query, sort, start }: NodeQueryParams): NodeQueryResponse; refresh(mode?: RefreshMode): void; setChildOrder<NodeData = Record<string, unknown>>({ childOrder, key, }: SetChildOrderParams): Node<NodeData>; setRootPermission<NodeData = Record<string, unknown>>({ _permissions, _inheritsPermissions, }: SetRootPermissionsParams): Node<NodeData>; }