UNPKG

@enonic/mock-xp

Version:

Mock Enonic XP API JavaScript Library

34 lines (33 loc) 1.26 kB
import type { DefaultRequest, RequestGetHeaderFunction } from "@enonic-types/core"; export declare type Params = Record<string, string | string[]>; export declare class Request implements DefaultRequest { readonly scheme: string; readonly host: string; readonly port: number; readonly path: string; readonly url: string; readonly branch: 'draft' | 'master'; readonly method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'PATCH'; readonly mode: 'edit' | 'inline' | 'live' | 'preview'; readonly body?: string; readonly contextPath?: string; readonly contentType?: string; readonly cookies: Record<string, string>; readonly followRedirects?: boolean; readonly headers: Record<string, string>; readonly params: Params; readonly pathParams?: Record<string, string>; readonly rawPath: string; readonly repositoryId?: string; readonly remoteAddress: string; readonly webSocket: boolean; static queryToParams(query: string): Params; constructor(constructorParams?: Partial<Request>); contentPath({ _trace, }?: { _trace?: boolean; }): string; query(): string; project(): string; serialize(): string; getHeader: RequestGetHeaderFunction; }