更改处理器上下文类型为TS接口,多项优化:

- 修复Typescript库依赖错误
- 完善注释,格式化代码
- 更新pnpm lock文件版本为9.0
This commit is contained in:
陈梓阳 2025-07-15 16:13:59 +08:00
parent e8ae91bb2a
commit 03229b5f48
4 changed files with 1899 additions and 1535 deletions

View File

@ -1,6 +1,6 @@
{
"name": "cut-abstractions",
"version": "0.1.5",
"version": "0.1.6",
"description": "",
"files": [
"dist/**/*"

File diff suppressed because it is too large Load Diff

View File

@ -4,26 +4,39 @@ import { ConfigBase } from "./models/config";
/**
*
*/
export abstract class ProcessorContext<TInput,TOutput,TConfig extends ConfigBase>{
export interface ProcessorContext<TInput, TOutput, TConfig extends ConfigBase> {
/**
*
*/
public input?:TInput;
input?: TInput;
/**
*
*/
public params?:TConfig;
params?: TConfig;
/**
*
*/
public output?:TOutput;
output?: TOutput;
}
/**
*
*/
export abstract class ProcessorBase<TInput,TOutput,TConfig extends ConfigBase> {
public abstract get name():string;
export abstract class ProcessorBase<TInput, TOutput, TConfig extends ConfigBase> {
/**
* 使 kebab-case
* @example handle-ability
*/
public abstract get name(): string;
/**
*
* 使 semver
* @default 1.0.0
*/
public abstract get version(): string;
public abstract exec(context:ProcessorContext<TInput,TOutput,TConfig>):Promise<void>|void
/**
*
* @param context
*/
public abstract exec(context: ProcessorContext<TInput, TOutput, TConfig>): Promise<void> | void;
}

View File

@ -11,6 +11,7 @@
"module": "commonjs", /* Specify what module code is generated. */
// "rootDir": "./", /* Specify the root folder within your source files. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
"lib": ["DOM", "ES6", "ES2021"],
/* Emit */
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */