代码拉取完成,页面将自动刷新
declare interface Formatter {
/**
* retrieve formatter function by name
*/
[formatterName: string]: (...args) => this;
/**
* built-in format method:
* convert the current value to date and apply
*
* @param {string} [formatMask] default is 'default'
* @param {boolean} [utc] default is false
* @returns {this}
*
* @memberOf Formatter
*/
date(formatMask?: string, utc?: boolean): this;
/**
* built-in format method:
* convert current value to number
*
* @param {Number} [fractionSize] default = 2
* @returns {this}
*
* @memberOf Formatter
*/
number(fractionSize?: Number): this;
/**
* built-in format method:
* format number in K,M,G
* eg 1024 * 100 to 100K
*
* @returns {this}
*
* @memberOf Formatter
*/
bytes(fractionSize?: Number): this;
/**
* built-in format method:
* convert current value to json string
*
* @memberOf Formatter
*/
json(): this;
/**
* the original value passed in
*
* @type {any}
* @memberOf Formatter
*/
value: any;
/**
* current evaluated value of the formatter
*
* @returns {any}
*
* @memberOf Formatter
*/
current: any;
/**
* convert the current evaluated value to string
*
* @memberOf Formatter
*/
toString();
}
/**
* mixin riot-format, so you can use it globally in riot
*
* usage:
* import riot from 'riot';
* import format from 'riot-format';
* format(riot);
* //then you can use it in riot
* @param {Object} riot riot module object
*/
declare function use(riot: any): void;
declare namespace use {
/**
* deprecated; use extend() instead; will remove in future
* @deprecated
*/
export var define: typeof extend;
export function extend(formatters: { [name: string]: (input, ...args) => any }): void;
export function extend(formatterName: string, formatterDefinition: (input, ...args) => any): void;
export function format(input: any, formatterName?: string, ...addtionalArgs): Formatter;
namespace format{
/**
* options
*/
export var opts: {
/**
* 0 - log error in console;
* 1 - throw error;
* 2 - sliently swallow;
*/
errorBehavior: 0,
/**
* represents that error occurs when evaluted formatters
*/
errorText: '!ERR!'
}
}
}
declare module 'riot-format'{
export default use;
export var format: typeof use.format;
export var extend: typeof use.extend;
export var version: string;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。