Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

febs

Package Overview
Dependencies
Maintainers
3
Versions
206
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

febs - npm Package Compare versions

Comparing version 0.8.53 to 0.8.54

browser/dist/febs-0.8.54/febs.base.js

19

browser/types/index.d.ts

@@ -8,3 +8,3 @@

declare global {
let __debug: boolean;
export let __debug: boolean;

@@ -710,2 +710,7 @@ export function requestAnimationFrame(cb: (tm: number) => void): any;

/**
* @desc: 生成一个uuid (v4 random).
* @return:
*/
function uuid(): string;
/**
* @desc: 计算字符串的crc32值

@@ -1053,13 +1058,1 @@ * @param crc 可以在这个值得基础上继续计算

}
declare global {
export function $(n: any): dom;
export namespace $ {
var fn: any;
function extend(...args: any[]): dom;
function extend(deep: true, ...args: any[]): dom;
}
}

@@ -86,3 +86,3 @@ {

"name": "febs",
"version": "0.8.53"
"version": "0.8.54"
}
// Type definitions for febs
/// <reference types="node" />
/// <reference path="../browser/types/index.d.ts" />
declare global {
const __line: number;
const __column: number;
/**
* @desc: 是否是开发模式.
*/
export let __debug: boolean;
/**
* @desc: 当前所在行.
*/
export const __line: number;
/**
* @desc: 当前所在列
*/
export const __column: number;
}

@@ -446,2 +455,98 @@

//
// date.
export namespace date {
/**
* @desc: 判断是否是有效时间.
*/
function isValidate(date: Date): boolean;
/**
* @desc: 获取时间的string.
* @param localtime: ms.
* @param fmt: 格式化, 默认为 'HH:mm:ss'
* 年(y)、月(M)、日(d)、12小时(h)、24小时(H)、分(m)、秒(s)、周(E)、季度(q)
* 'yyyy-MM-dd hh:mm:ss.S' ==> 2006-07-02 08:09:04.423
* 'yyyy-MM-dd E HH:mm:ss' ==> 2009-03-10 星期二 20:09:04
* 'yyyy-M-d h:m:s.S' ==> 2006-7-2 8:9:4.18
* @param weekFmt: 星期的文字格式, 默认为 {'0':'星期天', '1': '星期一', ..., '6':'星期六'}
* @return: string.
*/
function getTimeString(localtime: number, fmt: string, weekFmt: WeekFmt): string;
/**
* @desc: 获取指定时间距离现在的时间描述.
* 例如, 昨天, 1小时前等.
* @param localtime: ms. 小于当前时间, 大于当前时间将显示为 '刚刚';
* @param strFmt: 需要显示的文字.
* 默认为 {
* now: '刚刚', // 3秒钟以内将显示此信息.
* second: '秒前',
* minute: '分钟前',
* hour: '小时前',
* day_yesterday: '昨天',
* day: '天前',
* month: '个月前', // 6个月内将显示此信息.
* time: 'yyyy-M-d h:m:s' // 超过6个月将使用此格式格式化时间
* }
* @return: string.
*/
function getTimeStringFromNow(localtime: number, strFmt: string): string;
/**
* @desc: getDate('2012-05-09')
* @return: Date.
*/
function getDate(strDate: string): Date
/**
* @desc: getDate2('20120509')
* @return: Date.
*/
function getDate2(strDate: string): Date;
/**
* @desc: 获取时间的协调世界时间 string.
* @param localtime: ms. (本地时间)
* @param fmt: 格式化, 默认为 'HH:mm:ss'
* 年(y)、月(M)、日(d)、12小时(h)、24小时(H)、分(m)、秒(s)、周(E)、季度(q)
* 'yyyy-MM-dd hh:mm:ss.S' ==> 2006-07-02 08:09:04.423
* 'yyyy-MM-dd E HH:mm:ss' ==> 2009-03-10 星期二 20:09:04
* 'yyyy-M-d h:m:s.S' ==> 2006-7-2 8:9:4.18
* @param weekFmt: 星期的文字格式, 默认为 {'0':'星期天', '1': '星期一', ..., '6':'星期六'}
* @return: string.
*/
function getUTCTimeString(localtime: number, fmt: string, weekFmt: WeekFmt): string;
/**
* @desc: 通过世界时间获取date. getDateFromUTC('2012-05-09')
* @param strDateUTC: 世界日期字符串. '2012-05-09'
* @return: Date.
*/
function getDateFromUTC(strDateUTC: string): Date;
/**
* @desc: 通过世界时间获取date. getDate2FromUTC('20120509')
* @param strDateUTC: 世界日期字符串. '20120509'
* @return: Date.
*/
function getDate2FromUTC(strDateUTC: string): Date;
/**
* @desc: 通过世界时间获取date. getTimeFromUTC('2012-05-09 11:10:12')
* @param strTimeUTC: 世界时间字符串. '2012-05-09 11:10:12'
* @return: Date.
*/
function getTimeFromUTC(strTimeUTC: string): Date;
/**
* @desc: 通过世界时间获取date. getTime2FromUTC('20120509111012')
* @param strTimeUTC: 世界日期字符串. '20120509111012'
* @return: Date.
*/
function getTime2FromUTC(strTimeUTC: string): Date;
}
//
// utils.

@@ -589,101 +694,3 @@ export namespace utils {

//
// date.
export namespace date {
/**
* @desc: 判断是否是有效时间.
*/
function isValidate(date: Date): boolean;
/**
* @desc: 获取时间的string.
* @param localtime: ms.
* @param fmt: 格式化, 默认为 'HH:mm:ss'
* 年(y)、月(M)、日(d)、12小时(h)、24小时(H)、分(m)、秒(s)、周(E)、季度(q)
* 'yyyy-MM-dd hh:mm:ss.S' ==> 2006-07-02 08:09:04.423
* 'yyyy-MM-dd E HH:mm:ss' ==> 2009-03-10 星期二 20:09:04
* 'yyyy-M-d h:m:s.S' ==> 2006-7-2 8:9:4.18
* @param weekFmt: 星期的文字格式, 默认为 {'0':'星期天', '1': '星期一', ..., '6':'星期六'}
* @return: string.
*/
function getTimeString(localtime: number, fmt: string, weekFmt: WeekFmt): string;
/**
* @desc: 获取指定时间距离现在的时间描述.
* 例如, 昨天, 1小时前等.
* @param localtime: ms. 小于当前时间, 大于当前时间将显示为 '刚刚';
* @param strFmt: 需要显示的文字.
* 默认为 {
* now: '刚刚', // 3秒钟以内将显示此信息.
* second: '秒前',
* minute: '分钟前',
* hour: '小时前',
* day_yesterday: '昨天',
* day: '天前',
* month: '个月前', // 6个月内将显示此信息.
* time: 'yyyy-M-d h:m:s' // 超过6个月将使用此格式格式化时间
* }
* @return: string.
*/
function getTimeStringFromNow(localtime: number, strFmt: string): string;
/**
* @desc: getDate('2012-05-09')
* @return: Date.
*/
function getDate(strDate: string): Date
/**
* @desc: getDate2('20120509')
* @return: Date.
*/
function getDate2(strDate: string): Date;
/**
* @desc: 获取时间的协调世界时间 string.
* @param localtime: ms. (本地时间)
* @param fmt: 格式化, 默认为 'HH:mm:ss'
* 年(y)、月(M)、日(d)、12小时(h)、24小时(H)、分(m)、秒(s)、周(E)、季度(q)
* 'yyyy-MM-dd hh:mm:ss.S' ==> 2006-07-02 08:09:04.423
* 'yyyy-MM-dd E HH:mm:ss' ==> 2009-03-10 星期二 20:09:04
* 'yyyy-M-d h:m:s.S' ==> 2006-7-2 8:9:4.18
* @param weekFmt: 星期的文字格式, 默认为 {'0':'星期天', '1': '星期一', ..., '6':'星期六'}
* @return: string.
*/
function getUTCTimeString(localtime: number, fmt: string, weekFmt: WeekFmt): string;
/**
* @desc: 通过世界时间获取date. getDateFromUTC('2012-05-09')
* @param strDateUTC: 世界日期字符串. '2012-05-09'
* @return: Date.
*/
function getDateFromUTC(strDateUTC: string): Date;
/**
* @desc: 通过世界时间获取date. getDate2FromUTC('20120509')
* @param strDateUTC: 世界日期字符串. '20120509'
* @return: Date.
*/
function getDate2FromUTC(strDateUTC: string): Date;
/**
* @desc: 通过世界时间获取date. getTimeFromUTC('2012-05-09 11:10:12')
* @param strTimeUTC: 世界时间字符串. '2012-05-09 11:10:12'
* @return: Date.
*/
function getTimeFromUTC(strTimeUTC: string): Date;
/**
* @desc: 通过世界时间获取date. getTime2FromUTC('20120509111012')
* @param strTimeUTC: 世界日期字符串. '20120509111012'
* @return: Date.
*/
function getTime2FromUTC(strTimeUTC: string): Date;
}
//
// string.

@@ -870,2 +877,9 @@ export namespace string {

/**
* @desc: [only in browser] 使用jquery.ajax类似参数调用.
* @param cfg: 允许额外传递一个 progress:function(percent) {} 的参数来获取进度.
* @return:
*/
function ajax(cfg: any): { abort: () => void }
/**
* @desc: [only in browser] jsonp方式获取数据.

@@ -1067,2 +1081,230 @@ * 如果超時, 可以catch到 'timeout'

const OUT_OF_RANGE: string;
}
}
export type SELECTOR = any; /*string|dom|HTMLElement; */
/**
* @desc: [only browser]
*/
export class dom {
/**
* 支持
* - .name 使用类名构建.
* - #name 使用id名构建.
* - name 使用tag名构建.
* - <div...>...</div> 使用内容构建.
* - node.
* 不支持带空格多层结构的情况.
*/
constructor(selector?: SELECTOR);
get(index: number): any;
/**
* @desc: hasClass
*/
hasClass(cName: string): boolean;
/**
* @desc: addClass
*/
addClass(cName: string): dom;
/**
* @desc: removeClass
*/
removeClass(cName: string): dom;
/**
* @desc: toggleClass
*/
toggleClass(cName: string): dom;
/**
* @desc: remove
*/
remove(): void;
/**
* @desc: append
*/
append(selector?: SELECTOR): dom;
/**
* appendTo
*/
appendTo(selector?: SELECTOR): dom;
/**
* @desc: prepend
*/
prepend(selector?: SELECTOR): dom;
/**
* @desc: prependTo
*/
prependTo(selector?: SELECTOR): dom;
/**
* @desc: before
*/
before(selector?: SELECTOR): dom;
/**
* insertBefore
*/
insertBefore(selector?: SELECTOR): dom;
/**
* @desc: after
*/
after(selector?: SELECTOR): dom;
/**
* @desc: insertAfter
*/
insertAfter(selector?: SELECTOR): dom;
/**
* @desc: attr.
*/
attr(attrName: any, value: any): string;
/**
* @desc: removeAttr
*/
removeAttr(name: any): dom;
/**
* @desc: empty.
*/
empty(): dom;
/**
* @desc: html.
*/
html(v: string): string;
/**
* @desc: text.
*/
text(v: string): string;
/**
* @desc: val.
*/
val(v: string): string;
/**
* @desc: css.
*/
css(name: string, value: string): string;
/**
* html.
*/
parent(selector?: SELECTOR): dom;
parents(selector?: SELECTOR): dom;
children(selector?: SELECTOR): dom;
prev(selector?: SELECTOR): dom;
next(selector?: SELECTOR): dom;
/**
* @desc: on.
*/
on(eventname: string, foo: any): dom;
bind(eventname: string, foo: any): dom;
live(eventname: string, foo: any): dom;
/**
* @desc: off.
*/
off(eventname: string, foo?: any): dom;
unbind(eventname: string, foo?: any): dom;
die(eventname: string, foo?: any): dom;
/**
* @desc: one.
*/
one(event: string, f: any): dom;
/**
* @desc: trigger.
*/
trigger(eventname: string, extraParameters?: any): dom;
ready(f?: any): dom;
unload(f?: any): dom;
blur(f?: any): dom;
change(f?: any): dom;
click(f?: any): dom;
dblclick(f?: any): dom;
error(f?: any): dom;
keydown(f?: any): dom;
keypress(f?: any): dom;
keyup(f?: any): dom;
load(f?: any): dom;
mousedown(f?: any): dom;
mouseenter(f?: any): dom;
mouseleave(f?: any): dom;
mousemove(f?: any): dom;
mouseout(f?: any): dom;
mouseover(f?: any): dom;
mouseup(f?: any): dom;
scroll(f?: any): dom;
select(f?: any): dom;
submit(f?: any): dom;
[index: number]: dom;
}
/**
* @desc: [only browser]
*/
export namespace dom {
/**
* @desc: 获得视口大小.
* @return: {width, height}
*/
function getViewPort(): { width: number, height: number };
/**
* @desc: 获得文档大小.
* @return: {width, height}
*/
function getDocumentPort(): { width: number, height: number };
/**
* @desc: 获得document scroll offset.
* @return: {top, left}
*/
function getDocumentOffset(): { top: number, left: number };
/**
* @desc: 获取指定元素相对于视口的的offset
* @return:
*/
function getElementOffset(e: any): { left: number, top: number };
/**
* @desc: 判断是否是dom对象.
* @return: boolean.
*/
function isDom(e: any): boolean;
/**
* @desc: 统一处理 addEventListener, attachEvent; 并提供useCapture参数问题.
*/
function addEventListener(domElement:any, event:string, func:any, useCapture?:boolean):null;
/**
* @desc: 统一处理 removeEventListener, detachEvent; 并提供useCapture参数问题.
*/
function removeEventListener(domElement:any, event:string, func:any, useCapture?:boolean):null;
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc