Last active
March 27, 2024 23:34
-
-
Save KrisKnez/14f351a87c043bb40278c368e02419d8 to your computer and use it in GitHub Desktop.
IPrismaDateTimeFilter.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Prisma } from '@prisma/client'; | |
type IPrismaDateTimeFilter< | |
Prefix extends string, | |
Delimiter extends string = '_', | |
Operations extends keyof Prisma.DateTimeFilter = keyof Prisma.DateTimeFilter, | |
> = { | |
[K in `${Prefix}${Delimiter}${keyof Pick< | |
Prisma.IntFilter, | |
Extract<'equals' | 'gt' | 'gte' | 'lt' | 'lte' | 'not', Operations> | |
>}`]?: string; | |
} & { | |
[K in `${Prefix}${Delimiter}${keyof Pick<Prisma.IntFilter, Extract<'in' | 'notIn', Operations>>}`]?: string[]; | |
} & { | |
[K in `${Prefix}`]: Prisma.DateTimeFilter; | |
}; | |
export default IPrismaDateTimeFilter; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment