Comparing version 2.0.70 to 2.0.71
@@ -1,2 +0,2 @@ | ||
import { MidsReturnsIntersection, MidsParams, ExcludeNeverKeysObj, Pretify } from '../utilities'; | ||
import { ExcludeNeverKeysObj, Pretify } from '../utilities'; | ||
import { DataParser, BridgeHandler, InferDataParser, FilesConfig } from './handlers'; | ||
@@ -12,13 +12,22 @@ import { FormidableFile } from '../utilities'; | ||
} | ||
type ReturnTypeOf<T> = T extends (...args: any[]) => infer R ? R : never; | ||
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; | ||
type IntersecOfResolveReturnTypesWithoutError<T extends Readonly<BridgeHandler<any, any>[]>> = T extends Readonly<BridgeHandler<infer F, any>[]> ? Omit<UnionToIntersection<ReturnTypeOf<F>>, 'error'> : never; | ||
type MidParams<T extends Readonly<BridgeHandler<any, any>[]>> = T extends Readonly<BridgeHandler<infer F, any>[]> ? Parameters<F>[number] & { | ||
body: {}; | ||
query: {}; | ||
headers: {}; | ||
} : never; | ||
export type CreateHandler = <Resolve extends (p: Pretify<ExcludeNeverKeysObj<{ | ||
middlewares: MidsReturnsIntersection<Middelwares> extends never ? {} : MidsReturnsIntersection<Middelwares>; | ||
body: (InferDataParser<Body> extends never ? {} : InferDataParser<Body>) & (MidsParams<Middelwares>['body'] extends never ? {} : MidsParams<Middelwares>['body']); | ||
query: (InferDataParser<Query> extends never ? {} : InferDataParser<Query>) & (MidsParams<Middelwares>['query'] extends never ? {} : MidsParams<Middelwares>['query']); | ||
headers: (InferDataParser<Headers> extends never ? {} : InferDataParser<Headers>) & (MidsParams<Middelwares>['headers'] extends never ? {} : MidsParams<Middelwares>['headers']); | ||
files: Files extends ['BridgeFilesDoNotExists'] ? {} : Files extends 'any' ? { | ||
middlewares: Pretify<IntersecOfResolveReturnTypesWithoutError<Middelwares>>; | ||
body: Pretify<(InferDataParser<Body> extends never ? {} : InferDataParser<Body>) & (MidParams<Middelwares>['body'] extends never ? {} : MidParams<Middelwares>['body'])>; | ||
query: Pretify<(InferDataParser<Query> extends never ? {} : InferDataParser<Query>) & (MidParams<Middelwares>['query'] extends never ? {} : MidParams<Middelwares>['query'])>; | ||
headers: Pretify<(InferDataParser<Headers> extends never ? {} : InferDataParser<Headers>) & (MidParams<Middelwares>['headers'] extends never ? {} : MidParams<Middelwares>['headers'])>; | ||
files: Pretify<Files extends ['BridgeFilesDoNotExists'] ? {} : Files extends 'any' ? { | ||
[key: string]: FormidableFile; | ||
} : { | ||
[key in Files[number]]: FormidableFile; | ||
}; | ||
}>; | ||
}>>) => Res, Res, Body extends DataParser<Record<any, any>> = never, Query extends DataParser<Record<string, any>> = never, Headers extends DataParser<Record<string, any>> = never, Files extends FilesConfig = ['BridgeFilesDoNotExists'], Middelwares extends ReadonlyArray<BridgeHandler> = never>(p: BridgeParams<Resolve, Middelwares, Body, Query, Headers, Files>) => BridgeHandler<Resolve, Middelwares>; | ||
export {}; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "bridge", | ||
"version": "2.0.70", | ||
"version": "2.0.71", | ||
"description": "Bridge is a Typescript Node.js framework that provides an easy and scalable way to create REST APIs while generating the client code.", | ||
@@ -5,0 +5,0 @@ "author": "Bridge Team <support@bridge.codes>", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
119289
146
1367