import { List } from './list' import { Cache, DEPLOY, CLASS, SCHEMA, SCOPE, DEFAULT_RULE_TYPE, QUERY_WITH_SCOPE, ID, NameBase, PathCmd, SortCmd, OrderCmd, RelationCmd, } from './type' import { Set } from './set' import { Map } from './map' import { Query } from './query' export declare class Rule { $name: NameBase state: Cache all: QUERY_WITH_SCOPE model: CLASS list: CLASS> set: CLASS> map: CLASS> constructor( base: string, { model, list, set, map, scope, scope_without_cache, schema, deploy, }?: { model?: CLASS list?: CLASS> set?: CLASS> map?: CLASS> scope?: SCOPE scope_without_cache?: SCOPE schema?: SCHEMA deploy?: DEPLOY } ) schema(cb: SCHEMA): this key_by( keys?: | string | string[] | { (): string } ): void deploy(cb: DEPLOY): void depend_on(parent: any): void scope_without_cache(cb: SCOPE): void scope(cb: SCOPE): void property(type: any, o: any): void default_scope(scope: (all: Query) => Query): void shuffle(): void sort(...sort: SortCmd): void order(keys: string | string[], order: OrderCmd): void relation_to_one(key: string, target: string, ik: ID, else_id?: ID): void relation_to_many(key: string, target: string, ik: ID, cmd: string, qk: ID): void relation_tree(key: string, ik: ID): void relation_graph(key: string, ik: string): void use_cache(key: string, val: any): void path(keys: string[], option?: PathCmd): void belongs_to(to: string, option?: RelationCmd): void habtm(to: any, option?: RelationCmd): void has_many(to: any, option?: RelationCmd): void tree(option?: RelationCmd): void graph(option?: RelationCmd): boolean }