StackLatestPackagesStackSrcSchemaType aliases
InferPlaintext
Infer the plaintext (decrypted) type from a EncryptedTable schema. InferPlaintext in the @cipherstash/stack TypeScript API reference.
Type Alias: InferPlaintext<T>
type InferPlaintext<T> = T extends EncryptedTable<infer C> ? { [K in keyof C as C[K] extends EncryptedColumn | EncryptedField ? K : never]: string } : never;Defined in: packages/stack/src/schema/index.ts:523
Infer the plaintext (decrypted) type from a EncryptedTable schema.
Type Parameters
T
T extends EncryptedTable<any>
Example
const users = encryptedTable("users", {
email: encryptedColumn("email").equality(),
name: encryptedColumn("name"),
})
type UserPlaintext = InferPlaintext<typeof users>
// => { email: string; name: string }