@blocklet/ui-react
Version:
Some useful front-end web components that can be used in Blocklets.
57 lines (56 loc) • 1.56 kB
TypeScript
import { UserMetadata } from '../../../@types';
export declare const currentTimezone: string;
export declare const getTimezones: () => {
label: string;
value: string;
}[];
export declare const isValidUrl: (url: string) => any;
export declare const isDuplicateUrl: (url1: string, url2: string) => boolean;
/**
* 根据 duration 类型,计算出date range
* @param status
* @returns
*/
export declare const getStatusDuration: (status: UserMetadata["status"]) => Date[];
/**
* 根据状态的 duration,判断是否在时间范围内
* @param status
* @returns
*/
export declare const isWithinTimeRange: (dateRange: [Date, Date]) => boolean;
/**
* 判断状态持续时间是否为不可清除
* @param status
* @returns
*/
export declare const isNotClear: (status: UserMetadata["status"]) => boolean;
/**
* 获取当前时间距离结束时间还有多久
*/
export declare const getTimeRemaining: (date: Date) => number;
export declare const defaultButtonStyle: {
color: string;
borderColor: string;
backgroundColor: string;
'&:hover': {
borderColor: string;
backgroundColor: string;
};
py: number;
borderRadius: number;
};
export declare const primaryButtonStyle: {
color: string;
borderColor: string;
backgroundColor: string;
'&:hover': {
borderColor: string;
backgroundColor: string;
};
py: number;
borderRadius: number;
};
export declare const getLogoByUrl: (url: string) => {
icon: string;
options?: Record<string, any>;
} | undefined;