@icreate/core
TypeScript icon, indicating that this package has built-in type declarations

0.0.26 • Public • Published

Usage

npm i @icreate/core

Features

  • Event:事件总线
  • BlockUI:加载等待UI
  • Logger:console.log封装
  • Utils:工具类
  • ics:ics对象

Importing library

You can import the generated bundle to use the whole library generated by this starter:

import { ics, Event, BlockUI, Logger, Utils, LogLevels, ExecOptons, UIOptions } from '@icreate/core'

Event

  $on(eventName: string, callback: Function): void
  $off(eventName: string, callback: Function): void
  $emit(eventName: string): void

BlockUI

  block(opts: UIOptions): void
  unblock(opts: UIOptions): void
  setBusy(opts: UIOptions): void
  clearBusy(opts: UIOptions): void

Logger

  level: LogLevels
  debug(logObject: any): void
  info(logObject: any): void
  warn(logObject: any): void
  error(logObject: any): void
  fatal(logObject: any): void

Utils

  createNamespace(root: any, ns: string): object
  replaceAll(str: string, search: string, replacement: string): string
  formatString(): string | null
  toPascalCase(str: string): string
  toCamelCase(str: string): string
  truncateString(str: string, maxLength: number): string
  truncateStringWithPostfix(str: string, maxLength: number, postfix: string): string
  isFunction(obj: any): boolean
  buildQueryString(key: string, value: string, expireDate: Date, path: string): void
  getCookieValue(key: string): string | null
  deleteCookie(key: string, path: string): void
  htmlEscape(html: string): string
  extend(dstObj: object, srcObj: object): object
  command(opts: ExecOptons): void
  function(opts: ExecOptons): Promise<any> 
  getFirstSpell(str: string): string | string[]
  getFullSpell(str: string) : string
  getStrokeCode(str: string): string

Readme

Keywords

none

Package Sidebar

Install

npm i @icreate/core

Weekly Downloads

124

Version

0.0.26

License

MIT

Unpacked Size

800 kB

Total Files

31

Last publish

Collaborators

  • xyzhang59
  • liqing1014
  • zhangmenglei
  • zer001
  • jiangbing
  • zhu_enrui
  • flown
  • liuzk
  • hanmeng_mon
  • yujian01
  • z5y
  • dingwei1
  • restlife1994
  • c_zhu
  • wenbei