NotFunction<T>Excludes function types from a union, keeping only non-function members.
When to use
Use to filter out callable types from a union.
Details
Returns never if the entire union consists of function types.
Example (Filtering out functions)
import type { Types } from "effect"
type Result = Types.NotFunction<string | (() => void) | number>
// string | numbertypes
Source effect/Types.ts:7861 lines
export type type NotFunction<T> = T extends Function
? never
: T
Excludes function types from a union, keeping only non-function members.
When to use
Use to filter out callable types from a union.
Details
Returns never if the entire union consists of function types.
Example (Filtering out functions)
import type { Types } from "effect"
type Result = Types.NotFunction<string | (() => void) | number>
// string | number
NotFunction<function (type parameter) T in type NotFunction<T>T> = function (type parameter) T in type NotFunction<T>T extends Function ? never : function (type parameter) T in type NotFunction<T>TReferenced by 2 symbols