@onesy/style
Version:
CSS in JS styling solution
68 lines (67 loc) • 1.88 kB
TypeScript
import OnesyStyle from './OnesyStyle';
import OnesyStyleSheetManager from './OnesyStyleSheetManager';
import OnesyTheme from './OnesyTheme';
import { TMode, IOptionsRule, IValuesVersion, TStatus, TPriority, IAddRuleResponse, TValueObject } from './interfaces';
declare type TVersion = 'all' | 'static' | 'dynamic';
export interface IRuleItem {
property: string;
value: any;
}
export interface IOptionsStyle {
attributes?: Record<string, any>;
}
export interface IOptions {
version?: TVersion;
mode?: TMode;
pure?: boolean;
priority?: TPriority;
onesyTheme?: OnesyTheme;
onesyStyleSheetManager?: OnesyStyleSheetManager;
onesyStyle?: OnesyStyle;
props?: any;
style?: IOptionsStyle;
rule?: IOptionsRule;
name?: string;
}
declare class OnesyStyleSheet {
value?: TValueObject;
options: IOptions;
id: string;
version: TVersion;
mode: TMode;
pure: boolean;
priority: TPriority;
onesyTheme: OnesyTheme;
onesyStyleSheetManager: OnesyStyleSheetManager;
onesyStyle: OnesyStyle;
status: TStatus;
element: HTMLStyleElement;
sheet: CSSStyleSheet;
domElementForTesting: HTMLDivElement;
private props_;
values: {
css: string;
};
rules: Array<IRuleItem>;
names: {
classNames: {};
classes: {};
keyframes: {};
styles: (...args: string[]) => string;
};
constructor(value?: TValueObject, options?: IOptions);
get props(): any;
set props(props: any);
get response(): IValuesVersion;
get css(): string;
private get sort();
private init;
addRule(value: any, property_?: string, add?: boolean): IAddRuleResponse;
add(props?: any): void;
update(value: any): void;
remove(): void;
private updateProps;
private propsAreNew;
private makeRule;
}
export default OnesyStyleSheet;