ORMWriteActions (src/types.ts)

zenstack · packages/clients/client-helpers/src/types.ts · typescript · MIT
database, Database / ORM

TypeScript definitions for ORM write actions and related types.

// Source: https://github.com/zenstackhq/zenstack | License: MIT | Copyright 2025 ZenStack
// Provided via justclaw.it.com; keep this notice with the code.
import type { ExtQueryArgsMarker, ExtResultMarker, QueryOptions } from '@zenstackhq/orm';
import type { SchemaDef } from '@zenstackhq/schema';

/**
 * A type that represents either a value of type T or a Promise that resolves to type T.
 */
export type MaybePromise<T> = T | Promise<T> | PromiseLike<T>;

/**
 * Infers the schema definition from a client contract type, or passes through a raw SchemaDef.
 */
export type InferSchema<T> = T extends { $schema: infer S extends SchemaDef } ? S : T extends SchemaDef ? T : never;

/**
 * Extracts the ExtQueryArgs type from a client contract, or defaults to `{}`.
 */
export type InferExtQueryArgs<

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key