fal-endpoint-types 1.3.5 → 1.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/types/fal/index.d.ts +18 -0
package/package.json
CHANGED
package/types/fal/index.d.ts
CHANGED
|
@@ -9,6 +9,24 @@ declare global {
|
|
|
9
9
|
export type EndpointOutput<T extends fal.Endpoint> =
|
|
10
10
|
T extends keyof fal.endpoints.Endpoints ? fal.endpoints.Endpoints[T]['output']
|
|
11
11
|
: { [K in string]: any };
|
|
12
|
+
|
|
13
|
+
/** Show all possible output properties for a set of endpoints. */
|
|
14
|
+
export type EndpointsOutputsCombined<
|
|
15
|
+
E extends fal.Endpoint,
|
|
16
|
+
T extends readonly fal.Endpoint[] = readonly [E, ...(readonly [E])],
|
|
17
|
+
O extends Record<string, never> = Record<string, never>,
|
|
18
|
+
> =
|
|
19
|
+
T extends readonly [infer M, ...infer R extends readonly fal.Endpoint[]] ?
|
|
20
|
+
R extends never ?
|
|
21
|
+
M extends fal.Endpoint ?
|
|
22
|
+
Partial<fal.EndpointOutput<M>> & O
|
|
23
|
+
: O
|
|
24
|
+
: EndpointsOutputsCombined<
|
|
25
|
+
E,
|
|
26
|
+
R,
|
|
27
|
+
Partial<fal.EndpointOutput<M extends fal.Endpoint ? M : never>> & O
|
|
28
|
+
>
|
|
29
|
+
: O;
|
|
12
30
|
}
|
|
13
31
|
}
|
|
14
32
|
|