@amaui/style
Version:
CSS in JS styling solution
129 lines (128 loc) • 3.92 kB
TypeScript
import type * as CSS from 'csstype';
import AmauiSubscription from '@amaui/subscription';
import AmauiStyle from './AmauiStyle';
import AmauiStyleRule from './AmauiStyleRule';
import AmauiStyleSheet from './AmauiStyleSheet';
import AmauiStyleSheetManager from './AmauiStyleSheetManager';
import AmauiTheme from './AmauiTheme';
declare module 'csstype' {
interface Properties {
animationDuration?: CSS.Property.AnimationDuration | number | undefined;
position?: CSS.Property.Position | CSS.Property.BackgroundPosition | undefined;
[index: string]: any;
}
}
export declare type TValueObjectValue = (string | ((props?: any) => TValueObjectValue) | AmauiSubscription | CSS.Properties<string | number | Array<string | number> | Array<Array<string | number>> | Array<TValueObjectValue> | Array<Array<TValueObjectValue>> | ((props?: any) => TValueObjectValue)> | Record<string, any> | {
[index: string]: CSS.Properties<TValueObjectValue>;
});
export declare type TValueObject = Record<string, TValueObjectValue>;
export declare type TValueMethod = (theme: AmauiTheme) => TValueObject;
export declare type TValue = TValueObject | TValueMethod;
export declare type TMode = 'regular' | 'atomic';
export declare type TDirection = 'ltr' | 'rtl';
export declare type TValueVersion = 'value' | 'method' | 'amaui_subscription';
export declare type TRef = {
main: {
sheet: AmauiStyleSheet;
rule: AmauiStyleRule;
};
className: string;
refs: Array<AmauiStyleSheet>;
};
export declare type TRefs = Record<string, TRef>;
export interface IIds {
static: Array<string>;
dynamic: Array<string>;
}
export declare type TStatus = 'idle' | 'inited' | 'active' | 'remove';
export interface IValuesVersion {
css: string;
}
export interface IOptionsRule {
sort?: boolean;
prefix?: boolean;
rtl?: boolean;
}
export interface IAddRuleResponse {
className: string;
classNames: string;
keyframeName: string;
}
export interface IResponse {
ids: IIds;
classNames: Record<string, string>;
classes: Record<string, string>;
keyframes: Record<string, string>;
className: string;
class: string;
styles: (...args: string[]) => string;
}
export declare type TPriority = 'lower' | 'upper';
export interface ISheets {
static: Array<AmauiStyleSheet>;
dynamic: Array<AmauiStyleSheet>;
}
export interface IMethodResponse {
amaui_style_sheet_manager: AmauiStyleSheetManager;
sheets: ISheets;
ids: IIds;
add: (props?: any) => IResponse;
update: (value: any) => void;
props: {
props: any;
ids: string | Array<string>;
} | ((value: {
props: any;
ids: string | Array<string>;
}) => any);
remove: (ids?: string | Array<string>) => void;
addRule: (value: any, property?: string) => IAddRuleResponse;
}
export interface IOptionsAmauiTheme {
value?: AmauiTheme;
get?: (value?: Element) => AmauiTheme;
}
export interface IOptionsAmauiStyle {
value?: AmauiStyle;
get?: (value?: Element) => AmauiStyle;
}
export interface IInsert {
comment?: string;
}
export interface ICSSOptions {
amaui_style?: IOptionsAmauiStyle;
amaui_theme?: IOptionsAmauiTheme;
mode?: TMode;
pure?: boolean;
reset?: boolean;
resetProps?: {
override?: boolean;
};
css?: {
file?: {
name?: string;
hash?: boolean;
};
folders?: Array<{
url?: string;
clear?: boolean;
}>;
clear?: boolean;
minify?: boolean;
};
html?: {
files?: Array<{
url?: string;
insert?: IInsert;
}>;
insert?: IInsert;
add?: boolean;
addNames?: boolean;
};
rule?: IOptionsRule;
log?: boolean;
}
export interface IAmauiStyleSheetManagerProps {
props: any;
ids: string | Array<string>;
}