Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/domain_functions/src/composable/types.ts>AtLeastOne

Decouple your business logic from your framework. With first-class type inference from end to end.
Go to Latest
type alias AtLeastOne
import { type AtLeastOne } from "https://deno.land/x/domain_functions@v2.6.0/src/composable/types.ts";

It is similar to Partial but it requires at least one property to be defined.

Examples

type MyType = AtLeastOne<{ a: string, b: number }> const a: MyType = { a: 'hello' } const b: MyType = { b: 123 } const c: MyType = { a: 'hello', b: 123 } // The following won't compile: const d: MyType = {}

Type Parameters

T
optional
U = [K in keyof T]: Pick<T, K>
definition: Partial<T> & U[keyof U]