import { UVE_MODE, DotCMSClientConfig, DotHttpClient, DotCMSBasicContentlet, BlockEditorNode, BlockEditorMark, DotCMSPageAsset, DotCMSPageRendererMode, DotPageAssetLayoutRow, DotCMSExtendedPageResponse, DotCMSComposedPageResponse } from '@dotcms/types';
import * as i0 from '@angular/core';
import { Provider, EnvironmentProviders, OnInit, OnChanges, Type } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { createDotCMSClient } from '@dotcms/client';
import { EditorComponent } from '@tinymce/tinymce-angular';
import { BlockEditorState, BlockEditorDefaultBlocks } from '@dotcms/types/internal';
import { Observable } from 'rxjs';
/**
* Directive to show a template when the UVE is in a specific mode.
*
* @example
*
* This will be shown when the UVE is in edit mode.
*
*
* @export
* @class DotCMSShowWhenDirective
*/
declare class DotCMSShowWhenDirective {
#private;
set dotCMSShowWhen(value: UVE_MODE);
private updateViewContainer;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵdir: i0.ɵɵDirectiveDeclaration;
}
/**
* Provides a DotCMS image loader configuration for the Angular Image directive
*
* @param path - The base URL path to the DotCMS instance, or empty to use current site
* @returns An array of providers for the IMAGE_LOADER token
* @throws Error if the provided path is invalid
* @example
* ```typescript
* // In your app.config.ts
* export const appConfig: ApplicationConfig = {
* providers: [
* provideDotCMSImageLoader('https://demo.dotcms.com')
* // Or use current site:
* // provideDotCMSImageLoader()
* ]
* };
* ```
*/
declare function provideDotCMSImageLoader(path?: string): Provider[];
/**
* Type alias for the return type of createDotCMSClient function.
* Used to ensure type consistency across the DotCMSClient interface and class.
*/
type ClientType = ReturnType;
/**
* Interface that extends the client type created by createDotCMSClient.
* This interface provides type safety and IntelliSense support for the DotCMS client
* when used as a dependency injection token in Angular applications.
*
* @example
* ```typescript
* dotcmsClient = inject(DotCMSClient);
* ```
*/
interface DotCMSClient extends ClientType {
}
declare class DotCMSClient {
constructor(client: ClientType);
}
/**
* Provides Angular environment providers for the DotCMS client.
*
* Registers a singleton DotCMS client instance in the Angular dependency injection system,
* configured with the given options. This allows you to inject `DotCMSClient` anywhere
* in your app using Angular's `inject()` function.
*
* Should be added to the application's providers (e.g., in `main.ts` or `app.config.ts`).
*
* @param options - Configuration for the DotCMS client.
* @param options.dotcmsUrl - The base URL for the DotCMS instance (required).
* @param options.authToken - Authentication token for API requests (required).
* @param options.siteId - The site identifier (optional).
* @param options.requestOptions - Additional fetch options (optional).
* @param options.httpClient - Optional factory for a custom HTTP client, receives Angular's HttpClient.
* @returns Angular environment providers for the DotCMS client.
*
* @example
* import { provideDotCMSClient } from '@dotcms/angular';
*
* bootstrapApplication(AppComponent, {
* providers: [
* provideDotCMSClient({
* dotcmsUrl: 'https://demo.dotcms.com',
* authToken: 'your-auth-token',
* siteId: 'your-site-id',
* httpClient: (http) => new AngularHttpClient(http)
* })
* ]
* });
*/
declare function provideDotCMSClient(options: DotCMSAngularProviderConfig): EnvironmentProviders;
/**
* Configuration interface for the DotCMS Angular provider.
*
* Extends the base `DotCMSClientConfig` but replaces the `httpClient` property
* with an Angular-specific factory function that receives Angular's `HttpClient`
* and returns a `DotHttpClient` implementation.
*
* This interface is designed to work seamlessly with Angular's dependency injection
* system, allowing you to leverage Angular's built-in HTTP client while maintaining
* compatibility with the DotCMS client's expected interface.
*
* @example
* ```typescript
* const config: DotCMSAngularProviderConfig = {
* dotcmsUrl: 'https://demo.dotcms.com',
* authToken: 'your-auth-token',
* siteId: 'your-site-id',
* httpClient: (http: HttpClient) => new AngularHttpClient(http)
* };
* ```
*
* @example
* ```typescript
* // Using with provideDotCMSClient
* provideDotCMSClient({
* dotcmsUrl: 'https://demo.dotcms.com',
* authToken: 'your-auth-token',
* httpClient: (http) => new AngularHttpClient(http)
* })
* ```
*/
interface DotCMSAngularProviderConfig extends Omit {
/**
* Optional factory function that creates a custom HTTP client implementation.
*
* This function receives Angular's `HttpClient` instance and should return
* a `DotHttpClient` implementation. If not provided, the DotCMS client will
* use its default HTTP client implementation.
*
* @param http - Angular's HttpClient instance from dependency injection
* @returns A DotHttpClient implementation
*
* @example
* ```typescript
* httpClient: (http: HttpClient) => {
* return new AngularHttpClient(http);
* }
* ```
*/
httpClient?: (http: HttpClient) => DotHttpClient;
}
type DOT_EDITABLE_TEXT_MODE = 'minimal' | 'full' | 'plain';
type DOT_EDITABLE_TEXT_FORMAT = 'html' | 'text';
/** Minimal TinyMCE editor API used by this component (avoids non-portable reference to nested tinymce types). */
interface DotEditableTextEditor {
getContent(options?: {
format?: string;
}): string;
isDirty(): boolean;
setContent(content: string, options?: {
format?: string;
}): void;
focus(): void;
hasFocus(): boolean;
}
/**
* Dot editable text component.
* This component is responsible to render a text field that can be edited inline.
*
* @export
* @class DotCMSEditableTextComponent
* @implements {OnInit}
* @implements {OnChanges}
*/
declare class DotCMSEditableTextComponent implements OnInit, OnChanges {
#private;
editorComponent: EditorComponent;
/**
* Represents the mode of the editor which can be `plain`, `minimal`, or `full`
*
* @type {DOT_EDITABLE_TEXT_MODE}
* @memberof DotCMSEditableTextComponent
*/
mode: DOT_EDITABLE_TEXT_MODE;
/**
* Represents the format of the editor which can be `text` or `html`
*
* @type {DOT_EDITABLE_TEXT_FORMAT}
* @memberof DotCMSEditableTextComponent
*/
format: DOT_EDITABLE_TEXT_FORMAT;
/**
* Represents the `contentlet` that can be inline edited
*
* @type {DotCMSContentlet}
* @memberof DotCMSEditableTextComponent
*/
contentlet: T;
/**
* Represents the field name of the `contentlet` that can be edited
*
* @memberof DotCMSEditableTextComponent
*/
fieldName: keyof T;
/**
* Represents the content of the `contentlet` that can be edited
*
* @protected
* @memberof DotCMSEditableTextComponent
*/
protected content: string;
/**
* Represents the configuration of the editor
*
* @protected
* @type {EditorComponent['init']}
* @memberof DotCMSEditableTextComponent
*/
protected init: EditorComponent['init'];
/**
* The TinyMCE editor
*
* @readonly
* @memberof DotCMSEditableTextComponent
*/
get editor(): DotEditableTextEditor | undefined;
/**
* Represents if the component is inside the editor
*
* @protected
* @type {boolean}
* @memberof DotCMSEditableTextComponent
*/
protected get isEditMode(): string | false | null | undefined;
/**
* Returns the number of pages the contentlet is on
*
* @readonly
* @memberof DotCMSEditableTextComponent
*/
get onNumberOfPages(): string | 1;
/**
* Handle copy contentlet inline editing success event
*
* @param {MessageEvent} { data }
* @return {*}
* @memberof DotCMSEditableTextComponent
*/
onMessage({ data }: MessageEvent): void;
ngOnInit(): void;
ngOnChanges(): void;
/**
* Handle mouse down event
*
* @param {{ event: MouseEvent }} { event }
* @return {*}
* @memberof DotCMSEditableTextComponent
*/
onMouseDown({ event }: {
event: MouseEvent;
}): void;
/**
* Handle focus out event
*
* @return {*}
* @memberof DotCMSEditableTextComponent
*/
onFocusOut(): void;
/**
* inner HTML to element
*
* @private
* @param {string} editedContent
* @return {*}
* @memberof DotCMSEditableTextComponent
*/
private innerHTMLToElement;
/**
* Check if the content has changed
*
* @private
* @param {string} editedContent
* @return {*}
* @memberof DotCMSEditableTextComponent
*/
private didContentChange;
static ɵfac: i0.ɵɵFactoryDeclaration, never>;
static ɵcmp: i0.ɵɵComponentDeclaration, "dotcms-editable-text", never, { "mode": { "alias": "mode"; "required": false; }; "format": { "alias": "format"; "required": false; }; "contentlet": { "alias": "contentlet"; "required": false; }; "fieldName": { "alias": "fieldName"; "required": false; }; }, {}, never, never, true, never>;
}
/**
* Represents a dynamic component entity.
* @typedef {Promise>} DynamicComponentEntity
* @memberof @dotcms/angular
*/
type DynamicComponentEntity = Promise>;
/**
* Represents a DotCMS page component.
* Used to store the dynamic components of a DotCMS page.
* @typedef {Record} DotCMSPageComponent
* @memberof @dotcms/angular
*/
type DotCMSPageComponent = Record;
/**
* Represents a Custom Renderer used by the Block Editor Component
*
* @export
* @interface CustomRenderer
*/
type CustomRenderer = Record;
/**
* A component that renders content from DotCMS's Block Editor field.
*
* This component provides an easy way to render Block Editor content in your Angular applications.
* It handles the rendering of standard blocks and allows customization through custom renderers.
*
* For more information about Block Editor, see {@link https://dev.dotcms.com/docs/block-editor}
*
* @example
* ```html
*
*
* ```
*
* @deprecated Use {@link DotCMSBlockEditorRendererNativeComponent}
* (``) for accessible, semantic DOM output.
* This component wraps every semantic tag in a custom element (e.g. a dispatcher
* element sits between `
` and its `
` children), which breaks the
* `list → listitem` relationship required by the HTML spec and assistive technology.
* The native renderer keeps the identical public input API — migration is just
* swapping the tag and import. This component is retained for backward compatibility
* and will be removed in a future major version.
*/
declare class DotCMSBlockEditorRendererComponent {
blocks: BlockEditorNode;
customRenderers: CustomRenderer | undefined;
class: string | undefined;
style: string | Record | undefined;
$blockEditorState: i0.WritableSignal;
$isInEditMode: i0.WritableSignal;
ngOnInit(): void;
static ɵfac: i0.ɵɵFactoryDeclaration;
static ɵcmp: i0.ɵɵComponentDeclaration;
}
/**
* An accessible component that renders content from DotCMS's Block Editor field.
*
* This is the semantic-DOM successor to {@link DotCMSBlockEditorRendererComponent}.
* It emits clean semantic HTML — `
…
` — with no custom
* wrapper elements between semantic tags, so the `list → listitem` relationship
* required by the HTML spec and assistive technology is preserved. The recursive
* dispatch is performed with `ng-template` outlets, whose host ``s
* render as HTML comment nodes (invisible to the accessibility tree).
*
* It exposes the **identical public input API** and the same `customRenderers`
* contract as the deprecated renderer, so migration is just swapping the tag and
* import.
*
* For more information about Block Editor, see {@link https://dev.dotcms.com/docs/block-editor}
*
* @example
* ```html
*
*
* ```
*/
declare class DotCMSBlockEditorRendererNativeComponent implements OnInit {
/** The Block Editor `doc` node to render. */
readonly blocks: i0.InputSignal;
/** Map of `node.type` → component to override the built-in render path. */
readonly customRenderers: i0.InputSignal;
/**
* CSS class on the wrapper element. Aliased as `class` so consumers can
* pass `[class]="…"` like a normal Angular class binding.
*/
readonly cssClass: i0.InputSignal;
/** Inline style on the wrapper element. */
readonly style: i0.InputSignal | undefined>;
$blockEditorState: i0.WritableSignal;
$isInEditMode: i0.WritableSignal;
protected readonly BLOCKS: typeof BlockEditorDefaultBlocks;
ngOnInit(): void;
/**
* Normalizes a heading `level` attribute (which may be a number such as `6`
* or a string such as `'6'`) to a string for use in the heading `@switch`.
* Returns `''` for missing or out-of-range levels so the template falls
* through to the safe `@default` case (`
`).
*/
asLevel(level: number | string | undefined): string;
/** The marks after the current (outermost) one — used to recurse inward. */
restMarks(marks: BlockEditorMark[] | undefined): BlockEditorMark[];
/** The attributes of the current (outermost) mark. */
markAttrs(marks: BlockEditorMark[] | undefined): Record;
/**
* Wrapper style for a `dotImage` ``, derived from the node's
* `textWrap` (float left/right) or `textAlign` attribute.
*/
imageStyle(attrs: BlockEditorNode['attrs']): Record;
/**
* The link assigned to a `dotImage` in the Block Editor, stored as
* `href`/`target` on the node. Returns `null` when the image has no link,
* i.e. when `href` is `null`. The truthiness check also covers the
* transient `''` the editor writes while unsetting a link.
*
* `rel` guards against reverse tabnabbing when the link opens in a new tab.
*/
imageLink(attrs: BlockEditorNode['attrs']): {
href: string;
target: string | null;
rel: string | null;
} | null;
/** Poster URL for a `dotVideo` `