types: supplemental type declaration

This commit is contained in:
xiaoxian521 2022-04-06 13:24:16 +08:00
parent 5efeb28eb3
commit 9797534458

View File

@ -26,7 +26,9 @@ export const writeNewStyle = (newStyle: string): void => {
};
// 根据主题色,生成最新的样式表
export const createNewStyle = (primaryStyle: string): string => {
export const createNewStyle = (
primaryStyle: Record<string, any>
): Record<string, any> => {
// 根据主色生成色值表
const colors = createColors(primaryStyle);
// 在当前ep的默认样式表中标记需要替换的色值
@ -41,7 +43,9 @@ export const createNewStyle = (primaryStyle: string): string => {
return cssText;
};
export const createColors = (primary: string) => {
export const createColors = (
primary: Record<string, any>
): Record<string, any> => {
if (!primary) return;
const colors = {
primary
@ -53,7 +57,7 @@ export const createColors = (primary: string) => {
return colors;
};
const getStyleTemplate = (data: string): string => {
const getStyleTemplate = (data: Record<string, any>): Record<string, any> => {
const colorMap = {
"#3a8ee6": "shade-1",
"#409eff": "primary",