Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

resolveinsertinput.md

34 lines1.0 KB

Type Alias: ResolveInsertInput<TExplicit, TSchema, TFallback>

type ResolveInsertInput<TExplicit, TSchema, TFallback> = unknown extends TExplicit ? [TSchema] extends [never] ? TFallback : InferSchemaInput<TSchema> : TExplicit extends object ? TExplicit : Record<string, unknown>;

Defined in: packages/db/src/types.ts:42

Internal

Helper type to determine the insert input type This takes the raw generics (TExplicit, TSchema, TFallback) instead of the resolved T.

Priority:

  1. Explicit generic TExplicit (if not 'unknown')
  2. Schema input type (if schema provided)
  3. Fallback type TFallback

This is used for collection insert type inference

Type Parameters

• TExplicit = unknown

• TSchema extends StandardSchemaV1 = never

• TFallback extends object = Record<string, unknown>