import { Model } from "../model"; import { SerialMeta } from "./base"; import { BaseRelationField, BaseRelationMeta, BaseRelationOptions } from "./base_relation"; import { BaseCollectionInterface, CollectionInterface } from './collection_interfaces'; export interface CollectionOptions extends BaseRelationOptions { indexBy?: keyof R; backingType?: 'Object' | 'Array' | 'Map' | 'Set' | typeof Object | typeof Array | typeof Map | typeof Set | typeof BaseCollectionInterface; } export declare class CollectionField, R> extends BaseRelationField<{ collectionInitialized: boolean; collectionInterface: BaseCollectionInterface; } & BaseRelationMeta, CollectionOptions, S> { constructor(ctx: ClassMemberDecoratorContext, options?: CollectionOptions); protected inInverseAction: boolean; protected getInterface(inst: S): BaseCollectionInterface; protected getCollection(inst: S): any; protected assertInitialized(inst: S): any; protected iterateCollectionItems(inst: S): IterableIterator; protected getCollectionInterfaceType(inst: S, given: any): CollectionInterface; protected buildCollectionInterface(inst: S, given: any): BaseCollectionInterface; protected setCollection(inst: S, coll: any): void; protected storeObject(inst: S, object: any, {}?: {}): void; protected unstoreObject(inst: S, object: any): void; offerObjectFromInverse(inst: S, object: any, inverseField: BaseRelationField): void; removeObjectFromInverse(inst: S, object: any, inverseField: BaseRelationField): void; access: ClassAccessorDecoratorTarget; decorate(target: any, context: ClassMemberDecoratorContext): any; serialize(inst: S, object: any, meta: SerialMeta): void; deserialize(inst: S, object: any, meta: SerialMeta): void; attach(inst: S): void; detach(inst: S): void; } export type AnyCollectionField = CollectionField; export declare const collection: >(options: CollectionOptions) => (value: any, context: ClassAccessorDecoratorContext) => any;