type: add nonZhScope

This commit is contained in:
zhoulixiang
2024-07-28 20:18:40 +08:00
parent c806f4d5b2
commit c18cf95c4f
2 changed files with 5 additions and 0 deletions

View File

@@ -52,6 +52,10 @@ export interface BasicOptions {
* @value removed返回结果移除非汉字字符
*/
nonZh?: "spaced" | "consecutive" | "removed";
/**
* @description nonZh 生效范围的正则表达式
*/
nonZhScope?: RegExp;
/**
* @description 对于 ü 的返回是否转换成 v仅在 toneType: none 启用时生效)
* @value false返回值中保留 ü (默认值)

View File

@@ -1,6 +1,7 @@
import type { SingleWordResult } from "../../common/type";
import { CompleteOptions } from "./index";
export declare const validateType: (word: unknown) => boolean;
export declare function isNonZhScope(char: string, scope?: RegExp): boolean;
export declare const middleWareNonZh: (list: SingleWordResult[], options: CompleteOptions) => SingleWordResult[];
export declare const middlewareMultiple: (word: string, options: CompleteOptions) => SingleWordResult[] | false;
export declare const middlewarePattern: (list: SingleWordResult[], options: CompleteOptions) => void;