Skip to content

Commit

Permalink
fix: d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
undefined committed Dec 2, 2021
1 parent 0ec03c0 commit 21063f1
Show file tree
Hide file tree
Showing 19 changed files with 324 additions and 276 deletions.
4 changes: 2 additions & 2 deletions dist/funclib-mp.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* @license
* Funclib v6.0.5 <https://www.funclib.net>
* Funclib v6.0.6 <https://www.funclib.net>
* GitHub Repository <https://github.com/CN-Tower/funclib.js>
* Released under MIT license <https://github.com/CN-Tower/funclib.js/blob/master/LICENSE>
*/
; (function () {

var version = '6.0.5';
var version = '6.0.6';

var undefined, UDF = undefined, F = function() {}
, _global = typeof global == 'object' && global && global.Object === Object && global
Expand Down
4 changes: 2 additions & 2 deletions dist/funclib.core.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* @license
* Funclib v6.0.5 <https://www.funclib.net>
* Funclib v6.0.6 <https://www.funclib.net>
* GitHub Repository <https://github.com/CN-Tower/funclib.js>
* Released under MIT license <https://github.com/CN-Tower/funclib.js/blob/master/LICENSE>
*/
; (function () {

var version = '6.0.5';
var version = '6.0.6';

var undefined, UDF = undefined, F = function() {}
, _global = typeof global == 'object' && global && global.Object === Object && global
Expand Down
4 changes: 2 additions & 2 deletions dist/funclib.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* @license
* Funclib v6.0.5 <https://www.funclib.net>
* Funclib v6.0.6 <https://www.funclib.net>
* GitHub Repository <https://github.com/CN-Tower/funclib.js>
* Released under MIT license <https://github.com/CN-Tower/funclib.js/blob/master/LICENSE>
*/
; (function () {

var version = '6.0.5';
var version = '6.0.6';

var undefined, UDF = undefined, F = function() {}
, _global = typeof global == 'object' && global && global.Object === Object && global
Expand Down
4 changes: 2 additions & 2 deletions dist/funclib.min.js

Large diffs are not rendered by default.

182 changes: 99 additions & 83 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* Funclib v6.0.5 <https://www.funclib.net>
* Funclib v6.0.6 <https://www.funclib.net>
* GitHub Repository <https://github.com/CN-Tower/funclib.js>
* Released under MIT license <https://github.com/CN-Tower/funclib.js/blob/master/LICENSE>
*/
Expand Down Expand Up @@ -117,88 +117,6 @@ declare var fn: fn.Funclib;

declare namespace fn {

type Any = any;

type Type = 'arr' | 'obj' | 'fun'
| 'str' | 'num' | 'bol' | 'udf'
| 'nul' | 'err' | 'reg' | 'dat'
| string | string[];

type Color = 'grey' | 'blue' | 'cyan'
| 'green' | 'magenta' | 'red' | 'yellow';

type Pattern = 'cnChar' | 'dbChar' | 'email'
| 'phone' | 'telephone' | 'idCard' | 'uuid'
| 'base64Code' | 'domain' | 'port' | 'ip'
| 'ipUrl' | 'domainUrl' | 'url' | string;

/**
* [fn.progress] 进度显示工具
* @param title: string
* @param options: object [?]
* title: string
* width: number = 40
* type : 'bar'|'spi' = 'bar'
* isClear : boolean = false
* isBreak : boolean = true
*/
interface Progress {

(title: string, options?: { title?: string, width?: number, type?: 'bar' | 'spi', isClear: boolean, isBreak: boolean }): void;

/**
* [fn.progress.start] 暂停进度
*/
pause(): void;

/**
* [fn.progress.start] 开始进度
*/
start(): void;

/**
* [fn.progress.stop] 结束进度条,结束后触发回调
* @param onStopped : function [?]
*/
stop(onStopped?: Function): void;

/**
* [fn.progress.stop] 立即结束进度条,并触发回调
* @param onStopped : function [?]
*/
clear(onStopped?: Function): void;
}

interface Timer extends Any {
/**
* 定时器ID
*/
id: any;

/**
* 关闭定时器
*/
stop: () => any;

/**
* 关闭定时器
*/
clear: () => any;
}

interface LogConfig {
title?: string,
width?: number,
pre?: boolean,
end?: boolean,
breakPre: boolean,
breakEnd: boolean,
isFmt?: boolean,
isShowTime?: boolean,
color?: 'grey' | 'blue' | 'cyan' | 'green' | 'magenta' | 'red' | 'yellow',
ttColor?: 'grey' | 'blue' | 'cyan' | 'green' | 'magenta' | 'red' | 'yellow',
}

interface Funclib extends Any {

/**
Expand Down Expand Up @@ -849,4 +767,102 @@ declare namespace fn {
*/
noConflict(): void;
}

type Any = any;

/**
* 变量类型
*/
type Type = 'arr' | 'obj' | 'fun'
| 'str' | 'num' | 'bol' | 'udf'
| 'nul' | 'err' | 'reg' | 'dat'
| string | string[];

/**
* 颜色类型
*/
type Color = 'grey' | 'blue' | 'cyan'
| 'green' | 'magenta' | 'red' | 'yellow';

/**
* 正则类型
*/
type Pattern = 'cnChar' | 'dbChar' | 'email'
| 'phone' | 'telephone' | 'idCard' | 'uuid'
| 'base64Code' | 'domain' | 'port' | 'ip'
| 'ipUrl' | 'domainUrl' | 'url' | string;

/**
* [fn.progress] 进度显示工具
* @param title: string
* @param options: object [?]
* title: string
* width: number = 40
* type : 'bar'|'spi' = 'bar'
* isClear : boolean = false
* isBreak : boolean = true
*/
interface Progress {

(options: { title?: string, width?: number, type?: 'bar' | 'spi', isClear?: boolean, isBreak?: boolean }): void;
(title: string, options?: { width?: number, type?: 'bar' | 'spi', isClear?: boolean, isBreak?: boolean }): void;

/**
* [fn.progress.start] 暂停进度
*/
pause(): void;

/**
* [fn.progress.start] 开始进度
*/
start(): void;

/**
* [fn.progress.stop] 结束进度条,结束后触发回调
* @param onStopped : function [?]
*/
stop(onStopped?: Function): void;

/**
* [fn.progress.stop] 立即结束进度条,并触发回调
* @param onStopped : function [?]
*/
clear(onStopped?: Function): void;
}

/**
* 定时器
*/
interface Timer extends Any {
/**
* 定时器ID
*/
id: any;

/**
* 关闭定时器
*/
stop: () => any;

/**
* 关闭定时器
*/
clear: () => any;
}

/**
* 打印配置
*/
interface LogConfig {
title?: string,
width?: number,
pre?: boolean,
end?: boolean,
breakPre: boolean,
breakEnd: boolean,
isFmt?: boolean,
isShowTime?: boolean,
color?: 'grey' | 'blue' | 'cyan' | 'green' | 'magenta' | 'red' | 'yellow',
ttColor?: 'grey' | 'blue' | 'cyan' | 'green' | 'magenta' | 'red' | 'yellow',
}
}
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ var ProgressSpi = require('./lib/ProgressSpi');

/**
* @license
* Funclib v6.0.5 <https://www.funclib.net>
* Funclib v6.0.6 <https://www.funclib.net>
* GitHub Repository <https://github.com/CN-Tower/funclib.js>
* Released under MIT license <https://github.com/CN-Tower/funclib.js/blob/master/LICENSE>
*/
; (function () {

var version = '6.0.5';
var version = '6.0.6';

var undefined, UDF = undefined, F = function() {}
, _global = typeof global == 'object' && global && global.Object === Object && global
Expand Down
2 changes: 1 addition & 1 deletion dist/lib/_config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**@config*/

var version = '6.0.5';
var version = '6.0.6';

var undefined, UDF = undefined, F = function() {}
, _global = typeof global == 'object' && global && global.Object === Object && global
Expand Down
2 changes: 1 addition & 1 deletion dist/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "funclib",
"version": "6.0.5",
"version": "6.0.6",
"description": "A powerful javascript functions library!",
"main": "index.js",
"repository": {
Expand Down
Loading

0 comments on commit 21063f1

Please sign in to comment.