import Ruleset from './Ruleset'; import Sheet from './Sheet'; import { ComponentBlock, FontFace, GlobalSheet, Keyframes, Properties, StyleSheet, ClassName, TransformOptions } from './types'; export declare const SELECTOR: RegExp; export declare const CLASS_NAME: RegExp; export declare type Handler = (...args: any[]) => void; export default class UnifiedSyntax { handlers: { [eventName: string]: Handler; }; keyframesCount: number; constructor(); /** * Convert at-rules within a global style sheet. */ convertGlobalSheet(globalSheet: GlobalSheet, options: TransformOptions): Sheet; /** * Convert a mapping of unified rulesets to their native syntax. */ convertStyleSheet(styleSheet: StyleSheet, options: TransformOptions): Sheet; /** * Convert a pseudo CSS declaration block to raw CSS using Stylis. * Emit the raw CSS so that adapters can inject it into the DOM. */ convertRawCss(sheet: Sheet, selector: string, declaration: string): ClassName; /** * Convert a ruleset including local at-rules, blocks, and properties. */ convertRuleset(unifiedRuleset: ComponentBlock, ruleset: Ruleset): Ruleset; /** * Convert a nested selector ruleset by emitting the appropriate name. */ convertSelector(key: string, value: ComponentBlock, ruleset: Ruleset, inAtRule?: boolean): void; /** * Convert a unified syntax list of font face objects to rulesets. */ convertFontFaces(fontFamily: string, faces: FontFace[], sheet: Sheet): void; /** * Convert a unified syntax keyframes object to a ruleset. */ convertKeyframe(animationName: string, frames: Keyframes, sheet: Sheet): void; /** * Support keyframe objects within the `animationName` property. */ handleAnimationName: (ruleset: Ruleset, value: string | Keyframes | (string | Keyframes)[] | undefined) => string | undefined; /** * Support font face objets within the `fontFamily` property. */ handleFontFamily: (ruleset: Ruleset, value: string | FontFace | (string | FontFace)[] | undefined) => string | undefined; /** * Replace a `fontFamily` property with font face objects of the same name. */ injectFontFaces(value?: string, cache?: { [fontFamily: string]: D[]; }): (string | D)[]; /** * Replace a `animationName` property with keyframe objects of the same name. */ injectKeyframes(value?: string, cache?: { [animationName: string]: D; }): (string | D)[]; /** * Execute the defined event listener with the arguments. */ emit(eventName: 'attribute' | 'media' | 'pseudo' | 'selector' | 'support', args: [Ruleset, string, Ruleset]): unknown; emit(eventName: 'charset', args: [Sheet, string]): unknown; emit(eventName: 'css', args: [string, string]): unknown; emit(eventName: 'fallback', args: [Ruleset, keyof NativeBlock, unknown[]]): unknown; emit(eventName: 'font-face', args: [Sheet, Ruleset[], string, string[][]]): unknown; emit(eventName: 'global', args: [Sheet, string, Ruleset]): unknown; emit(eventName: 'import', args: [Sheet, string[]]): unknown; emit(eventName: 'keyframe', args: [Sheet, Ruleset, string]): unknown; emit(eventName: 'page' | 'viewport', args: [Sheet, Ruleset]): unknown; emit(eventName: 'property', args: [Ruleset, keyof NativeBlock, unknown]): unknown; emit(eventName: 'property:animationName', args: [Ruleset, Properties['animationName']]): unknown; emit(eventName: 'property:fontFamily', args: [Ruleset, Properties['fontFamily']]): unknown; /** * Delete an event listener. */ off(eventName: string): this; /** * Register an event listener. */ on(eventName: 'attribute' | 'pseudo' | 'selector' | 'support', callback: (ruleset: Ruleset, name: string, value: Ruleset) => void): this; on(eventName: 'charset', callback: (sheet: Sheet, charset: string) => void): this; on(eventName: 'css', callback: (css: string, className: string) => void): this; on(eventName: 'fallback', callback: (ruleset: Ruleset, name: keyof NativeBlock, values: unknown[]) => void): this; on(eventName: 'font-face', callback: (sheet: Sheet, fontFaces: Ruleset[], fontFamily: string, srcPaths: string[][]) => void): this; on(eventName: 'global', callback: (sheet: Sheet, selector: string, ruleset: Ruleset) => void): this; on(eventName: 'import', callback: (sheet: Sheet, paths: string[]) => void): this; on(eventName: 'keyframe', callback: (sheet: Sheet, keyframe: Ruleset, animationName: string) => void): this; on(eventName: 'media', callback: (ruleset: Ruleset, query: string, value: Ruleset) => void): this; on(eventName: 'page' | 'viewport', callback: (sheet: Sheet, ruleset: Ruleset) => void): this; on(eventName: 'property', callback: (ruleset: Ruleset, name: keyof NativeBlock, value: unknown) => void): this; on(eventName: 'property:animationName', callback: (ruleset: Ruleset, value: Properties['animationName']) => unknown): this; on(eventName: 'property:fontFamily', callback: (ruleset: Ruleset, value: Properties['fontFamily']) => unknown): this; } //# sourceMappingURL=UnifiedSyntax.d.ts.map