Skip to content

Commit

Permalink
type: add nonZhScope
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoulixiang committed Jul 28, 2024
1 parent c806f4d commit c18cf95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions types/core/pinyin/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export interface BasicOptions {
* @value removed:返回结果移除非汉字字符
*/
nonZh?: "spaced" | "consecutive" | "removed";
/**
* @description nonZh 生效范围的正则表达式
*/
nonZhScope?: RegExp;
/**
* @description 对于 ü 的返回是否转换成 v(仅在 toneType: none 启用时生效)
* @value false:返回值中保留 ü (默认值)
Expand Down
1 change: 1 addition & 0 deletions types/core/pinyin/middlewares.d.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit c18cf95

Please sign in to comment.