alan
5 years ago
8 changed files with 166 additions and 41 deletions
@ -0,0 +1,108 @@
|
||||
export declare type _Date = { |
||||
SECOND: number; |
||||
MINUTE: number; |
||||
HOUR: number; |
||||
DAY: number; |
||||
WEEK: number; |
||||
_DN: string[]; |
||||
_SDN: string[]; |
||||
_FD: number; |
||||
_MN: string[]; |
||||
_SMN: number[]; |
||||
_QN: string[]; |
||||
_MD: number[]; |
||||
_OFFSET: number[]; |
||||
} |
||||
/** |
||||
* 获取时区 |
||||
*/ |
||||
export declare type _getTimezone = (date: Date) => string; |
||||
|
||||
/** |
||||
* 获取指定月共有多少天 |
||||
*/ |
||||
export declare type _getMonthDays = (date: Date, month: number) => string; |
||||
|
||||
/** |
||||
* 获取指定月的最后一天 |
||||
*/ |
||||
export declare type _getLastDateOfMonth = (data: Date) => Date; |
||||
|
||||
/** |
||||
* 获取指定时间距离当年已经过了多少天 |
||||
*/ |
||||
export declare type _getDayOfYear = (data: Date) => number; |
||||
|
||||
/** |
||||
* 获取指定时间距离当年已经过了多少周 |
||||
*/ |
||||
export declare type _getWeekNumber = (data: Date) => number; |
||||
|
||||
/** |
||||
* 获取指定时间的所处季度 |
||||
*/ |
||||
export declare type _getQuarter = (date: Date) => number; |
||||
|
||||
/** |
||||
* 离当前时间多少天的时间 |
||||
*/ |
||||
export declare type _getOffsetDate = (date: Date, offset: number) => Date; |
||||
|
||||
/** |
||||
* 离当前时间多少天季度的时间 |
||||
*/ |
||||
export declare type _getOffsetQuarter = (date: Date, n: number) => Date; |
||||
|
||||
/** |
||||
* 得到本季度的起始月份 |
||||
*/ |
||||
export declare type _getQuarterStartMonth = (date: Date) => number; |
||||
|
||||
/** |
||||
* 获得本季度的起始日期 |
||||
*/ |
||||
export declare type _getQuarterStartDate = (date: Date) => number; |
||||
|
||||
/** |
||||
* 获取本季度的其实日期 |
||||
*/ |
||||
export declare type _getQuarterEndDate = (date: Date) => number; |
||||
|
||||
/** |
||||
* 指定日期n个月之前或之后的日期 |
||||
*/ |
||||
export declare type _getOffsetMonth = (date: Date, n: number) => Date; |
||||
|
||||
/** |
||||
* 获取本周的起始日期 |
||||
*/ |
||||
export declare type _getWeekStartDate = (date: Date) => Date; |
||||
|
||||
/** |
||||
* 获取本周的结束日期 |
||||
*/ |
||||
export declare type _getWeekEndDate = (date: Date) => Date; |
||||
|
||||
/** |
||||
* 格式化打印日期 |
||||
*/ |
||||
export declare type _print = (date: Date, str: string) => string; |
||||
|
||||
declare type _date = { |
||||
getTimezone: _getTimezone; |
||||
getMonthDays: _getMonthDays; |
||||
getLastDateOfMonth: _getLastDateOfMonth; |
||||
getDayOfYear: _getDayOfYear; |
||||
getWeekNumber: _getWeekNumber; |
||||
getQuarter: _getQuarter; |
||||
getOffsetDate: _getOffsetDate; |
||||
getOffsetQuarter: _getOffsetQuarter; |
||||
getQuarterStartMonth: _getQuarterStartMonth; |
||||
getQuarterStartDate: _getQuarterStartDate; |
||||
getQuarterEndDate: _getQuarterEndDate; |
||||
getOffsetMonth: _getOffsetMonth; |
||||
getWeekStartDate: _getWeekStartDate; |
||||
getWeekEndDate: _getWeekEndDate; |
||||
print: _print; |
||||
} |
||||
export default _date; |
@ -0,0 +1,10 @@
|
||||
import _array from "./array"; |
||||
import _string from "./string"; |
||||
import _number from "./number"; |
||||
import _function from "./function"; |
||||
import _date, {_Date} from "./date"; |
||||
|
||||
interface _func extends _array, _string, _number, _function { |
||||
Date: _Date; |
||||
} |
||||
export default _func; |
@ -1,3 +1,8 @@
|
||||
export declare type _addI18n = (v: string) => string; |
||||
|
||||
export declare type _i18nText = (key: string) => string; |
||||
|
||||
export declare type _i18n = { |
||||
addI18n: _addI18n; |
||||
i18nText: _i18nText; |
||||
} |
@ -1,40 +1,8 @@
|
||||
import { _addI18n, _i18nText } from "./core/i18n"; |
||||
import { _i18n } from "./core/i18n"; |
||||
import { _OB } from "./core/ob"; |
||||
import { _pushArray, _pushDistinct, _pushDistinctArray} from "./core/func/array"; |
||||
import {_startWith, _allIndexOf, _appendQuery, _endWith, _getQuery, _perfectStart, _replaceAll} from "./core/func/string"; |
||||
import {_add, _sub, _mul, _div} from "./core/func/number"; |
||||
import {_afterFunc, _beforeFunc, _createDistinctName, _getSearchResult} from "./core/func/function"; |
||||
import _func from "./core/func"; |
||||
|
||||
export declare module BI { |
||||
namespace i18n { |
||||
const addI18n: _addI18n; |
||||
const i18nText: _i18nText; |
||||
} |
||||
|
||||
const OB: _OB; |
||||
|
||||
const pushArray: _pushArray; |
||||
const pushDistinct: _pushDistinct; |
||||
const pushDistinctArray: _pushDistinctArray; |
||||
|
||||
const startWith: _startWith; |
||||
const endWith: _endWith; |
||||
const getQuery: _getQuery; |
||||
const appendQuery: _appendQuery; |
||||
const replaceAll: _replaceAll; |
||||
const perfectStart: _perfectStart; |
||||
const allIndexOf: _allIndexOf; |
||||
|
||||
const add: _add; |
||||
const sub: _sub; |
||||
const mul: _mul; |
||||
const div: _div; |
||||
|
||||
const afterFunc: _afterFunc; |
||||
const beforeFunc: _beforeFunc; |
||||
|
||||
namespace Func { |
||||
const createDistinctName: _createDistinctName; |
||||
const getSearchResult: _getSearchResult; |
||||
} |
||||
} |
||||
export interface BI extends _func { |
||||
i18n: _i18n; |
||||
OB: _OB; |
||||
} |
Loading…
Reference in new issue