import { Sails } from 'sails-js'; import { RESULT } from './consts'; import { getPayloadSchema } from './utils'; // TODO: import from sails-js type ISailsFuncArg = InstanceType['services'][string]['functions'][string]['args'][number]; type Ctors = InstanceType['ctors']; type Services = InstanceType['services']; type SailsService = Services[string]; type Functions = SailsService[keyof SailsService]; type ISailsCtorFuncParams = Sails['ctors'][string]; type SailsServiceFunc = SailsService['functions'][string]; type SailsServiceQuery = SailsService['queries'][string]; type SailsServiceEvent = SailsService['events'][string]; type Result = typeof RESULT[keyof typeof RESULT]; type PayloadValue = string | boolean | null | Array | { [key: string]: PayloadValue }; type PayloadValueSchema = ReturnType; export type { ISailsFuncArg, Result, PayloadValue, PayloadValueSchema, Ctors, Services, Functions, ISailsCtorFuncParams, SailsServiceFunc, SailsServiceQuery, SailsServiceEvent, };