Browse Source

refactor: 去掉declear

es6
iapyang 5 years ago
parent
commit
4c5cfd49fa
  1. 6
      typescript/core/func/array.ts
  2. 34
      typescript/core/func/date.ts
  3. 8
      typescript/core/func/function.ts
  4. 8
      typescript/core/func/number.ts
  5. 14
      typescript/core/func/string.ts
  6. 6
      typescript/core/i18n.ts

6
typescript/core/func/array.ts

@ -1,8 +1,8 @@
export declare type _pushArray = (sArray: any[], array: any[]) => void; export type _pushArray = (sArray: any[], array: any[]) => void;
export declare type _pushDistinct = (sArray: any[], obj: any) => void; export type _pushDistinct = (sArray: any[], obj: any) => void;
export declare type _pushDistinctArray = (sArray: any[], array: any[]) => void; export type _pushDistinctArray = (sArray: any[], array: any[]) => void;
declare type _array = { declare type _array = {
pushArray: _pushArray; pushArray: _pushArray;

34
typescript/core/func/date.ts

@ -1,4 +1,4 @@
export declare type _Date = { export type _Date = {
SECOND: number; SECOND: number;
MINUTE: number; MINUTE: number;
HOUR: number; HOUR: number;
@ -16,79 +16,79 @@ export declare type _Date = {
/** /**
* *
*/ */
export declare type _getTimezone = (date: Date) => string; export type _getTimezone = (date: Date) => string;
/** /**
* *
*/ */
export declare type _getMonthDays = (date: Date, month: number) => string; export type _getMonthDays = (date: Date, month: number) => string;
/** /**
* *
*/ */
export declare type _getLastDateOfMonth = (data: Date) => Date; export type _getLastDateOfMonth = (data: Date) => Date;
/** /**
* *
*/ */
export declare type _getDayOfYear = (data: Date) => number; export type _getDayOfYear = (data: Date) => number;
/** /**
* *
*/ */
export declare type _getWeekNumber = (data: Date) => number; export type _getWeekNumber = (data: Date) => number;
/** /**
* *
*/ */
export declare type _getQuarter = (date: Date) => number; export type _getQuarter = (date: Date) => number;
/** /**
* *
*/ */
export declare type _getOffsetDate = (date: Date, offset: number) => Date; export type _getOffsetDate = (date: Date, offset: number) => Date;
/** /**
* *
*/ */
export declare type _getOffsetQuarter = (date: Date, n: number) => Date; export type _getOffsetQuarter = (date: Date, n: number) => Date;
/** /**
* *
*/ */
export declare type _getQuarterStartMonth = (date: Date) => number; export type _getQuarterStartMonth = (date: Date) => number;
/** /**
* *
*/ */
export declare type _getQuarterStartDate = (date: Date) => number; export type _getQuarterStartDate = (date: Date) => number;
/** /**
* *
*/ */
export declare type _getQuarterEndDate = (date: Date) => number; export type _getQuarterEndDate = (date: Date) => number;
/** /**
* n个月之前或之后的日期 * n个月之前或之后的日期
*/ */
export declare type _getOffsetMonth = (date: Date, n: number) => Date; export type _getOffsetMonth = (date: Date, n: number) => Date;
/** /**
* *
*/ */
export declare type _getWeekStartDate = (date: Date) => Date; export type _getWeekStartDate = (date: Date) => Date;
/** /**
* *
*/ */
export declare type _getWeekEndDate = (date: Date) => Date; export type _getWeekEndDate = (date: Date) => Date;
/** /**
* *
*/ */
export declare type _print = (date: Date, str: string) => string; export type _print = (date: Date, str: string) => string;
export declare type _date = { export type _date = {
getTimezone: _getTimezone; getTimezone: _getTimezone;
getMonthDays: _getMonthDays; getMonthDays: _getMonthDays;
getLastDateOfMonth: _getLastDateOfMonth; getLastDateOfMonth: _getLastDateOfMonth;

8
typescript/core/func/function.ts

@ -4,7 +4,7 @@
* @param name * @param name
* @return * @return
*/ */
export declare type _createDistinctName = (array: any[], name: string) => string; export type _createDistinctName = (array: any[], name: string) => string;
/** /**
* *
@ -12,21 +12,21 @@ export declare type _createDistinctName = (array: any[], name: string) => string
* @param keyword * @param keyword
* @param param * @param param
*/ */
export declare type _getSearchResult = (items: any, keyword: any, param: string) => {find: any, match: any} export type _getSearchResult = (items: any, keyword: any, param: string) => {find: any, match: any}
/** /**
* A执行之前执行方法B * A执行之前执行方法B
* @param sFunc A * @param sFunc A
* @param func B * @param func B
*/ */
export declare type _beforeFunc = (sFunc: Function, func: Function) => Function; export type _beforeFunc = (sFunc: Function, func: Function) => Function;
/** /**
* A执行之后执行方法B * A执行之后执行方法B
* @param sFunc A * @param sFunc A
* @param func B * @param func B
*/ */
export declare type _afterFunc = (sFunc: Function, func: Function) => Function; export type _afterFunc = (sFunc: Function, func: Function) => Function;
declare type _function = { declare type _function = {
createDistinctName: _createDistinctName; createDistinctName: _createDistinctName;

8
typescript/core/func/number.ts

@ -5,7 +5,7 @@
* @param {Number} arg * @param {Number} arg
* @return {Number} * @return {Number}
*/ */
export declare type _add = (num: number, arg: number) => number; export type _add = (num: number, arg: number) => number;
/** /**
* *
@ -13,7 +13,7 @@ export declare type _add = (num: number, arg: number) => number;
* @param {Number} arg * @param {Number} arg
* @return {Number} * @return {Number}
*/ */
export declare type _sub = (num: number, arg: number) => number; export type _sub = (num: number, arg: number) => number;
/** /**
* *
@ -21,7 +21,7 @@ export declare type _sub = (num: number, arg: number) => number;
* @param {Number} arg * @param {Number} arg
* @return {Number} * @return {Number}
*/ */
export declare type _mul = (num: number, arg: number) => number; export type _mul = (num: number, arg: number) => number;
/** /**
* *
@ -29,7 +29,7 @@ export declare type _mul = (num: number, arg: number) => number;
* @param {Number} arg * @param {Number} arg
* @return {Number} * @return {Number}
*/ */
export declare type _div = (num: number, arg: number) => number; export type _div = (num: number, arg: number) => number;
declare type _number = { declare type _number = {
add: _add; add: _add;

14
typescript/core/func/string.ts

@ -4,7 +4,7 @@
* @param {String} startTag * @param {String} startTag
* @return {Boolean} truefalse * @return {Boolean} truefalse
*/ */
export declare type _startWith = (str: string, startTag: string) => boolean; export type _startWith = (str: string, startTag: string) => boolean;
/** /**
* *
@ -12,7 +12,7 @@ export declare type _startWith = (str: string, startTag: string) => boolean;
* @param {String} endTag * @param {String} endTag
* @return {Boolean} truefalse * @return {Boolean} truefalse
*/ */
export declare type _endWith = (str: string, endTag: string) => boolean; export type _endWith = (str: string, endTag: string) => boolean;
/** /**
* url中指定名字的参数 * url中指定名字的参数
@ -20,7 +20,7 @@ export declare type _endWith = (str: string, endTag: string) => boolean;
* @param {String} name * @param {String} name
* @return {String} * @return {String}
*/ */
export declare type _getQuery = (str: string, name: string) => string|null; export type _getQuery = (str: string, name: string) => string|null;
/** /**
* url加上给定的参数 * url加上给定的参数
@ -28,7 +28,7 @@ export declare type _getQuery = (str: string, name: string) => string|null;
* @param {Object} paras * @param {Object} paras
* @return {String} url * @return {String} url
*/ */
export declare type _appendQuery = (str: string, paras: {[key: string]: string|number}) => string; export type _appendQuery = (str: string, paras: {[key: string]: string|number}) => string;
/** /**
* *
@ -37,7 +37,7 @@ export declare type _appendQuery = (str: string, paras: {[key: string]: string|n
* @param {String} s2 * @param {String} s2
* @returns {String} * @returns {String}
*/ */
export declare type _replaceAll = (str: string, s1: string, s2: string) => string; export type _replaceAll = (str: string, s1: string, s2: string) => string;
/** /**
* *
@ -45,7 +45,7 @@ export declare type _replaceAll = (str: string, s1: string, s2: string) => strin
* @param {String} start * @param {String} start
* @returns {String} * @returns {String}
*/ */
export declare type _perfectStart = (str: string, start: string) => string; export type _perfectStart = (str: string, start: string) => string;
/** /**
* *
@ -53,7 +53,7 @@ export declare type _perfectStart = (str: string, start: string) => string;
* @param {String} sub * @param {String} sub
* @return {Number[]} * @return {Number[]}
*/ */
export declare type _allIndexOf = (str: string, sub: string) => number[]; export type _allIndexOf = (str: string, sub: string) => number[];
declare type _string = { declare type _string = {
startWith: _startWith; startWith: _startWith;

6
typescript/core/i18n.ts

@ -1,8 +1,8 @@
export declare type _addI18n = (v: string | object) => string; export type _addI18n = (v: string | object) => string;
export declare type _i18nText = (key: string, ..._args: any[]) => string; export type _i18nText = (key: string, ..._args: any[]) => string;
export declare type _i18n = { export type _i18n = {
addI18n: _addI18n; addI18n: _addI18n;
i18nText: _i18nText; i18nText: _i18nText;
} }
Loading…
Cancel
Save