W72crm_web-master/node_modules/nzh/nzh.d.ts

75 lines
1.7 KiB
TypeScript
Raw Permalink Normal View History

2025-05-27 11:25:53 +08:00
interface Options {
/*
* , false
* : Nzh.cn和Nzh.hk中的encodeS方法默认 true
* */
tenMin?: boolean;
/**
* "万万", true
* */
ww?: boolean;
}
interface ToMoneyOptions extends Options {
/**
* , toMoney , false
* */
complete?: boolean;
/*
* , toMoney , true
* */
outSymbol?: boolean;
/*
* 0toMoney , false
* */
unOmitYuan?: boolean;
/**
*
*/
forceZheng?: boolean;
}
interface Lang {
ch: string;
ch_u: string;
ch_f: string;
ch_d: string;
m_t: string;
m_z: string;
m_u: string;
}
interface Langs {
s: Lang;
b: Lang;
hk_s: Lang;
hk_b: Lang;
}
interface BuiltIn {
encodeS(num: number | string, options?: Options): string;
encodeB(num: number | string, options?: Options): string;
decodeS(zhnum: string, options?: Options): string;
decodeB(zhnum: string, options?: Options): string;
toMoney(num: number | string, options?: ToMoneyOptions): string;
}
declare module 'nzh' {
export default class Nzh {
constructor(lang: Lang);
public encode(num: number | string, options?: Options): string;
public decode(zhnum: string, options?: Options): string;
public toMoney(num: number | string, options?: ToMoneyOptions): string;
static cn: BuiltIn;
static hk: BuiltIn;
static langs: Langs;
}
}
declare module 'nzh/cn' {
const nzhcn:BuiltIn;
export default nzhcn;
}
declare module 'nzh/hk' {
const nzhhk:BuiltIn;
export default nzhhk;
}