import type { ReactElement } from 'react'; import type { Decoration, Decoration_Type, DocumentStyle, NodeStyle, TextStyle } from 'ricos-schema'; import type { Subscription } from './events'; import type { RichTextNode } from './node-refined-types'; import type { RicosTheme } from './themeTypes'; /** * Aggregates Theme and DocumentStyle * * Responsibilities: * - ensures DocumentStyle precedence over Theme * - extracts summarized decorations per node type * * @export * @interface AmbientStyles */ export interface AmbientStyles { onThemeUpdate(callback: (theme: RicosTheme) => void): Subscription; onDocumentStyleUpdate(callback: (documentStyle: DocumentStyle) => void): Subscription; /** * Extracts given decoration settings for specific node type from the current Document Style and Theme conjunction * * * @param {RichTextNode} type * @param {Decoration_Type} decoration type * @returns {Decoration} * @memberof AmbientStyles */ getDecoration(type: RichTextNode, decoration: Decoration_Type): Decoration; /** * Extracts given text style (line height) settings for specific node type from the current Document Style and Theme conjunction * * * @param {RichTextNode} type * @returns {Omit} * @memberof AmbientStyles */ getTextStyle(type: RichTextNode): Omit; /** * Extracts given node style (margins) settings for specific node type from the current Document Style and Theme conjunction * * * @param {RichTextNode} type * @returns {NodeStyle} * @memberof AmbientStyles */ getNodeStyle(type: RichTextNode): NodeStyle; /** * Sets new theme * * @param {RicosTheme} theme * @memberof AmbientStyles */ setTheme(theme: RicosTheme, isMobile?: boolean): AmbientStyles; /** * Sets new Document Style * * @param {RichContentDocumentStyle} documentStyle * @memberof AmbientStyles */ setDocumentStyle(documentStyle: DocumentStyle): AmbientStyles; /** * Produces HTML style tags for DocumentStyle and Theme, guarantees correct precedence * @deprecated * @returns {ReactElement[]} style tag elements * @memberof AmbientStyles */ toStyleTags(): ReactElement[]; } //# sourceMappingURL=styles.d.ts.map