7 Commits

Author SHA1 Message Date
41f365126d add .npmignore file 2023-08-26 18:29:05 -07:00
2c37ae21da cleanup 2023-08-26 15:00:38 -07:00
fefb06613f publish
All checks were successful
Build and publish / publish (push) Successful in 11s
2023-08-26 15:00:24 -07:00
17e457ed2b 0.2.1 2023-08-26 15:00:03 -07:00
64a6cac8f5 add types for async functions 2023-08-26 14:59:55 -07:00
eb65701595 cleanup 2023-08-26 13:54:39 -07:00
a73cd2b923 publish
All checks were successful
Build and publish / publish (push) Successful in 10s
2023-08-26 13:54:19 -07:00
4 changed files with 9 additions and 3 deletions

2
.npmignore Normal file
View File

@@ -0,0 +1,2 @@
.gitea
tsconfig.json

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@templates/typescript-types",
"version": "0.2.0",
"version": "0.2.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@templates/typescript-types",
"version": "0.2.0",
"version": "0.2.1",
"license": "ISC",
"devDependencies": {
"typescript": "^5.1.3"

View File

@@ -1,6 +1,6 @@
{
"name": "@js/types",
"version": "0.2.0",
"version": "0.2.1",
"description": "Collection of generic TypeScript type definitions for various utility purposes",
"main": "src/index.d.ts",
"types": "src/index.d.ts",

4
src/functions.d.ts vendored
View File

@@ -1,6 +1,10 @@
export type Func<T extends any = any> = (...args: any[]) => T;
export type AsyncFunc<T extends any = any> = (...args: any[]) => PromiseLike<T>;
export type AsyncResult<T extends AsyncFunc> = Awaited<ReturnType<T>>;
export type Params<T extends Func> = T extends (...args: infer P) => any ? P : never;
export type FirstParam<T extends Func> = T extends (first: infer F, ...args: any[]) => any ? F : never;