当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript tslib.__assign函数代码示例

本文整理汇总了TypeScript中tslib.__assign函数的典型用法代码示例。如果您正苦于以下问题:TypeScript __assign函数的具体用法?TypeScript __assign怎么用?TypeScript __assign使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了__assign函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: buildRequestParams

function buildRequestParams(meta: JsonFeedMeta, range: DateRange, calendar: Calendar) {
  const dateEnv = calendar.dateEnv
  let startParam
  let endParam
  let timeZoneParam
  let customRequestParams
  let params = {}

  startParam = meta.startParam
  if (startParam == null) {
    startParam = calendar.opt('startParam')
  }

  endParam = meta.endParam
  if (endParam == null) {
    endParam = calendar.opt('endParam')
  }

  timeZoneParam = meta.timeZoneParam
  if (timeZoneParam == null) {
    timeZoneParam = calendar.opt('timeZoneParam')
  }

  // retrieve any outbound GET/POST data from the options
  if (typeof meta.extraParams === 'function') {
    // supplied as a function that returns a key/value object
    customRequestParams = meta.extraParams()
  } else {
    // probably supplied as a straight key/value object
    customRequestParams = meta.extraParams || {}
  }

  __assign(params, customRequestParams)

  params[startParam] = dateEnv.formatIso(range.start)
  params[endParam] = dateEnv.formatIso(range.end)

  if (dateEnv.timeZone !== 'local') {
    params[timeZoneParam] = dateEnv.timeZone
  }

  return params
}
开发者ID:pjobs,项目名称:fullcalendar,代码行数:43,代码来源:json-feed-event-source.ts

示例2: parseRecurring

export function parseRecurring(
  eventInput: EventInput,
  allDayDefault: boolean | null,
  dateEnv: DateEnv,
  recurringTypes: RecurringType[],
  leftovers: any
) {
  for (let i = 0; i < recurringTypes.length; i++) {
    let localLeftovers = {} as any
    let parsed = recurringTypes[i].parse(eventInput, localLeftovers, dateEnv) as ParsedRecurring

    if (parsed) {

      let allDay = localLeftovers.allDay
      delete localLeftovers.allDay // remove from leftovers
      if (allDay == null) {
        allDay = allDayDefault
        if (allDay == null) {
          allDay = parsed.allDayGuess
          if (allDay == null) {
            allDay = false
          }
        }
      }

      __assign(leftovers, localLeftovers)

      return {
        allDay,
        duration: parsed.duration,
        typeData: parsed.typeData,
        typeId: i
      }

    }
  }

  return null
}
开发者ID:fullcalendar,项目名称:fullcalendar,代码行数:39,代码来源:recurring-event.ts

示例3: parseEventDef

export function parseEventDef(raw: EventNonDateInput, sourceId: string, allDay: boolean, hasEnd: boolean, calendar: Calendar): EventDef {
  let leftovers = {}
  let def = pluckNonDateProps(raw, calendar, leftovers) as EventDef

  def.defId = String(uid++)
  def.sourceId = sourceId
  def.allDay = allDay
  def.hasEnd = hasEnd

  for (let eventDefParser of calendar.pluginSystem.hooks.eventDefParsers) {
    let newLeftovers = {}
    eventDefParser(def, leftovers, newLeftovers)
    leftovers = newLeftovers
  }

  def.extendedProps = __assign(leftovers, def.extendedProps || {})

  // help out EventApi from having user modify props
  Object.freeze(def.ui.classNames)
  Object.freeze(def.extendedProps)

  return def
}
开发者ID:BorjaPintos,项目名称:fullcalendar,代码行数:23,代码来源:event.ts

示例4: addDynamic

 addDynamic(props) {
   __assign(this.dynamicOverrides, props)
   this.compute()
 }
开发者ID:fullcalendar,项目名称:fullcalendar,代码行数:4,代码来源:OptionsManager.ts

示例5: add

 add(props) {
   __assign(this.overrides, props)
   this.compute()
 }
开发者ID:fullcalendar,项目名称:fullcalendar,代码行数:4,代码来源:OptionsManager.ts

示例6: __assign

export function extend<T1, T2>(dest: T1, src: T2): T1 & T2 {
  return __assign(dest, src)
}
开发者ID:digitalsatori,项目名称:Bokeh,代码行数:3,代码来源:object.ts


注:本文中的tslib.__assign函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。