import { ItemIdentifier, OtterMessageContent, ConnectContentMessage, RequestMessagesContentMessage, MessageDataTypes, DevtoolsCommonOptions } from '@o3r/core'; import * as i0 from '@angular/core'; import { ModuleWithProviders, InjectionToken } from '@angular/core'; type CssVariableType = 'string' | 'color'; /** Metadata for a CSS Variable */ interface CssVariable { /** Name of the variable */ name: string; /** Default value of the variable */ defaultValue: string; /** References of the variable */ references?: CssVariable[]; /** Tags of the variable */ tags?: string[]; /** Description of the variable */ description?: string; /** Description of the variable */ label?: string; /** Type of the variable */ type?: CssVariableType; /** Name of a group of variables */ category?: string; /** component reference if the variable is linked to one */ component?: ItemIdentifier; } /** Style Metadata map */ interface CssMetadata { /** Variables' dictionary */ variables: { [name: string]: CssVariable; }; } /** * Styling devtools service options */ interface StylingDevtoolsServiceOptions extends DevtoolsCommonOptions { /** * Path to retrieve the styling metadata file */ stylingMetadataPath: string; } /** Update styling variables */ interface UpdateStylingVariablesContentMessage extends OtterMessageContent<'updateStylingVariables'> { /** * Dictionary of variable value to update * indexed by the variable name */ variables: Record; } /** Reset styling variables override */ interface ResetStylingVariablesContentMessage extends OtterMessageContent<'resetStylingVariables'> { } /** Styling variable */ type StylingVariable = CssVariable & { runtimeValue?: string; }; /** Get styling variables */ interface GetStylingVariableContentMessage extends OtterMessageContent<'getStylingVariable'> { /** List of styling variables */ variables: StylingVariable[]; } /** * List of styling message contents */ type StylingMessageContents = UpdateStylingVariablesContentMessage | ResetStylingVariablesContentMessage | GetStylingVariableContentMessage; /** List of possible DataTypes for Styling messages */ type StylingMessageDataTypes = MessageDataTypes; /** List of all messages for Styling purposes */ type AvailableStylingMessageContents = StylingMessageContents | ConnectContentMessage | RequestMessagesContentMessage; /** Tag to identify theme variable */ declare const THEME_TAG_NAME = "theme"; /** Tag to identify palette variable */ declare const PALETTE_TAG_NAME = "palette"; /** * Styling devtools service */ declare class OtterStylingDevtools { private readonly document; /** * Retrieve styling metadata * @param stylingMetadataPath */ getStylingMetadata(stylingMetadataPath: string): Promise; /** * Update styling variables * @param variables */ updateVariables(variables: Record): void; /** * Reset styling variables override */ resetStylingVariables(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Service to handle communication between application and chrome extension for styling */ declare class StylingDevtoolsMessageService { private readonly logger; private readonly stylingDevTools; private readonly options; private readonly sendMessage; private readonly destroyRef; constructor(); private sendMetadata; /** * Function to trigger a re-send a requested messages to the Otter Chrome DevTools extension * @param only restricted list of messages to re-send */ private handleReEmitRequest; /** * Function to handle the incoming messages from Otter Chrome DevTools extension * @param message Message coming from the Otter Chrome DevTools extension */ private handleEvents; /** * Function to connect the plugin to the Otter Chrome DevTools extension */ private connectPlugin; /** @inheritDoc */ activate(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class StylingDevtoolsModule { /** * Initialize Otter Devtools * @param options */ static instrument(options: Partial): ModuleWithProviders; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * Default value for styling devtools */ declare const OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS: Readonly; /** * Token for styling devtools */ declare const OTTER_STYLING_DEVTOOLS_OPTIONS: InjectionToken; export { OTTER_STYLING_DEVTOOLS_DEFAULT_OPTIONS, OTTER_STYLING_DEVTOOLS_OPTIONS, OtterStylingDevtools, PALETTE_TAG_NAME, StylingDevtoolsMessageService, StylingDevtoolsModule, THEME_TAG_NAME }; export type { AvailableStylingMessageContents, CssMetadata, CssVariable, CssVariableType, GetStylingVariableContentMessage, ResetStylingVariablesContentMessage, StylingDevtoolsServiceOptions, StylingMessageDataTypes, StylingVariable, UpdateStylingVariablesContentMessage }; //# sourceMappingURL=o3r-styling.d.ts.map