type Value = string | number | boolean | Date | null; type SingleValueFilterOperator = '=' | '>' | '<' | '>=' | '<=' | '<>' | 'like' | '!=' | 'Timespan'; type MultiValueFilterOperator = 'in' | 'not in' | 'between'; type FilterVar = keyof T | (string & Record); type SingleValueFilter = [FilterVar, SingleValueFilterOperator, Value]; type MultiValueFilter = [FilterVar, MultiValueFilterOperator, Value[]]; export type Filter> = SingleValueFilter | MultiValueFilter; export type FieldName = string[] | string; export type FrappeDoc = T & { /** User who created the document */ owner: string; /** Date and time when the document was created - ISO format */ creation: string; /** Date and time when the document was last modified - ISO format */ modified: string; /** User who last modified the document */ modified_by: string; idx: number; /** 0 - Saved, 1 - Submitted, 2 - Cancelled */ docstatus: 0 | 1 | 2; parent?: any; parentfield?: any; parenttype?: any; /** The primary key of the DocType table */ name: string; }; export interface GetLastDocArgs { filters?: Filter[]; orFilters?: Filter[]; orderBy?: { field: keyof T | (string & Record); order?: 'asc' | 'desc'; }; } export interface GetDocListArgs { /** Fields to be fetched */ fields?: (keyof T | '*')[]; /** Filters to be applied - SQL AND operation */ filters?: Filter[]; /** Filters to be applied - SQL OR operation */ orFilters?: Filter[]; /** Fetch from nth document in filtered and sorted list. Used for pagination */ limit_start?: number; /** Number of documents to be fetched. Default is 20 */ limit?: number; /** Sort results by field and order */ orderBy?: { field: keyof T | (string & Record); order?: 'asc' | 'desc'; }; /** Group the results by particular field */ groupBy?: keyof T | (string & Record); /** Fetch documents as a dictionary */ asDict?: boolean; } export {};