EncryptedFromSchema
Maps a plaintext model type to its encrypted form using the table schema. Fields whose keys match columns defined in `S` become `Encrypted`; all other field...
Type Alias: EncryptedFromSchema<T, S>
type EncryptedFromSchema<T, S> = { [K in keyof T]: [K] extends [keyof S] ? [S[K & keyof S]] extends [EncryptedColumn | EncryptedField] ? null extends T[K] ? Encrypted | null : Encrypted : T[K] : T[K] };Defined in: packages/stack/src/types.ts:190
Maps a plaintext model type to its encrypted form using the table schema.
Fields whose keys match columns defined in S become Encrypted;
all other fields retain their original types from T.
When S is the widened EncryptedTableColumn (e.g. when a user passes an
explicit <User> type argument without specifying S), the type degrades
gracefully to T — preserving backward compatibility.
Type Parameters
T
T
The plaintext model type (e.g. { id: string; email: string })
S
S extends EncryptedTableColumn
The table schema column definition, inferred from the table argument
Example
type User = { id: string; email: string }
// With a schema that defines `email`:
type Encrypted = EncryptedFromSchema<User, { email: EncryptedColumn }>
// => { id: string; email: Encrypted }EncryptedFields
EncryptedFields is a type in @cipherstash/stack. TypeScript API reference with its signature, parameters, and usage.
EncryptedQuery
Structural type representing an encrypted query term (search needle) returned by `encryptQuery` / `encryptQueryBulk` for scalar (`unique` / `match` / `ore`) ...