import { GraphQLResolveInfo } from 'graphql'; import { core } from '@nexus/schema'; declare global { interface PrismaInputs { } } /** * Write file contents but first delete the file off disk if present. This is a * useful function when the effect of file delete is needed to trigger some file * watch/refresh mechanism, such as is the case with VSCode TS declaration files * inside `@types/` packages. * * For more details that motivated this utility refer to the originating issue * https://github.com/prisma-labs/nexus-prisma/issues/453. */ export declare const hardWriteFile: (filePath: string, data: string) => Promise; /** * Write file contents but first delete the file off disk if present. This is a * useful function when the effect of file delete is needed to trigger some file * watch/refresh mechanism, such as is the case with VSCode TS declaration files * inside `@types/` packages. * * For more details that motivated this utility refer to the originating issue * https://github.com/prisma-labs/nexus-prisma/issues/453. */ export declare const hardWriteFileSync: (filePath: string, data: string) => void; /** * TODO */ export declare const indexBy: >(indexer: ((x: X) => string) | keyof X, xs: X[]) => Record; export declare const upperFirst: (s: string) => string; export declare function lowerFirst(s: string): string; export declare function flatMap(array: T[], callbackfn: (value: T, index: number, array: T[]) => U[]): U[]; export declare function dmmfFieldToNexusFieldConfig(param: { type: string | object; isList: boolean; isRequired: boolean; }): { type: any; list: true | undefined; nullable: boolean; }; export declare function assertPhotonInContext(prismaClient: any): void; export declare function trimIfInNodeModules(path: string): string; export declare function getImportPathRelativeToOutput(from: string, to: string): string; /** * Index types are just an alias for Records * whose keys are of type `string`. The name * of this type, `Index`, signifies its canonical * use-case for data indexed by some property, e.g. * a list of users indexed by email. */ export declare type Index = Record; /** TODO: Copy these types into computedInputs section of docs as part of * docs build process. The same should be done for other areas where code * has been copy pasted into our README. **/ /** * A function that takes an object representing the request's input * (args, context, and info) and returns the value to pass to the Prisma JS Client. */ export declare type ComputeInput = (params: ResolverParams) => unknown; export declare type ResolverType = core.GetGen<'argTypes'>['Mutation'] & core.GetGen<'argTypes'>['Query']; export declare type ResolverArgs = ResolverType[MethodName] extends unknown ? Record : ResolverType[MethodName]; export declare type ResolverParams = { info: GraphQLResolveInfo; ctx: Context; args: ResolverArgs | undefined; }; export declare type PreResolver = (args: ResolverParams) => Promise>; export declare type ResolverName = Extract['Mutation'] | keyof core.GetGen<'argTypes'>['Query'], string>; export declare type Context = core.GetGen<'context'>; export declare type NestedKeys = { [K in keyof T]: keyof T[K]; }[keyof T]; export declare type PrismaInputFieldName = NestedKeys extends never ? string : NestedKeys; export declare type CollapseToValue = PrismaInputFieldName | null | undefined; export declare type StandardInputConfig = { collapseTo?: CollapseToValue; computeFrom?: null; }; export declare type ComputedInputConfig = { collapseTo?: null; computeFrom: ComputeInput; }; export declare type InputConfig = StandardInputConfig | ComputedInputConfig; export declare type InputsConfig = { [Name in PrismaInputFieldName]?: StandardInputConfig | ComputedInputConfig; }; export declare type ComputedFields = { [Name in PrismaInputFieldName]?: ComputeInput; }; //# sourceMappingURL=utils.d.ts.map