/** * Options for {@link buildConfig}. * This map specifies what configuration sources are used to * generate a merged client configuration. * * @typedef {Object} ConfigurationLoadOptions * @property {?boolean} loadDefaultFiles * A boolean flag to load the default configuration files. * Defaults to `false`. * @property {?string[]} additionalFiles * An array with paths to additional configuration files. * @property {?boolean} loadEnvironmentVars * A boolean flag to load configuration from environment variables. * Defaults to `false`. * @property {?Object} config * A map with explicit client configuration options. * @see {@link buildConfig} */ /** * Load configuration options from different sources and return a merged configuration map. * The function is asynchronous and returns a promise resolving into the configuration map. * * The configuration is loaded from the following sources and merged in the given order: * * - Default configuration * - Default configuration files * - `.boomack-server[.json|.yaml|.yml]` in the user profile directory * - `.boomack[.json|.yaml|.yml]` in the user profile directory * - `boomack-server[.json|.yaml|.yml]` in the current working directory * - `boomack[.json|.yaml|.yml]` in the current working directory * - Additional configuration files (JSON/YAML) * - Environment Variables starting with `BOOMACK_` * - `BOOMACK_SERVER_URL` * - `BOOMACK_CLIENT_TIMEOUT` * - `BOOMACK_CLIENT_TOKEN` * - ... * - An explizit configuration map * * The default configuration has lowest priority and the explicit configuration map has the highest. * * @param {ConfigurationLoadOptions} options Options for loading the configuration from different sources. * @returns {Promise} A promise resolving into the merged configuration. */ export function buildConfig(options: ConfigurationLoadOptions): Promise; /** * Merge a client configuration from different sources and create a new instance * of {@link Boomack}. * The function is asynchronous and returns a promise resolving into the * API client instance. * * @param {ConfigurationLoadOptions} options Options for loading the configuration from different sources. * @returns {Promise} A new Boomack API client. * @see {@link buildConfig} */ export function withConfig(options: ConfigurationLoadOptions): Promise; /** * Options for {@link getMediaTypeOfUrl}. * * @typedef {Object} HttpHeadRequestOptions * @property {number|null} timeout The timeout for the HEAD request in seconds. Defaults to 10.0 seconds. */ /** * Retrieves the media type for an URL by sending a HEAD request. * The `Content-Type` of the response is returned as media type for the resource. * * @param {string} url An URL to determine the media type for * @param {HttpHeadRequestOptions} options An object with additional options * @returns {Promise} The media type or undefined, if the media type could not be determined. */ export function getMediaTypeOfUrl(url: string, { timeout }: HttpHeadRequestOptions): Promise; /** * An HTTP response object * @typedef {Object} Response * @property {boolean} success A boolean flag, indicating if the request was successful * @property {number} statusCode * @property {?string} statusMessage * @property {unknown} body The data type and format of the body depends on the media type of the response. * If the `format` property of the {@link BoomackClientOptions} is set to `application/json`, * the `body` property contains the parsed JSON object. */ /** * The server address in the API client configuration. * * @typedef {Object} BoomackServerAddress * @property {?string} [host] The hostname or IP address of the Boomack server. Default is `localhost`. * @property {?number} [port] The port of the Boomack server. Default is 3000. * @property {?string} [url] A HTTP(S) URL of the Boomack server. Overrules the properties {@link host} and {@link port}. Defaults to `null`. * @see {@link ApiClientConfiguration} */ /** * Configuration options for the client. * * @typedef {Object} BoomackClientOptions * @property {?string} [format] The accepted response format as a MIME type. * Currently supported are: `application/json`, `text/plain`, and `text/html`. * Default is `application/json`. * @property {?number} [timeout] A timeout for the HTTP requests in seconds. Default is 10.0 seconds. * @property {?number} [retry] The number of retries in case of a failed requests. * @property {?string} [token] The API authentication token. * @property {?Object} [types] A map associating filename patterns with media types. * This property is not used by this library, but can be used * by clients depending on this library to allow customized * mapping between filenames and extensions with media types. * @see {@link ApiClientConfiguration} */ /** * The API client configuration map — * Is used with the constructor of the {@link Boomack} class. * * @typedef {Object} ApiClientConfiguration * @property {?BoomackServerAddress} [server] The address of the Boomack server. * @property {?BoomackClientOptions} [client] The client options. * @see {@link buildConfig}, {@link Boomack} */ /** * Display options control how a display request is processed by the Boomack server. * * See {@link https://boomack.com/docs/concepts.html#display-option} for more details. * * This specification is open — meaning the text transformation * and renderer can add their own supported properties to this structure. * * @typedef {Object} DisplayOptions * @property {?string} [transformation] The ID of a text transformation * @property {?string} [renderer] The ID of a renderer * @property {?string} [cache] The preferred way to store the media content on the server. * Supported values are: `auto`, `embed`, `memory`, and `file`. Defaults to `auto`. * @property {?string} [extend] A value to indicate if existing content must be extended or replaced. * Supported values are: `no`, `begin`, and `end`. Defaults to `no`. * @property {?boolean} [iframe] A boolean flag to indicate that the media item * Must be shown in an isolating IFRAME. * @property {?string} [background] A CSS value for the background style property of the target slot * @property {?number} [zoom] A scale factor for a CSS transformation in the target slot. Defaults to 1.0. * @property {?string[]} [requires] An array of client resource group IDs */ /** * A display request contains a media item and metadata, instructing the the Boomack server * how to process and display the content. * * Only one of the properties `text`, `data`, and `src` is allowed. * * See {@link https://boomack.com/docs/concepts.html#display-request} for more details. * * @typedef {Object} DisplayRequest * @property {?string} [panel] The ID of the target panel. Defaults to `default`. * @property {?string} [slot] The ID of the target slot * @property {?string} [type] The media type of the content * @property {?string} [title] A title to be displayed in the toolbar of the slot * @property {?string} [text] Text content of the media item * @property {?string} [data] BASE64 encoded binary data as content of the media item * @property {?string} [src] An URL where the content of the media item can be loaded from * @property {?string[]} [presets] An array with preset IDs to apply * @property {?DisplayOptions} [options] Display options to apply */ /** * @typedef {Object} SequenceStep * @property {'update-panel'|'delete-panel'|'display'|'clear-panel'|'clear-slot'} type The step type */ /** * The definition of a media type. * * @typedef {Object} MediaTypeDefinition * @property {boolean} text A flag to indicate, that content with this media type can be handled as text * @property {?string[]} [presets] An array with preset IDs to apply for this media type * @property {?Object} [options] A map with display options to apply for this media type * @see {@link Boomack#addMediaType}, {@link Boomack#getMediaType}, and {@link Boomack#updateMediaType} */ /** * The definition of an action. * * This specification is open — meaning every action type * can add its own supported properties to this structure. * * See {@link https://boomack.com/docs/concepts.html#action-type} for more details. * * @typedef {Object} ActionDefinition * @property {string} type The ID of an action type */ /** * @typedef {Object} EvaluationRequest * @property {?string} [panelId] The ID of the target panel. Defaults to `default`. * @property {string} script The JavaScript code to evaluate */ /** * @typedef {Object} DefaultTarget * @property {?string} [panel] A Panel ID * @property {?string} [slot] A Slot ID */ /** * The values in `presets`, `types`, `actions`, `panels` and `requests`, * can bei either the appropriate object, * or a filesystem path to a JSON or YAML file with the appropriate object. * A filesystem path at this point might be relative. * * @typedef {Object} Playbook * @property {Object.} [presets] A map with presets for Display Options * @property {Object.} [types] A map with Media Type Definitions * @property {Object.} [actions] A map with Action Definitions * @property {Object.} [panels] A map with Panel Layouts * @property {DefaultTarget} [defaultTarget] Defaults for target Panel and target Slot * @property {Array.} [requests] An array with Display Requests * @property {Array.} [steps] An array with Sequence Steps */ /** * The Boomack class represents a Boomack API client. * * You can use the constructor of the class with an {@link ApiClientConfiguration}, * or the factory function {@link withConfig} to create an instance. * * ### Display * * - [displayMediaItems]{@link Boomack#displayMediaItems} * - [streamMediaItemToPanel]{@link Boomack#streamMediaItemToPanel} * - [streamMediaItemToSlot]{@link Boomack#streamMediaItemToSlot} * - [clearPanel]{@link Boomack#clearPanel} * - [clearSlot]{@link Boomack#clearSlot} * * ### Setup * * - [listPanels]{@link Boomack#listPanels} * - [getPanel]{@link Boomack#getPanel} * - [addPanel]{@link Boomack#addPanel} * - [updatePanel]{@link Boomack#updatePanel} * - [switchLayout]{@link Boomack#switchLayout} * - [deletePanel]{@link Boomack#deletePanel} * * ### Presets * * - [listPresets]{@link Boomack#listPresets} * - [getPreset]{@link Boomack#getPreset} * - [addPreset]{@link Boomack#addPreset} * - [updatePreset]{@link Boomack#updatePreset} * - [deletePreset]{@link Boomack#deletePreset} * * ### Media Types * * - [listMediaTypes]{@link Boomack#listMediaTypes} * - [getMediaType]{@link Boomack#getMediaType} * - [addMediaType]{@link Boomack#addMediaType} * - [updateMediaType]{@link Boomack#updateMediaType} * - [deleteMediaType]{@link Boomack#deleteMediaType} * * ### Actions * * - [listActions]{@link Boomack#listActions} * - [getAction]{@link Boomack#getAction} * - [addAction]{@link Boomack#addAction} * - [updateAction]{@link Boomack#updateAction} * - [deleteAction]{@link Boomack#deleteAction} * * ### Evaluate * * - [evaluateCode]{@link Boomack#evaluateCode} * - [streamCodeForEvaluation]{@link Boomack#streamCodeForEvaluation} * * ### Export * * - [exportPanels]{@link Boomack#exportPanels} * - [exportPanel]{@link Boomack#exportPanel} * - [exportSlot]{@link Boomack#exportSlot} * * ### Playbook * * - [executePlaybook]{@link Boomack#executePlaybook} * */ export class Boomack { /** * Creates a new Boomack API client with the given configuration. * @param {ApiClientConfiguration} config An API client configuration map. */ constructor(config: ApiClientConfiguration); config: ApiClientConfiguration; apiUrl: any; accepts: any; timeout: any; retry: any; token: any; /** * Registers an async function to transform the request options. * The function is called with the request options every time a request is executed. * As a return value a promise is expected. * The resolved value of the promise is then used as the actual request options. * * @param {function(Object): Promise} interceptor An interceptor function. */ setInterceptor(interceptor: (arg0: any) => Promise): void; interceptor: (arg0: any) => Promise; /** * @returns {Promise} */ _request(route: any, options: any): Promise; _getRequest(route: any): Promise; _postRequest(route: any): Promise; _postJsonRequest(route: any, body: any): Promise; _putJsonRequest(route: any, body: any): Promise; _postStreamRequest(route: any, stream: any, headers: any): Promise; _deleteRequest(route: any): Promise; /** * Get the IDs of all panels. * @returns {Promise} */ listPanels(): Promise; /** * Export all panels as HTML files to the filesystem of the server. * @param {{Object}} exportRequest The export options. * @returns {Promise} */ exportPanels(exportRequest: { Object: any; }): Promise; /** * Get the layout of the specified panel. * @param {string} panelId The ID of the panel * @returns {Promise} */ getPanel(panelId: string): Promise; /** * Set the layout for a new panel. * @param {string} panelId The ID of the panel * @param {Object} layoutRequest The layout for the new panel * @returns {Promise} * @see {@link Boomack#updatePanel} */ addPanel(panelId: string, layoutRequest: any): Promise; /** * Alias for {@link updateLayout}. * @param {string} panelId The ID of the panel. * @param {Object} layoutRequest The layout for the panel. * @returns {Promise} */ switchLayout(panelId: string, layoutRequest: any): Promise; /** * Set the layout of the specified panel. * The supported properties in {@link layoutRequest} depend on the Boomack server. * See {@link https://boomack.com/docs/api.html#panel-layout-structure} for more details. * * @param {string} panelId The ID of the target panel. * @param {Object} layoutRequest The layout for the panel. * @returns {Promise} */ updatePanel(panelId: string, layoutRequest: any): Promise; /** * Remove all content from all slots in the panel. * @param {string} panelId The ID of the target panel. * @returns {Promise} */ clearPanel(panelId: string): Promise; /** * Remove all content the specified slot. * @param {string} panelId The ID of the target panel. * @param {string} slotId The ID of the target slot. * @returns {Promise} */ clearSlot(panelId: string, slotId: string): Promise; /** * Remove a panel form the Boomack server. * @param {string} panelId The ID of the target panel. * @returns {Promise} */ deletePanel(panelId: string): Promise; /** * Export a panel as HTML file to the filesystem of the Boomack server. * @param {string} panelId The ID of the target panel. * @param {Object} exportRequest Options for the export of the panel. * @returns {Promise} */ exportPanel(panelId: string, exportRequest: any): Promise; /** * Export a slot as HTML file to the filesystem of the Boomack server. * @param {string} panelId The ID of the target panel. * @param {string} slotId The ID of the target slot. * @param {Object} exportRequest Options for the export of the slot. * @returns {Promise} */ exportSlot(panelId: string, slotId: string, exportRequest: any): Promise; /** * Get the IDs of all presets. * @returns {Promise} */ listPresets(): Promise; /** * Create a new preset with the given display options. * @param {string} presetId The ID of the new preset * @param {Object} options The display options to store as a new preset * @returns {Promise} */ addPreset(presetId: string, options: any): Promise; /** * Get the display options of the specified preset. * @param {string} presetId The ID of the preset * @returns {Promise} */ getPreset(presetId: string): Promise; /** * Update the display options of the specified preset. * @param {string} presetId The ID of the target preset * @param {Object} options The new display options for the preset * @returns {Promise} */ updatePreset(presetId: string, options: any): Promise; /** * Remove the preset from the server. * @param {string} presetId The ID of the preset * @returns {Promise} */ deletePreset(presetId: string): Promise; /** * Get the IDs of all media types. * @returns {Promise} */ listMediaTypes(): Promise; /** * Create a new media type. * * @param {string} mimeType The ID of the media type * @param {MediaTypeDefinition} typeConfig The media type definition * @returns {Promise} */ addMediaType(mimeType: string, typeConfig: MediaTypeDefinition): Promise; /** * Get the definition of a media type. * @param {string} mimeType The ID of the media type * @returns {Promise} * @see {@link MediaTypeDefinition} */ getMediaType(mimeType: string): Promise; /** * Update the definition of a media type. * @param {string} mimeType The ID of the media type * @param {MediaTypeDefinition} typeConfig The new definition of the media type * @returns {Promise} */ updateMediaType(mimeType: string, typeConfig: MediaTypeDefinition): Promise; /** * Remove a media type from the server. * @param {string} mimeType The ID of the media type * @returns {Promise} */ deleteMediaType(mimeType: string): Promise; /** * Get the IDs of all actions. * @returns {Promise} */ listActions(): Promise; /** * Get the definition of an action. * @param {string} actionId The ID of the action * @returns {Promise} * @see {@link ActionDefinition} */ getAction(actionId: string): Promise; /** * Create a new action. * @param {string} actionId The ID of the new action * @param {ActionDefinition} actionRequest The definition of the action * @returns {Promise} */ addAction(actionId: string, actionRequest: ActionDefinition): Promise; /** * Update the definition of an action. * @param {string} actionId The ID of the target action * @param {ActionDefinition} actionRequest The new definition for the action * @returns {Promise} */ updateAction(actionId: string, actionRequest: ActionDefinition): Promise; /** * Remove an action from the Boomack server. * @param {string} actionId The ID of the action * @returns {Promise} */ deleteAction(actionId: string): Promise; /** * Display one or more JSON encoded media items. * * See {@link https://boomack.com/docs/api.html#display-request} for more details. * * @param {DisplayRequest|DisplayRequest[]} displayRequest One or more display requests * @returns {Promise} */ displayMediaItems(displayRequest: DisplayRequest | DisplayRequest[]): Promise; boom(displayRequest: any): Promise; _streamMediaItem(route: any, type: any, stream: any, streamLength: any, title: any, presets: any, options: any): Promise; /** * Streams content as display request to the default slot of the specified panel on the Boomack server. * * See {@link https://boomack.com/docs/api.html#stream-display-request} for more details. * * @param {string} panelId The ID of the target panel * @param {string} type The media type of the content * @param {Stream} stream The stream with the content to display * @param {?number} streamLength The number of bytes in the stream. * Optional, but required if the content should be automatically cached in memory. * If the stream length is not set, the Boomack server always caches on disk. * @param {?string} title A title for the content * @param {?string[]} presets An array with preset IDs to apply * @param {?DisplayOptions} options A map with display options * @returns {Promise} */ streamMediaItemToPanel(panelId: string, type: string, stream: Stream, streamLength: number | null, title: string | null, presets: string[] | null, options: DisplayOptions | null): Promise; /** * Streams content as display request to the specified slot of the specified panel on the Boomack server. * * See {@link https://boomack.com/docs/api.html#stream-display-request} for more details. * * @param {string} panelId The ID of the target panel * @param {string} slotId The ID of the target slot * @param {string} type The media type of the content * @param {Stream} stream The stream with the content to display * @param {?number} streamLength The number of bytes in the stream. * Optional, but required if the content should be automatically cached in memory. * If the stream length is not set, the Boomack server always caches on disk. * @param {?string} title A title for the content * @param {?string[]} presets An array with preset IDs to apply * @param {?DisplayOptions} options A map with display options * @returns {Promise} */ streamMediaItemToSlot(panelId: string, slotId: string, type: string, stream: Stream, streamLength: number | null, title: string | null, presets: string[] | null, options: DisplayOptions | null): Promise; /** * @typedef {Object} PlaybookProgress * @property {?string} taskType A class for the current task (`"preset"`, `"type"`, `"action"`, `"panel"`, `"request"`, `"step"`) * @property {?string} taskId An identifier for the current task * @property {string} [error] An error message * @property {number} [progress] The current task * @property {number} [total] The total number of tasks */ /** * @typedef {Object} PlaybookStepFilter * @property {string|Array.} [label] One or multiple step labels * @property {Array.} [include] An array with tags to include * @property {Array.} [exclude] An array with tags to exclude */ /** * @typedef {Object} PlaybookExecutionOptions * @property {boolean} [cancelOnError] Cancel executing the playbook at the first occurring error * @property {?string} [basePath] Base path for resolving relative filesystem paths in the playbook * @property {boolean} [allowFileSrc] If set to false, streams local file data to the server instead of transmitting the local file path * @property {?string} [defaultPanel] Fallback if neither a display request, nor the playbook defines a target panel * @property {?string} [defaultSlot] Fallback if neither a display request, nor the playbook defines a target slot (seldomly used) * @property {boolean} [stepsOnly] A switch to limit the execution to sequence steps * @property {PlaybookStepFilter} [stepFilter] An optional filter for executing playbook steps * @property {function(Object):Promise} [requestHandler] A callback function giving the opportunity to transform every Display Request before sending it. The callback is expected to return a Promise. * @property {function(PlaybookProgress):void} [progressHandler] A callback function to track progress and errors. The function is called with a {@link PlaybookProgress} as argument. */ /** * Execute a playbook. * * @param {Playbook} playbook The Playbook * @param {PlaybookExecutionOptions} options Execution options */ executePlaybook(playbook: Playbook, { cancelOnError, basePath, allowFileSrc, defaultPanel, defaultSlot, stepsOnly, stepFilter, requestHandler, progressHandler, }?: { /** * Cancel executing the playbook at the first occurring error */ cancelOnError?: boolean; /** * Base path for resolving relative filesystem paths in the playbook */ basePath?: string | null; /** * If set to false, streams local file data to the server instead of transmitting the local file path */ allowFileSrc?: boolean; /** * Fallback if neither a display request, nor the playbook defines a target panel */ defaultPanel?: string | null; /** * Fallback if neither a display request, nor the playbook defines a target slot (seldomly used) */ defaultSlot?: string | null; /** * A switch to limit the execution to sequence steps */ stepsOnly?: boolean; /** * An optional filter for executing playbook steps */ stepFilter?: { /** * One or multiple step labels */ label?: string | Array; /** * An array with tags to include */ include?: Array; /** * An array with tags to exclude */ exclude?: Array; }; /** * A callback function giving the opportunity to transform every Display Request before sending it. The callback is expected to return a Promise. */ requestHandler?: (arg0: any) => Promise; /** * A callback function to track progress and errors. The function is called with a {@link PlaybookProgress} as argument. */ progressHandler?: (arg0: { /** * A class for the current task (`"preset"`, `"type"`, `"action"`, `"panel"`, `"request"`, `"step"`) */ taskType: string | null; /** * An identifier for the current task */ taskId: string | null; /** * An error message */ error?: string; /** * The current task */ progress?: number; /** * The total number of tasks */ total?: number; }) => void; }): Promise; /** * Evaluate the given JavaScript code in all browser windows, showing the specified panel. * * See {@link https://boomack.com/docs/api.html#evaluation-request} for more details. * * @param {EvaluationRequest|EvaluationRequest[]} evalRequests One or more evaluation requests * @returns {Promise} */ evaluateCode(evalRequests: EvaluationRequest | EvaluationRequest[]): Promise; /** * Stream the given JavaScript code to the server for evaluation in all browser windows, showing the specified panel. * * See {@link https://boomack.com/docs/api.html#evaluation-request} for more details. * * @param {string} panelId The ID of the target panel * @param {Stream} stream The stream with the JavaScript code (UTF-8 encoded) * @param {?number} streamLength The number of bytes in the stream * @returns {Promise} */ streamCodeForEvaluation(panelId: string, stream: Stream, streamLength: number | null): Promise; } declare namespace _default { export { Boomack }; export { buildConfig }; export { withConfig }; export { getMediaTypeOfUrl }; } export default _default; /** * Options for {@link buildConfig}. * This map specifies what configuration sources are used to * generate a merged client configuration. */ export type ConfigurationLoadOptions = { /** * A boolean flag to load the default configuration files. * Defaults to `false`. */ loadDefaultFiles: boolean | null; /** * An array with paths to additional configuration files. */ additionalFiles: string[] | null; /** * A boolean flag to load configuration from environment variables. * Defaults to `false`. */ loadEnvironmentVars: boolean | null; /** * A map with explicit client configuration options. */ config: any | null; }; /** * Options for {@link getMediaTypeOfUrl}. */ export type HttpHeadRequestOptions = { /** * The timeout for the HEAD request in seconds. Defaults to 10.0 seconds. */ timeout: number | null; }; /** * An HTTP response object */ export type Response = { /** * A boolean flag, indicating if the request was successful */ success: boolean; statusCode: number; statusMessage: string | null; /** * The data type and format of the body depends on the media type of the response. * If the `format` property of the {@link BoomackClientOptions} is set to `application/json`, * the `body` property contains the parsed JSON object. */ body: unknown; }; /** * The server address in the API client configuration. */ export type BoomackServerAddress = { /** * The hostname or IP address of the Boomack server. Default is `localhost`. */ host?: string | null; /** * The port of the Boomack server. Default is 3000. */ port?: number | null; /** * A HTTP(S) URL of the Boomack server. Overrules the properties {@link host} and {@link port}. Defaults to `null`. */ url?: string | null; }; /** * Configuration options for the client. */ export type BoomackClientOptions = { /** * The accepted response format as a MIME type. * Currently supported are: `application/json`, `text/plain`, and `text/html`. * Default is `application/json`. */ format?: string | null; /** * A timeout for the HTTP requests in seconds. Default is 10.0 seconds. */ timeout?: number | null; /** * The number of retries in case of a failed requests. */ retry?: number | null; /** * The API authentication token. */ token?: string | null; /** * A map associating filename patterns with media types. * This property is not used by this library, but can be used * by clients depending on this library to allow customized * mapping between filenames and extensions with media types. */ types?: any | null; }; /** * The API client configuration map — * Is used with the constructor of the {@link Boomack} class. */ export type ApiClientConfiguration = { /** * The address of the Boomack server. */ server?: BoomackServerAddress | null; /** * The client options. */ client?: BoomackClientOptions | null; }; /** * Display options control how a display request is processed by the Boomack server. * * See {@link https://boomack.com/docs/concepts.html#display-option} for more details. * * This specification is open — meaning the text transformation * and renderer can add their own supported properties to this structure. */ export type DisplayOptions = { /** * The ID of a text transformation */ transformation?: string | null; /** * The ID of a renderer */ renderer?: string | null; /** * The preferred way to store the media content on the server. * Supported values are: `auto`, `embed`, `memory`, and `file`. Defaults to `auto`. */ cache?: string | null; /** * A value to indicate if existing content must be extended or replaced. * Supported values are: `no`, `begin`, and `end`. Defaults to `no`. */ extend?: string | null; /** * A boolean flag to indicate that the media item * Must be shown in an isolating IFRAME. */ iframe?: boolean | null; /** * A CSS value for the background style property of the target slot */ background?: string | null; /** * A scale factor for a CSS transformation in the target slot. Defaults to 1.0. */ zoom?: number | null; /** * An array of client resource group IDs */ requires?: string[] | null; }; /** * A display request contains a media item and metadata, instructing the the Boomack server * how to process and display the content. * * Only one of the properties `text`, `data`, and `src` is allowed. * * See {@link https://boomack.com/docs/concepts.html#display-request} for more details. */ export type DisplayRequest = { /** * The ID of the target panel. Defaults to `default`. */ panel?: string | null; /** * The ID of the target slot */ slot?: string | null; /** * The media type of the content */ type?: string | null; /** * A title to be displayed in the toolbar of the slot */ title?: string | null; /** * Text content of the media item */ text?: string | null; /** * BASE64 encoded binary data as content of the media item */ data?: string | null; /** * An URL where the content of the media item can be loaded from */ src?: string | null; /** * An array with preset IDs to apply */ presets?: string[] | null; /** * Display options to apply */ options?: DisplayOptions | null; }; export type SequenceStep = { /** * The step type */ type: "update-panel" | "delete-panel" | "display" | "clear-panel" | "clear-slot"; }; /** * The definition of a media type. */ export type MediaTypeDefinition = { /** * A flag to indicate, that content with this media type can be handled as text */ text: boolean; /** * An array with preset IDs to apply for this media type */ presets?: string[] | null; /** * A map with display options to apply for this media type */ options?: any | null; }; /** * The definition of an action. * * This specification is open — meaning every action type * can add its own supported properties to this structure. * * See {@link https://boomack.com/docs/concepts.html#action-type} for more details. */ export type ActionDefinition = { /** * The ID of an action type */ type: string; }; export type EvaluationRequest = { /** * The ID of the target panel. Defaults to `default`. */ panelId?: string | null; /** * The JavaScript code to evaluate */ script: string; }; export type DefaultTarget = { /** * A Panel ID */ panel?: string | null; /** * A Slot ID */ slot?: string | null; }; /** * The values in `presets`, `types`, `actions`, `panels` and `requests`, * can bei either the appropriate object, * or a filesystem path to a JSON or YAML file with the appropriate object. * A filesystem path at this point might be relative. */ export type Playbook = { /** * A map with presets for Display Options */ presets?: { [x: string]: string | DisplayOptions; }; /** * A map with Media Type Definitions */ types?: { [x: string]: string | MediaTypeDefinition; }; /** * A map with Action Definitions */ actions?: { [x: string]: string | ActionDefinition; }; /** * A map with Panel Layouts */ panels?: { [x: string]: any; }; /** * Defaults for target Panel and target Slot */ defaultTarget?: DefaultTarget; /** * An array with Display Requests */ requests?: Array; /** * An array with Sequence Steps */ steps?: Array; }; import { Stream } from 'node:stream';