Options
All
  • Public
  • Public/Protected
  • All
Menu

Web utility

Index

Type aliases

AnimationType

AnimationType: keyof AnimationEvents

BaseEventHandlers

Events of every HTML Element itself

BaseFieldProps

BaseFieldProps: Partial<Pick<HTMLInputElement, "name" | "defaultValue" | "value" | "required" | "disabled">>

BaseHTMLProps

BaseHTMLProps<T>: Partial<DOMProps_Read2Write<Pick<T, Extract<DataKeys<T>, HTMLOwnKeys<T>>>>>

Type parameters

BaseSVGProps

BaseSVGProps<T>: Partial<SVGProps_Read2Write<DOMProps_Read2Write<Pick<T, Extract<DataKeys<T>, SVGOwnKeys<T>>>>>>

Type parameters

BubbleEventHandlers

Events of every Container HTML Element

CSSStyles

CSSStyles: Partial<Omit<PickData<CSSStyleDeclaration>, "length" | "parentRule"> & Record<string, any>>

Constructor

Constructor<T>: new (...args: any[]) => T

Type parameters

  • T

Type declaration

    • new (...args: any[]): T
    • Parameters

      • Rest ...args: any[]

      Returns T

DOMProps_Read2Write

DOMProps_Read2Write<T>: { [ K in keyof T]: T[K] extends HTMLElement ? string : T[K] extends DOMTokenList ? string : T[K] extends CSSStyleDeclaration ? CSSStyles : T[K] }

Type parameters

DataKeys

DataKeys<T>: Exclude<keyof T, TypeKeys<T, Function>>

Type parameters

  • T

GroupKey

GroupKey<T>: keyof T | IndexKey

Type parameters

HTMLContainerProps

HTMLContainerProps: BubbleEventHandlers & HTMLProps & Partial<Pick<HTMLElement, HTMLContentKeys>>

HTMLContentKeys

HTMLContentKeys: "innerHTML" | "innerText" | "textContent" | "contentEditable"

HTMLField

HTMLFieldInternals

HTMLFieldInternals: Pick<HTMLInputElement, "form" | "validity" | "validationMessage" | "willValidate" | "checkValidity" | "reportValidity">

HTMLOwnKeys

HTMLOwnKeys<T>: Exclude<keyof T, keyof Node | keyof EventTarget>

Type parameters

HTMLTableCellProps

HTMLTableCellProps: HTMLContainerProps & Partial<Pick<HTMLTableCellElement, "colSpan" | "rowSpan">>

IndexKey

IndexKey: number | string | symbol

Iteratee

Iteratee<T>: keyof T | ((item: T) => GroupKey<T> | GroupKey<T>[])

Type parameters

JSONValue

JSONValue: number | boolean | string | null

MessageGlobal

MessageGlobal: Window | Worker

NumberFieldProps

NumberFieldProps: BaseInputProps & Partial<Pick<HTMLInputElement, "min" | "max" | "step">>

PickData

PickData<T>: Omit<T, TypeKeys<T, Function>>

Type parameters

  • T

ResultArray

ResultArray<T>: T extends ArrayLike<infer D> ? D[] : T[]

Type parameters

  • T

SHAAlgorithm

SHAAlgorithm: "SHA-1" | "SHA-256" | "SHA-384" | "SHA-512"

SVGOwnKeys

SVGOwnKeys<T>: Exclude<keyof T, keyof Node | keyof EventTarget>

Type parameters

SVGProps_Read2Write

SVGProps_Read2Write<T>: { [ K in keyof T]?: T[K] extends SVGAnimatedLength ? string : T[K] extends SVGAnimatedLengthList ? string : T[K] extends SVGAnimatedRect ? string : T[K] extends SVGAnimatedPreserveAspectRatio ? string : T[K] }

Type parameters

SelfCloseTags

SelfCloseTags: "area" | "base" | "br" | "col" | "embed" | "hr" | "img" | "input" | "link" | "meta" | "param" | "source" | "track" | "wbr"

TextFieldProps

TextFieldProps: BaseInputProps & Partial<Pick<HTMLInputElement, "size" | "minLength" | "maxLength" | "pattern" | "autocomplete" | "spellcheck">>

TimeData

TimeData: number | string | Date

TypeKeys

TypeKeys<T, D>: { [ K in keyof T]: T[K] extends D ? K : never }[keyof T]

Type parameters

  • T

  • D

Variables

Day

Day: number = ...

Hour

Hour: number = ...

ISODatePattern

ISODatePattern: RegExp = ...

Minute

Minute: number = ...

Month

Month: number = ...

Quarter

Quarter: number = ...

Season

Season: number = ...

Second

Second: 1000 = 1000

Week

Week: number = ...

Year

Year: number = ...

Functions

animateIn

animateOut

asyncLoop

  • asyncLoop(executor: (...data: any[]) => any, seconds?: number): () => boolean
  • Parameters

    • executor: (...data: any[]) => any
        • (...data: any[]): any
        • Parameters

          • Rest ...data: any[]

          Returns any

    • seconds: number = 1

    Returns () => boolean

      • (): boolean
      • Returns boolean

averageOf

  • averageOf(...data: number[]): number
  • Parameters

    • Rest ...data: number[]

    Returns number

blobFrom

  • blobFrom(URI: string): Blob

bootI18n

  • bootI18n<T>(data: Record<string, T>, fallback?: string): { language: string; words: T }
  • Type parameters

    • T: Record<string, string>

    Parameters

    • data: Record<string, T>
    • fallback: string = ...

    Returns { language: string; words: T }

    • language: string
    • words: T

buildURLData

  • buildURLData(map: string[][] | Record<string, any>): URLSearchParams
  • Parameters

    • map: string[][] | Record<string, any>

    Returns URLSearchParams

byteLength

  • byteLength(raw: string): number
  • Parameters

    • raw: string

    Returns number

carryFloat

  • carryFloat(raw: number, length: number): string
  • Parameters

    • raw: number
    • length: number

    Returns string

changeMonth

createMessageClient

  • createMessageClient(target: Window | Worker, origin?: string): (type: string, data?: any) => Promise<unknown>
  • Parameters

    Returns (type: string, data?: any) => Promise<unknown>

      • (type: string, data?: any): Promise<unknown>
      • Parameters

        • type: string
        • Optional data: any

        Returns Promise<unknown>

createMessageServer

  • createMessageServer(handlers: Record<string, (data: any) => any>): () => void
  • Parameters

    • handlers: Record<string, (data: any) => any>

    Returns () => void

      • (): void
      • Returns void

diffTime

  • diffTime(end: TimeData, start?: TimeData, map?: Map<string, number>): { distance: number; unit: string }
  • Parameters

    Returns { distance: number; unit: string }

    • distance: number
    • unit: string

differ

  • differ<T>(target: Record<string, T>, source: Record<string, T>): Record<string, T>
  • Type parameters

    • T

    Parameters

    • target: Record<string, T>
    • source: Record<string, T>

    Returns Record<string, T>

durationOf

fixFloat

  • fixFloat(raw: number, length?: number): string
  • Parameters

    • raw: number
    • length: number = 2

    Returns string

formToJSON

formatDate

  • formatDate(time?: TimeData, template?: string): string
  • Parameters

    • time: TimeData = ...
    • template: string = 'YYYY-MM-DD HH:mm:ss'

    Returns string

getSwipeVector

getVisibleText

  • getVisibleText(root: Element): string

groupBy

hypotenuseOf

  • hypotenuseOf(...data: number[]): number
  • Parameters

    • Rest ...data: number[]

    Returns number

importCSS

insertToCursor

  • insertToCursor(...nodes: Node[]): void

isEmpty

  • isEmpty(value: any): boolean
  • Parameters

    • value: any

    Returns boolean

isNumberLetter

  • isNumberLetter(raw?: string): boolean
  • Parameters

    • raw: string = ''

    Returns boolean

isXDomain

  • isXDomain(URI: string): boolean
  • Parameters

    • URI: string

    Returns boolean

likeArray

  • likeArray(data: any): data is ArrayLike<any>
  • Parameters

    • data: any

    Returns data is ArrayLike<any>

makeArray

makeCRC32

  • makeCRC32(raw: string): string

makeSHA

parseDOM

  • parseDOM(HTML: string): ChildNode[]
  • Parameters

    • HTML: string

    Returns ChildNode[]

parseJSON

  • parseJSON(raw: string): any
  • Parameters

    • raw: string

    Returns any

parseTextTable

  • parseTextTable<T>(raw: string, header?: boolean, separator?: string): any[]
  • Type parameters

    • T = {}

    Parameters

    • raw: string
    • Optional header: boolean
    • separator: string = ','

    Returns any[]

parseURLData

  • parseURLData(raw?: string): URLData
  • Parameters

    • raw: string = window.location.search

    Returns URLData

promisify

scrollTo

  • scrollTo(selector: string, root?: Element): void

serviceWorkerUpdate

  • serviceWorkerUpdate(registration: ServiceWorkerRegistration): Promise<ServiceWorker>
  • Parameters

    • registration: ServiceWorkerRegistration

    Returns Promise<ServiceWorker>

sleep

  • sleep(seconds?: number): Promise<unknown>

splitPages

  • splitPages(__namedParameters: HTMLElement, pageHeight?: number, pageWidth?: number): Element[][]
  • Split a DOM tree into Pages like PDF files

    Parameters

    • __namedParameters: HTMLElement
    • pageHeight: number = 841.89

      the default value is A4 paper's height

    • pageWidth: number = 595.28

      the default value is A4 paper's width

    Returns Element[][]

standardDeviationOf

  • standardDeviationOf(data: number[], sample?: boolean): number
  • Parameters

    • data: number[]
    • sample: boolean = false

    Returns number

sum

  • sum(...data: number[]): number
  • Parameters

    • Rest ...data: number[]

    Returns number

textJoin

  • textJoin(...parts: string[]): string
  • Parameters

    • Rest ...parts: string[]

    Returns string

transitIn

transitOut

uniqueID

  • uniqueID(): string

varianceOf

  • varianceOf(data: number[], sample?: boolean): number
  • Parameters

    • data: number[]
    • sample: boolean = false

    Returns number

walkDOM

watchMotion

watchScroll

  • watchScroll(box: HTMLElement, handler: (event: ScrollEvent) => any, depth?: number): { id: string; level: number; text: string }[]

watchVisible

  • watchVisible(root: Element, handler: (visible: boolean) => any): void
  • Parameters

    • root: Element
    • handler: (visible: boolean) => any
        • (visible: boolean): any
        • Parameters

          • visible: boolean

          Returns any

    Returns void

Generated using TypeDoc