@flex-development/tutils
Version:
TypeScript utilities
21 lines (20 loc) • 817 B
text/typescript
/**
* @file Type Definitions - DocumentPartial
* @module tutils/types/DocumentPartial
*/
import type DUID from './duid.cjs';
import type ObjectPlain from './object-plain.cjs';
import type ObjectUnknown from './object-unknown.cjs';
import type OrDeepPartial from './or-deep-partial.cjs';
import type UID from './uid.cjs';
/**
* Object that includes all object properties or a subset.
*
* Even when a subset of properties are requested, a partial `Document` response
* will always include the `id` field, or the selected uid field.
*
* @template D - Document (collection object)
* @template U - Name of document uid field
*/
declare type DocumentPartial<D extends ObjectPlain = ObjectUnknown, U extends string = DUID> = Omit<OrDeepPartial<D>, U> & Record<U, UID>;
export { type DocumentPartial as default };