UNPKG

@enonic/mock-xp

Version:

Mock Enonic XP API JavaScript Library

39 lines (38 loc) 1.47 kB
import type { Application, ByteSource } from '@enonic-types/lib-app'; import { Asset } from './app/Asset'; import { Controller } from './app/Controller'; import { Resource } from './app/Resource'; export declare type Config = Record<string, string | undefined>; export declare interface AppConstructorParams { config?: Config; displayName?: Application['displayName']; key: Application['key']; maxSystemVersion?: Application['maxSystemVersion']; minSystemVersion?: Application['minSystemVersion']; version?: Application['version']; } export declare class App { readonly displayName: Application['displayName']; readonly key: Application['key']; readonly maxSystemVersion: Application['maxSystemVersion']; readonly minSystemVersion: Application['minSystemVersion']; readonly version: Application['version']; readonly vol: import("memfs").Volume; config: Config; constructor({ config, displayName, maxSystemVersion, minSystemVersion, key, version, }: AppConstructorParams); addAsset({ data, path }: { data: ByteSource | string; path: string; }): this; addController({ data, path }: { data: ByteSource | string; path: string; }): this; addResource({ data, path }: { data: ByteSource | string; path: string; }): this; getAsset(path: string): Asset; getController(path: string): Controller; getResource(path: string): Resource; }