@lspriv/wc-plugin-ics
Version:
小程序日历组件订阅插件
70 lines (69 loc) • 2.45 kB
TypeScript
import { type UtcOffset } from './utc';
import { type ICalBinary } from './binary';
import { ICalTime } from './time';
import { type ICalDuration } from './duration';
import { type ICalPeriodData, ICalPeriod } from './period';
import { type ICalProperty } from './property';
import { type ICalRecurDict, type ICalRecur } from './recur';
export declare const DEFAULT_TYPE = "unknown";
export type DesignValueType<T, U = any> = {
/** An array of valid values for this value type (currently unused) */
values?: string[];
/** A regular expression the value type must match (currently unused) */
matches?: RegExp;
fromICAL?(value: string, escape?: string): T;
decorate?(value: T, prop?: ICalProperty): U;
};
export type DesignParamType = {
matches?: RegExp;
values?: string[];
valueType?: string;
allowXName?: boolean;
allowIanaToken?: boolean;
multiValue?: string;
multiValueSeparateDQuote?: boolean;
};
export type DesignPropType = {
defaultType: string;
allowedTypes?: string[];
multiValue?: string;
structuredValue?: string;
detectType?(str: string): string;
};
interface DesignValue {
boolean: DesignValueType<boolean>;
float: DesignValueType<number>;
integer: DesignValueType<number>;
'utc-offset': DesignValueType<string, UtcOffset>;
text: DesignValueType<string>;
uri: DesignValueType<any>;
binary: DesignValueType<any, ICalBinary>;
'cal-address': DesignValueType<any>;
date: DesignValueType<string, any>;
'date-time': DesignValueType<string, ICalTime>;
duration: DesignValueType<string, ICalDuration>;
period: DesignValueType<ICalPeriodData, ICalPeriod>;
recur: DesignValueType<ICalRecurDict, ICalRecur>;
time: DesignValueType<string>;
}
type DesignParam = Record<string, DesignParamType>;
type DesignProp = Record<string, DesignPropType>;
export interface DesignSet {
value: DesignValue;
param: DesignParam;
property: DesignProp;
}
export declare const ICalendar: DesignSet;
export declare const JCAL_COMPONENT: {
readonly CALENDAR: "vcalendar";
readonly EVENT: "vevent";
readonly TODO: "vtodo";
readonly JOURNAL: "vjournal";
readonly ALRAM: "valarm";
readonly FREEBUSY: "vfreebusy";
readonly TIMEZONE: "vtimezone";
readonly DAYLIGHT: "daylight";
readonly STANDARD: "standard";
};
export declare const getDesignSet: (componentName: string) => DesignSet;
export {};