當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。