import { PatchableArray } from '../structs/PatchableArray.js';
import { AutoEncoder } from './AutoEncoder.js';
import { Encodeable } from './Encodeable.js';
import { EncodeContext } from './EncodeContext.js';
import { NonScalarIdentifiable } from './Identifiable.js';
import { Cloneable } from './Cloneable.js';
export interface Patchable
{
patch(patch: P): this;
}
export type PatchType = T extends Patchable ? P : (T | undefined);
export declare function isPatchable(object: T): object is T & Patchable;
export declare function patchContainsChanges, A extends PatchType>(patch: A, model: B, context: EncodeContext): boolean;
export type ConvertArrayToPatchableArray = T extends AutoEncoder ? T | AutoEncoderPatchType | undefined : T extends PatchableArray ? T : (T extends Array ? (P extends string ? PatchableArray : P extends number ? PatchableArray : P extends AutoEncoder ? PatchableArrayAutoEncoder : T | undefined) : (T extends Map ? (PatchMap | null>) : PatchType | undefined));
type NonMethodKeys = {
[K in keyof T]: T[K] extends Function ? never : K;
}[keyof T];
export type PartialWithoutMethods = Partial>>;
/**
* Automatically determine the patchtype of an autoencoder object
*/
/**
* Automatically determine the patchtype of an autoencoder object
*/
export type AutoEncoderPatchType = AutoEncoder & ({
[P in Exclude, keyof AutoEncoder>]: T[P] extends Function ? never : ConvertArrayToPatchableArray;
} & (T extends NonScalarIdentifiable ? NonScalarIdentifiable : {}));
/**
* Helper type to fix TypeScript circular dependency by making a synonym for a patchable array for an autoencoder
*/
export type PatchableArrayAutoEncoder = P extends AutoEncoder & NonScalarIdentifiable ? (PatchableArray & NonScalarIdentifiable>) : P[];
export declare class PatchMap extends Map implements Cloneable {
_isPatch: boolean;
_isPatchMap: boolean;
applyTo(obj: Map): Map;
clone(this: T): this;
}
export declare function isPatchMap(obj: unknown): obj is PatchMap;
export declare function isPatchableArray(obj: unknown): obj is PatchableArray;
export declare function isPatch(obj: unknown): boolean;
export declare function isEmptyPatch(patch: unknown): boolean;
/**
* Use this method to encode an object (might be an encodeable implementation) into a decodable structure
*/
export declare function patchObject(obj: unknown, patch: unknown, options?: {
getDefaultValue?: () => any | null;
allowAutoDefaultValue?: boolean;
}): any;
export {};
//# sourceMappingURL=Patchable.d.ts.map