PromucFlow_constructor/app/client/src/entities/AppTheming/index.ts
Valera Melnikov 9eac55a380
chore: add consistent-type-definitions rule (#27907)
## Description
Add consistent-type-definitions rule
2023-10-11 10:35:24 +03:00

91 lines
1.7 KiB
TypeScript

type DefaultStylesheet = {
[key: string]: string | DefaultStylesheet;
} & {
childStylesheet?: AppThemeStylesheet;
};
export type Stylesheet<T = void> = T extends void
? DefaultStylesheet
: T & DefaultStylesheet;
export interface AppThemeStylesheet {
[key: string]: Stylesheet;
}
export interface ButtonStyles {
resetButtonStyles: {
[key: string]: string;
};
submitButtonStyles: {
[key: string]: string;
};
}
export interface ChildStylesheet {
childStylesheet: AppThemeStylesheet;
}
export interface AppTheme {
id: string;
name: string;
displayName: string;
created_by: string;
created_at: string;
isSystemTheme?: boolean;
// available values for particular type
// NOTE: config represents options available and
// properties represents the selected option
config: {
order: number;
isDeprecated?: boolean;
colors: {
primaryColor: string;
backgroundColor: string;
[key: string]: string;
};
borderRadius: {
[key: string]: {
[key: string]: string;
};
};
boxShadow: {
[key: string]: {
[key: string]: string;
};
};
fontFamily: {
[key: string]: string[];
};
};
// styles for specific widgets
stylesheet: AppThemeStylesheet;
// current values for the theme
properties: {
colors: {
primaryColor: string;
backgroundColor: string;
[key: string]: string;
};
borderRadius: {
[key: string]: string;
};
boxShadow: {
[key: string]: string;
};
fontFamily: {
[key: string]: string;
};
};
}
export interface SetterConfig {
__setters: {
[key: string]: {
path: string;
type: string;
disabled?: string;
accessor?: string;
};
};
}