UNPKG

gremlin-helper

Version:

A wrapper around the gremlin client to introduce model validation and other useful functionality to use within a web api.

23 lines (22 loc) 585 B
export declare type SchemaType = 'string' | 'number' | string; export interface IPropDef { type: SchemaType; required?: boolean; } export declare type NonNullable<T> = T & {}; export declare type Purify<T extends string> = { [P in T]: T; }[T]; export declare type PropDef = SchemaType | IPropDef; export interface IVertexSchema<T = void> { label: string; props?: { [P in Purify<keyof T>]: NonNullable<PropDef>; }; } export interface IEdgeSchema<T = void> { label: string; props?: { [P in Purify<keyof T>]: NonNullable<PropDef>; }; }