Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace utils

Index

Variables

dayjs

dayjs: Dayjs

definedFlags

definedFlags: vno.enums.EFlag[]

destructors

destructors: (() => void)[]

inputBinds

inputBinds: Dict<() => void>

Functions

addCacheKey

  • addCacheKey(path: string, needClean?: boolean): string
  • Parameters

    • path: string
    • needClean: boolean = true

    Returns string

addCustomTag

  • addCustomTag(href: string, reside: boolean, isScript: boolean): boolean
  • Parameters

    • href: string
    • reside: boolean
    • isScript: boolean

    Returns boolean

addEventListener

  • addEventListener(element: Document | Element, type: string, listener: EventListenerOrEventListenerObject): void
  • Parameters

    • element: Document | Element
    • type: string
    • listener: EventListenerOrEventListenerObject

    Returns void

addInputBinds

  • addInputBinds(binds: Dict<() => void>): void

callAndListen

  • callAndListen(callback: () => void, event: vno.enums.EEvent, element?: Document | Element, reside?: boolean): void
  • Parameters

    • callback: () => void
        • (): void
        • Returns void

    • event: vno.enums.EEvent
    • element: Document | Element = document
    • reside: boolean = false

    Returns void

chopStr

  • chopStr(str: string, sep: string, trim?: boolean, last?: boolean): [string, string | null]
  • Parameters

    • str: string
    • sep: string
    • trim: boolean = true
    • last: boolean = false

    Returns [string, string | null]

encodeParam

  • encodeParam(value: string): string

evalFunction

  • evalFunction(evalStr: string, params: Dict<any>, asyncResults?: TAsyncResult[]): [string, boolean]

formatDate

  • formatDate(date: any, format?: string): string
  • Parameters

    • date: any
    • Optional format: string

    Returns string

getMessage

  • getMessage(key: string, params?: TMessage): string

isolatedEval

  • isolatedEval(str: string): any

parseDate

  • parseDate(date: string | number): Date

replaceByRegExp

  • replaceByRegExp(regexp: RegExp, data: string, callback: (match: RegExpExecArray) => string): string
  • Parameters

    • regexp: RegExp
    • data: string
    • callback: (match: RegExpExecArray) => string
        • (match: RegExpExecArray): string
        • Parameters

          • match: RegExpExecArray

          Returns string

    Returns string

sleep

  • sleep(timeout: number): Promise<void>

stringifyAny

  • stringifyAny(value: any): string

trimList

  • trimList(list: string[], distinct?: boolean): string[]
  • Parameters

    • list: string[]
    • distinct: boolean = true

    Returns string[]

waitFor

  • waitFor<T>(callback: () => T, maxCount?: number, timeout?: number): Promise<T | undefined>
  • Type parameters

    • T

    Parameters

    • callback: () => T
        • (): T
        • Returns T

    • maxCount: number = 100
    • timeout: number = 100

    Returns Promise<T | undefined>

waitForEvent

  • waitForEvent<T>(callback: () => T, event: vno.enums.EEvent, element?: Document | Element): Promise<T>
  • Type parameters

    • T

    Parameters

    • callback: () => T
        • (): T
        • Returns T

    • event: vno.enums.EEvent
    • element: Document | Element = document

    Returns Promise<T>

Generated using TypeDoc