@waiting/shared-types
Advanced tools
Comparing version
@@ -5,3 +5,14 @@ export interface Func { | ||
} | ||
/** | ||
* ReturnType is any | ||
*/ | ||
export type MethodType = (...input: any[]) => (any | Promise<any>); | ||
/** | ||
* ReturnType is unknown | ||
*/ | ||
export type MethodTypeUnknown<ArgsType extends any[] = any[], ReturnType extends unknown = unknown> = (...input: ArgsType) => ReturnType; | ||
/** | ||
* ReturnType is Promise<unknown> | ||
*/ | ||
export type AsyncMethodType<ArgsType extends any[] = any[], ResultType extends unknown = unknown> = (...input: ArgsType) => Promise<ResultType>; | ||
//# sourceMappingURL=func.d.ts.map |
@@ -0,3 +1,4 @@ | ||
/* eslint-disable @typescript-eslint/no-unnecessary-type-constraint */ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
export {}; | ||
//# sourceMappingURL=func.js.map |
{ | ||
"name": "@waiting/shared-types", | ||
"author": "waiting", | ||
"version": "21.1.0", | ||
"version": "21.2.0", | ||
"description": "shared typescript types", | ||
@@ -32,4 +32,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"cross-env": "7", | ||
"typescript": ">=4.7.4" | ||
"cross-env": "7" | ||
}, | ||
@@ -51,4 +50,4 @@ "engines": { | ||
"build": "npm run tsc && tsc-alias && npm run rp", | ||
"clean": "npm run clean:lock & npm run clean:cache & rm -rf dist/* -rf", | ||
"clean:cache": "rm -rf .eslintcache .vscode/.tsbuildinfo .vscode/.tsbuildinfo.*", | ||
"clean": "npm run clean:lock & npm run clean:cache & rm -rf dist/*", | ||
"clean:cache": "rm -rf .eslintcache .tsbuildinfo", | ||
"clean:lock": "rm package-lock.json -f", | ||
@@ -60,2 +59,5 @@ "cov": "cross-env TS_NODE_PROJECT=test/tsconfig.json c8 mocha --loader=ts-node/esm --parallel=false", | ||
"rp": "rollup -c rollup.config.js --context this", | ||
"prepack": "rm -f dist/tsconfig.tsbuildinfo", | ||
"pretest": "npm run build", | ||
"pretest:local": "npm run build", | ||
"test": "cross-env TS_NODE_PROJECT=test/tsconfig.json mocha --loader=ts-node/esm", | ||
@@ -65,3 +67,3 @@ "test:local": "cross-env TS_NODE_PROJECT=test/tsconfig.json ../../node_modules/.bin/mocha --loader=ts-node/esm --parallel=false", | ||
}, | ||
"gitHead": "b520c9e84d4ca89f8b605c2cb761fbdea6f945c9" | ||
"gitHead": "6f5ceac6c2a6d17c97bd130cbf44516cbd6cfb04" | ||
} |
@@ -0,1 +1,2 @@ | ||
/* eslint-disable @typescript-eslint/no-unnecessary-type-constraint */ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
@@ -8,2 +9,22 @@ | ||
/** | ||
* ReturnType is any | ||
*/ | ||
export type MethodType = (...input: any[]) => (any | Promise<any>) | ||
/** | ||
* ReturnType is unknown | ||
*/ | ||
export type MethodTypeUnknown< | ||
ArgsType extends any[] = any[], | ||
ReturnType extends unknown = unknown, | ||
> = (...input: ArgsType) => ReturnType | ||
/** | ||
* ReturnType is Promise<unknown> | ||
*/ | ||
export type AsyncMethodType< | ||
ArgsType extends any[] = any[], | ||
ResultType extends unknown = unknown, | ||
> = (...input: ArgsType) => Promise<ResultType> | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
88811
1.99%1
-50%1229
2.5%