Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cnchar-types

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cnchar-types - npm Package Compare versions

Comparing version 3.0.6 to 3.1.0

plugin/explain/index.d.ts

5

main/common.d.ts

@@ -29,4 +29,5 @@ import {ICnChar, ToneType} from '.';

export declare interface IPlugin {
(cnchar: ICnChar): void;
init?(cnchar: ICnChar): void;
pluginName: string;
install(cnchar: ICnChar): void;
args?: Json;
}

@@ -33,0 +34,0 @@ export declare interface ConvertInterface {

12

main/index.d.ts

@@ -0,4 +1,5 @@

import {IPlugin} from './common';
import {ICncharTool} from './tool';
export declare type SpellArg = 'array' | 'low' | 'up' | 'first' | 'poly' | 'tone' | 'simple' | 'trad';
export declare type SpellArg = 'array' | 'low' | 'up' | 'first' | 'poly' | 'tone' | 'simple' | 'trad' | 'flat';
export declare type StrokeArg = 'letter' | 'shape' | 'count' | 'name' | 'detail' | 'array' | 'order' | 'simple' | 'trad';

@@ -17,7 +18,6 @@ export declare type SpellToWordArg = 'poly' | 'alltone' | 'array' | 'simple' | 'trad';

export declare type PluginArg = 'order' | 'trad' | 'poly' | 'draw' | 'idiom' | 'xhy' | 'radical';
export declare type PluginArg = 'order' | 'trad' | 'poly' | 'draw' | 'idiom' | 'xhy' | 'radical' | string;
export declare type ToneType = 0 | 1 | 2 | 3 | 4;
export declare type CompareType = 'more' | 'less' | 'even' | 'error';
export declare interface ISpellInfoReturn {

@@ -44,3 +44,3 @@ spell: string;

stroke: IStroke;
use(...plugins: Array<Function>): void;
use(...plugins: IPlugin[]): void;
spellToWord(spell: string, ...args: Array<SpellToWordArg>): string | Array<string>;

@@ -78,3 +78,3 @@ strokeToWord(stroke: number, ...args: Array<StrokeToWordArg>): string | Array<string>;

setStrokeCount(json: {[key: string]: number}): void;
shapeSpell(spell: string): string;
shapeSpell(spell: string, reverse?: boolean): string;

@@ -86,2 +86,4 @@ _: ICncharTool;

};
setResourceBase(url: string): void;
env: 'node' | 'web' | 'miniapp';
}

@@ -88,0 +90,0 @@

@@ -48,2 +48,8 @@ import {Json, ConvertInterface, ITransformReturn} from './common';

/**
将拼音转换成json数据
lv2 => {spell:'lü', tone: 2, index: 2, isTrans: true}
lǘ => {spell:'lü', tone: 2, index: 2, isTrans: false}
needTone = true: lv2 => {spell:'lǘ', tone: 2, index: 2, isTrans: true}
*/
export declare interface ITransformTone {

@@ -69,2 +75,3 @@ (

checkArgs: ICheckArgs;
checkTrad(input: string | string[], args: string[]): string | string[];
transformTone: ITransformTone;

@@ -77,2 +84,3 @@ convert?: ConvertInterface;

mapJson: IMapJson;
getResourceBase(): string;
poly?: boolean;

@@ -79,0 +87,0 @@ [prop: string]: any;

{
"name": "cnchar-types",
"version": "3.0.6",
"version": "3.1.0",
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -110,3 +110,4 @@ import {IComplete, IWriter, IWriterOptionWithoutText} from './index';

TEST_STATUS: Json<TTestStatusType>;
init?(cnchar?: ICnChar): void;
setResourceBase(url: string): void;
onWordNotFound(callback: (word: string)=>void): void;
}

@@ -113,0 +114,0 @@

@@ -12,3 +12,2 @@

(input: TIdiomInput, ...args: Array<IdomArg>): Array<string> | void;
init?(cnchar?: ICnChar): void;
}

@@ -22,3 +21,3 @@

declare module '../../main' {
declare module '../../main/index' {
interface ICnChar {

@@ -25,0 +24,0 @@ idiom: IIdiom;

@@ -27,6 +27,2 @@ import {Json} from '../../main/common';

export declare interface IInitOrder {
(cnchar?: ICnChar): void;
}
export declare interface IBase {

@@ -33,0 +29,0 @@ (

import {ICnChar} from '../../main';
import {Json} from '../../main/common';
export declare type RadicalArg = 'array';
export declare type RadicalArg = 'array' | 'trad';

@@ -6,0 +6,0 @@ export declare interface IRadicalFn {

@@ -10,10 +10,5 @@ import {ICnChar, XhyArg} from '../../main/index';

export declare interface IInitXHY {
(cnchar?: ICnChar): void;
}
export declare interface IXHY {
(text:string, ...xhyArgs: Array<XhyArg>): Array<string>;
addXhy: IAddXhy;
init: IInitXHY;
}

@@ -20,0 +15,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc