import type { Closable, TagType } from './main'; import { CLEAR_TAG, DELETE_TAG, GLOBAL_SELECTOR, MOVE_TAG, NULL_SELECTOR, PUSH_TAG, REPLACE_TAG, SET_TAG, SPLICE_TAG } from './constants'; import { Immutable, Tag } from './main'; export type GetElementType = T extends Array ? U : T; import type AtomNode from './model/accessor-cache/repository/atom-value/node'; export type ClearTag = typeof CLEAR_TAG; export type DeleteTag = typeof DELETE_TAG; export type GlobalSelector = typeof GLOBAL_SELECTOR; export type MoveTag = typeof MOVE_TAG; export type NullSelector = typeof NULL_SELECTOR; export type PushTag = typeof PUSH_TAG; export type ReplaceTag = typeof REPLACE_TAG; export type SetTag = typeof SET_TAG; export type SpliceTag = typeof SPLICE_TAG; export type KeyType = number | string | symbol; export type ScalarType = boolean | KeyType; export type Cloneable = T & { clone?: (...args: Array) => T; cloneNode?: (deep: true, ...args: Array) => T; }; export interface ValueObject { [x: KeyType]: BaseType | Function | Value; } export type ValueObjectCloneable = Cloneable; export type Value = ValueObject | ValueObjectCloneable; export declare class UpdateStats { private _idSet; private _changePathMap; private _currentPathToken; get changedPathTable(): KeyType[][]; get currentPathToken(): KeyType[]; get hasChanges(): boolean; addChangePath(changePath: Array): void; } export type BaseType = Array | ScalarType | Value | {} | object; export type ClearCommand = Record; export type DeleteCommand = Record>; export type MoveCommand = Record; export type PushCommand = Record>>; export type ReplaceCommand = Record>; export type SetCommand = Record | ((value: T) => T) | ((value: GetElementType) => GetElementType)>; export type SpliceCommand = Record>]>; export type TagCommand) = Value, K extends keyof P = keyof P> = T extends ClearTag ? ClearCommand : T extends DeleteTag ? DeleteCommand : T extends MoveTag ? MoveCommand : T extends PushTag ? PushCommand : T extends ReplaceTag ? ReplaceCommand : T extends SetTag ? SetCommand : T extends SpliceTag ? SpliceCommand : never; export interface AccessorPayload { [sourcePathId: number]: AtomNode; } export interface AccessorResponse { [sourcePath: string]: Readonly; } export type Changes = UpdatePayload | UpdatePayloadArray; export interface ChangeInfo { changes: {}; paths: Array>; } export type Listener = (changes: Readonly, paths: Readonly) => void; export type UpdatePayloadCore | Value)> = ClearTag | TagCommand | Value | T extends {} ? T | Partial<{ [K in keyof T]: T[K] extends (Array | Value) ? UpdatePayload : UpdatePayload; }> : T; export type UpdatePayloadCoreCloneable | Value)> = Cloneable>; export type UpdatePayload | Value)> = UpdatePayloadCore | UpdatePayloadCoreCloneable; export type UpdatePayloadArrayCore | Value)> = Array>; export type UpdatePayloadArrayCoreCloneable | Value)> = Cloneable>; export type UpdatePayloadArray | Value)> = UpdatePayloadArrayCore | UpdatePayloadArrayCoreCloneable; export type { Connection } from './connection'; export type { Closable, TagType }; export { Immutable, Tag }; export { CLEAR_TAG, DELETE_TAG, GLOBAL_SELECTOR, MOVE_TAG, NULL_SELECTOR, PUSH_TAG, REPLACE_TAG, SET_TAG, SPLICE_TAG }; export default Immutable;