type APIOptions = { params?: Record; headers?: HeadersInit; kwargs?: Record; handle?: boolean; data?: BodyInit | JSON; dataJ?: JSON; dataM?: Record; }; declare class API { constructor(kwargs?: Record); get(url: string, options?: APIOptions): unknown; post(url: string, options?: APIOptions): unknown; put(url: string, options?: APIOptions): unknown; delete(url: string, options?: APIOptions): unknown; patch(url: string, options?: APIOptions): unknown; options(url: string, options?: APIOptions): unknown; } declare class YoniusError extends Error { name: string; message: string; code: number; stack?: string; cause?: unknown; constructor(message: string, code?: number); isClient(): boolean; isServer(): boolean; } declare class OperationalError extends YoniusError { constructor(message?: string, code?: number); } declare class NotFoundError extends OperationalError {} declare class NotImplementedError extends OperationalError {} declare class ValidationError extends OperationalError {} declare function register(name: string, value: unknown): void; declare function unregister(name: string): void; declare function request(name: string): unknown; declare class FileTuple extends Array { static fromData(data: Uint8Array, name?: string, mime?: string): FileTuple; static fromString( dataString: StringConstructor, name?: string, mime?: string, options?: { encoding?: string } ): FileTuple; static fromArrayBuffer(arrayBuffer: ArrayBuffer, name?: string, mime?: string): FileTuple; static fromBlob(blob: Blob, name?: string, mime?: string): Promise; get name(): string; get mime(): string; get data(): Uint8Array; } interface QueryParams { readonly fields?: string[]; readonly eager?: boolean; readonly eagerL?: boolean; readonly map?: boolean; readonly rules?: boolean; readonly meta?: boolean; readonly build?: boolean; readonly fill?: boolean; readonly resolveA?: boolean; readonly skip?: number; readonly limit?: number; readonly sort?: unknown[][]; readonly raiseE?: boolean; [x: string]: unknown; } declare class Model { static niw(this: { new (): T }): T; static fill(this: { new (): T }, model?: T, safe?: boolean): Promise; static get(this: { new (): T }, params?: QueryParams): Promise; static find(this: { new (): T }, params?: QueryParams): Promise; static count(this: { new (): T }, params?: QueryParams): Promise; static get increments(): string[]; static get immutables(): string[]; constructor(options?: { fill?: boolean }); apply(this: T, model: Record): Promise; save(this: T): Promise; delete( this: T, options?: { preDelete?: boolean; postDelete?: boolean; beforeCallbacks?: ((self: T, model: Record) => void)[]; afterCallbacks?: ((self: T, model: Record) => void)[]; } ): Promise; advance(this: T, name: string, delta: number): Promise; reload(this: T, params?: QueryParams): Promise; validate(): Promise; _validate(): IterableIterator; } declare class ModelStore extends Model { static get schema(): Record; static get idName(): string; preSave(): Promise; preCreate(): Promise; preUpdate(): Promise; preDelete(): Promise; postSave(): Promise; postCreate(): Promise; postUpdate(): Promise; postDelete(): Promise; } declare function verify( condition: boolean, message?: string, code?: number, exception?: Error, kwargs?: Record, safeKeys?: string[] ): void; declare enum Cast { int = "int", float = "float", bool = "bool", list = "list", tuple = "tuple" } declare function load( names?: string[], path?: string, encoding?: string, force?: boolean, ctx?: unknown ): Promise; declare function conf( name: string, fallback?: unknown, cast?: string, ctx?: unknown ): unknown; declare function confP( name: string, fallback?: unknown, cast?: Cast | string, ctx?: unknown ): Promise; declare function getObject( params: Record, options: { alias?: boolean; page?: boolean; find?: boolean; norm?: boolean; } ): Record; declare function initMongo(mongoose: unknown, uri: string): Promise; declare function destroyMongo(mongoose: unknown): Promise; declare function camelToUnderscore(value: string, separator?: string): string; declare function underscoreToCamel( value: string, lower?: boolean, separator?: string ): string; declare function eq(valueC: T, message?: string): (value?: T, ctx?: unknown) => boolean; declare function gt(valueC: T, message?: string): (value?: T, ctx?: unknown) => boolean; declare function gte(valueC: T, message?: string): (value?: T, ctx?: unknown) => boolean; declare function notEmpty( message?: string ): (value?: string | unknown[], ctx?: unknown) => boolean; declare function isIn( valueC: T[], message?: string ): (value?: T, ctx?: unknown) => boolean; declare function isUpper(message?: string): (value?: string, ctx?: unknown) => boolean; declare function isLower(message?: string): (value?: string, ctx?: unknown) => boolean; declare function isSimple(message?: string): (value?: string, ctx?: unknown) => boolean; declare function isEmail(message?: string): (value?: string, ctx?: unknown) => boolean; declare function isUrl(message?: string): (value?: string, ctx?: unknown) => boolean; declare function isRegex( regex: string, message?: string ): (value?: string, ctx?: unknown) => boolean; declare function stringGt( valueC: number, message?: string ): (value?: string, ctx?: unknown) => boolean; declare function stringLt( valueC: number, message?: string ): (value?: string, ctx?: unknown) => boolean; declare function stringEq( valueC: number, message?: string ): (value?: string, ctx?: unknown) => boolean; export { API, APIOptions, Cast, FileTuple, Model, ModelStore, NotFoundError, NotImplementedError, OperationalError, QueryParams, ValidationError, YoniusError, camelToUnderscore, conf, confP, destroyMongo, eq, getObject, gt, gte, initMongo, isEmail, isIn, isLower, isRegex, isSimple, isUpper, isUrl, load, notEmpty, register, request, stringEq, stringGt, stringLt, underscoreToCamel, unregister, verify };