import { mapping } from "cassandra-driver"; export type PartitionKey = T & { __partitionKey: never; }; export type Clustering = T & { __clustering: never; }; export type CodegenQueryOperator = mapping.q.QueryOperator & T; type IfNotNever = T extends never ? never : K; export type DrainOuterGeneric = [T] extends [unknown] ? T : never; export type PartitionKeyType = T extends PartitionKey ? U | CodegenQueryOperator : never; export type PrimaryKeyType = T extends (PartitionKey | Clustering) ? U | CodegenQueryOperator : never; type NonNeverPartitionKeys = { [K in keyof T]: IfNotNever, K>; }[keyof T]; type NonNeverPrimaryKeys = { [K in keyof T]: IfNotNever, K>; }[keyof T]; export type PartitionKeyColumns = DrainOuterGeneric<{ [K in NonNeverPartitionKeys]: PartitionKeyType; }>; export type PrimaryKeyColumns = DrainOuterGeneric<{ [K in NonNeverPrimaryKeys]: PrimaryKeyType; }>; export {};