import { ExecutionContext } from 'ava'; import { ContractType, ManageableFields, AuthenticationDefinition, AuthInput, HttpMethods, Implementation, HandleResult, HandleResultSuccess, HandleErrorResponse, Implementations } from './globalTypes.js'; import { Validation } from 'yaschva'; import { AbstractBackend } from './backendAbstract.js'; export declare type TestContractOut = { id: string; b: string; }; export declare type TestContractIn = { id?: string; a: string; }; export declare type TestContractType = ContractType; export declare type CONTRACT_COLLECTION = { post: ContractType<'POST', A, any, any>; get: ContractType<'GET', A, any, any>; del: ContractType<'DELETE', A, any, any>; put: ContractType<'PUT', A, any, any>; patch: ContractType<'PATCH', A, any, any>; }; export declare type ANY_CONTRACTS = CONTRACT_COLLECTION; export declare type TestFn = (backend: AbstractBackend, postContract: CONTRACT_COLLECTION) => (t: ExecutionContext) => Promise; export declare const runTestArray: (input: { contracts: CONTRACT_COLLECTION; skip: string[]; }, tests: [string, TestFn][]) => void; export declare const mockHandle: (input: IN, _: AuthInput, contract: ContractType) => Promise>; export declare const getContract: (input?: { manageFields?: ManageableFields | undefined; authentication?: boolean | (string | { createdBy: boolean; })[] | undefined; name?: string | undefined; handle?: ((input: IN, auth: AuthInput, contract: ContractType, id?: string | undefined) => Promise>) | undefined; method?: T | undefined; implementation?: IMPL | undefined; arguments?: string | import("yaschva").EnumType | import("yaschva").ObjectType | import("yaschva").ArrayType | import("yaschva").ObjectMetaType | import("yaschva").StringType | import("yaschva").NumberType | import("yaschva").MetaType | import("yaschva").MapType | import("yaschva").ValueType[] | import("yaschva").TypeDef | undefined; returns?: string | import("yaschva").EnumType | import("yaschva").ObjectType | import("yaschva").ArrayType | import("yaschva").ObjectMetaType | import("yaschva").StringType | import("yaschva").NumberType | import("yaschva").MetaType | import("yaschva").MapType | import("yaschva").ValueType[] | import("yaschva").TypeDef | undefined; }) => ContractType; export declare const ExpectGood: (doAction: (backend: AbstractBackend, contract: ANY_CONTRACTS, t: ExecutionContext) => Promise>, asserts: (a: HandleResultSuccess, t: ExecutionContext, contract: ANY_CONTRACTS) => void | Promise) => (backend: AbstractBackend, contract: ANY_CONTRACTS) => (t: ExecutionContext) => Promise; export declare const ExpectBad: (doAction: (backend: AbstractBackend, contract: ANY_CONTRACTS, t: ExecutionContext) => Promise>, asserts: (a: HandleErrorResponse, t: ExecutionContext, contract: ANY_CONTRACTS) => void | Promise) => (backend: AbstractBackend, contract: ANY_CONTRACTS) => (t: ExecutionContext) => Promise; export declare const baseDataSchema: { a: string; b: string[]; }; export declare const contractCollection: () => { contracts: CONTRACT_COLLECTION; skip: string[]; }[]; export declare const postSome: (db: AbstractBackend, contract: ContractType<"POST", any, any, A>, authInput?: AuthInput, num?: number) => Promise[]>; export declare const withAuth: >(c: T) => T; export declare const throwOnError: (input: HandleResult) => input is HandleResultSuccess;