@enonic/mock-xp
Version:
Mock Enonic XP API JavaScript Library
24 lines (23 loc) • 1.75 kB
TypeScript
import type { AggregationsToAggregationResults } from '@enonic-types/core';
import type { Aggregations, ByteSource, Content, ContentExistsParams, ContentsResult, CreateContentParams, CreateMediaParams, DeleteContentParams, GetAttachmentStreamParams, GetContentParams, ModifyContentParams, MoveContentParams, PublishContentParams, PublishContentResult, QueryContentParams } from '@enonic-types/lib-content';
import type { Server } from '../implementation/Server';
export declare class LibContent {
readonly server: Server;
constructor({ server }: {
server: Server;
});
private _connect;
create<Data = Record<string, unknown>, Type extends string = string>(params: CreateContentParams<Data, Type>): Content<Data, Type>;
createMedia<Data = Record<string, unknown>, Type extends string = string>(params: CreateMediaParams): Content<Data, Type>;
delete(params: DeleteContentParams): boolean;
exists(params: ContentExistsParams): boolean;
get<Hit extends Content<unknown> = Content>(params: GetContentParams): Hit | null;
getAttachmentStream(params: GetAttachmentStreamParams): ByteSource | null;
modify<Data = Record<string, unknown>, Type extends string = string>(params: ModifyContentParams<Data, Type>): Content<Data, Type> | null;
move<Data = Record<string, unknown>, Type extends string = string>(params: MoveContentParams): Content<Data, Type>;
publish(params: PublishContentParams): PublishContentResult;
query<Hit extends Content<unknown> = Content, AggregationInput extends Aggregations = never>(params: QueryContentParams<AggregationInput> & {
_debug?: boolean;
_trace?: boolean;
}): ContentsResult<Hit, AggregationsToAggregationResults<AggregationInput>>;
}