本文整理汇总了TypeScript中@fullcalendar/core.refineProps函数的典型用法代码示例。如果您正苦于以下问题:TypeScript refineProps函数的具体用法?TypeScript refineProps怎么用?TypeScript refineProps使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了refineProps函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: parse
} from '@fullcalendar/core'
interface RRuleParsedRecurring extends ParsedRecurring {
typeData: RRule
}
const EVENT_DEF_PROPS = {
rrule: null,
duration: createDuration
}
let recurring: RecurringType = {
parse(rawEvent: EventInput, leftoverProps: any, dateEnv: DateEnv): RRuleParsedRecurring | null {
if (rawEvent.rrule != null) {
let props = refineProps(rawEvent, EVENT_DEF_PROPS, {}, leftoverProps)
let parsed = parseRRule(props.rrule, dateEnv)
if (parsed) {
return {
typeData: parsed.rrule,
allDayGuess: parsed.allDayGuess,
duration: props.duration
}
}
}
return null
},
expand(rrule: RRule, framingRange: DateRange): DateMarker[] {
示例2: parseMeta
const STANDARD_PROPS = {
url: String,
googleCalendarApiKey: String, // TODO: rename with no prefix?
googleCalendarId: String,
data: null
}
let eventSourceDef: EventSourceDef = {
parseMeta(raw) {
if (typeof raw === 'string') {
raw = { url: raw }
}
if (typeof raw === 'object') {
let standardProps = refineProps(raw, STANDARD_PROPS)
if (!standardProps.googleCalendarId && standardProps.url) {
standardProps.googleCalendarId = parseGoogleCalendarId(standardProps.url)
}
delete standardProps.url
if (standardProps.googleCalendarId) {
return standardProps
}
}
return null
},