import { AwareTypes, } from '../relations/AwareTypes'; import { BaseAdjacencies, } from '../ontology/BaseAdjacencies'; import { ContainableTypes, } from '../relations/ContainableTypes'; import { ContainmentTypes, } from '../relations/ContainmentTypes'; import { EpistemicTypes, } from '../epistemology/EpistemicTypes'; import { INamed, } from '../../interfaces/INamed'; import { IModel, } from '../models/IModel'; import { ITaggable, } from '../../interfaces/ITaggable'; import { IWorld, } from '../world/IWorld'; import { ModelType, } from '../models/ModelType'; import { OnticTypes, } from '../ontology/OnticTypes'; export type FindModelArg< Type extends ModelType = ModelType, Being extends OnticTypes = OnticTypes, Knowledge extends ModelType = ModelType, > = string | Array>; export interface FindModelArgs< Type extends ModelType, Being extends OnticTypes, Knowledge extends ModelType, > extends IFindBaseArgs { readonly adjacent?: Type extends OnticTypes ? FindAdjacencyArg : undefined; readonly connected?: Type extends OnticTypes ? FindAdjacencyArg : undefined; readonly awareOf?: Type extends AwareTypes ? FindModelArg : undefined; readonly inAwarenessGraph?: Type extends AwareTypes ? FindModelArg : undefined; readonly ancestors?: Type extends ContainableTypes ? FindModelArg : undefined; readonly children?: Type extends ContainableTypes ? FindModelArg : undefined; readonly descendants?: Type extends ContainableTypes ? FindModelArg : undefined; readonly parent?: Type extends ContainableTypes ? string | IModel | IWorld : undefined; readonly links?: Type extends EpistemicTypes ? FindModelArg : undefined; readonly thoughts?: Type extends EpistemicTypes ? FindModelArg : undefined; readonly wants?: Type extends EpistemicTypes ? FindModelArg : undefined; } export interface IFindBaseArgs extends Partial, ITaggable { readonly andOrBehavior?: 'and' | 'or'; readonly type?: Type; } export type FindAdjacencyArgs< Type extends OnticTypes, Being extends OnticTypes, Knowledge extends ModelType, > = Pick, 'adjacent' | 'connected'>; export type FindAdjacencyArg< Type extends OnticTypes, Being extends OnticTypes, Knowledge extends ModelType, > = [ BaseAdjacencies, FindModelArg, ]; export type FindAwarenessArgs< Type extends AwareTypes, Being extends OnticTypes, > = Pick< FindModelArgs, 'awareOf' | 'inAwarenessGraph' >; export type FindContainmentArgs< Type extends ContainmentTypes, Being extends ContainableTypes, > = Pick< FindModelArgs, 'ancestors' | 'children' | 'descendants' | 'parent' >; export type FindThoughtArgs< Type extends EpistemicTypes, Knowledge extends ModelType, > = Pick< FindModelArgs, 'links' | 'thoughts' | 'wants' >; export type FindEpistemicArgs< Type extends EpistemicTypes, Being extends OnticTypes, Knowledge extends ModelType, > = FindAwarenessArgs & FindThoughtArgs; export type FindOnticArgs< Type extends OnticTypes, Being extends OnticTypes, Knowledge extends ModelType, > = FindAdjacencyArgs & (Type extends ContainmentTypes ? Being extends ContainableTypes ? FindContainmentArgs : object : object);