import { Collection, Vertex } from "./vertex.js"; import { AllTrue, IsUnion, NoneIsUnion } from "./util.js"; //#region src/core/interfaces/vertices/util/edges.d.ts declare const EDGE_TYPE_ID_KEY = "__edge_type_id"; declare const EDGE_INVALID_KEY = "__invalid"; declare const EDGE_VALUE_KEY = "__value"; type EdgeValueKey = typeof EDGE_VALUE_KEY; type EdgeTypeIdValues = { PLAIN: 'PLAIN'; WRAPPED: 'WRAPPED'; COALESCED: 'COALESCED'; GROUP_WITH_EXCLUDE: 'GROUP_WITH_EXCLUDE'; AVAILABLE_LOCATION: 'AVAILABLE_LOCATION'; THREAD_MESSAGE: 'THREAD_MESSAGE'; }; type EdgeTypeIdValue = (EdgeTypeIdValues)[keyof EdgeTypeIdValues]; type EdgeBase = { [EDGE_TYPE_ID_KEY]: ID; [EDGE_INVALID_KEY]: Invalid; }; type EdgeIsValid> = [T] extends [{ [EDGE_INVALID_KEY]: false; }] ? true : false; declare namespace Plain { namespace Util {} type Edge> = EdgeBase extends never ? true : false> & { [EDGE_VALUE_KEY]: V; }; } declare namespace Wrapped { namespace Util { type Options = { key: T; }; type Value = Extra & { [k in K]: To }; } type Edge, E extends object = object> = EdgeBase extends never ? true : false> & { [EDGE_VALUE_KEY]: Util.Value; }; } declare namespace Coalesced { namespace Util { export namespace Keys { const TO = "to"; type To = typeof TO; const TO_MODEL = "toModel"; type ToModel = typeof TO_MODEL; } export type Options = { optional?: boolean; }; type makePartial = O extends { optional: true; } ? Partial : T; export type ToModel> = V extends Vertex ? C extends 'events' ? C | 'courseevents' : C : never; export type Value = Extra & makePartial<{ [Keys.TO]: To; [Keys.TO_MODEL]: ToModel; }, Opts>; export {}; } type Edge, Opts extends Util.Options = object, E extends object = object> = EdgeBase extends never ? true : false> & { [EDGE_VALUE_KEY]: Util.Value, Opts, E>; }; } declare namespace GroupWithExclude { namespace Util { namespace Keys { const TO = "to"; type To = typeof TO; const EXCLUDE = "exclude"; type Exclude = typeof EXCLUDE; } type Value = Extra & { [Keys.TO]: To; [Keys.EXCLUDE]?: Exclude[]; }; } type Edge, P extends Vertex, E extends object = object> = EdgeBase extends never ? true : false> & { [EDGE_VALUE_KEY]: Util.Value; }; } declare namespace AvailableLocation { namespace Util { namespace Keys { const LOCATIONS = "locations"; type Locations = typeof LOCATIONS; } type Value = Extra & { [Keys.LOCATIONS]: [L]; }; } type Edge, E extends object = object> = EdgeBase extends never ? true : false> & { [EDGE_VALUE_KEY]: Util.Value; }; } declare namespace ThreadMessage { namespace Util { namespace Keys { const USER = "user"; type User = typeof USER; const TAGGED_PERSONS = "taggedPersons"; type TaggedPersons = typeof TAGGED_PERSONS; } type Value = Extra & { [Keys.USER]: P; [Keys.TAGGED_PERSONS]?: T[]; }; } type Edge

, T extends Vertex, E extends object = object> = EdgeBase extends never ? true : false> & { [EDGE_VALUE_KEY]: Util.Value; }; } type AllowedEdgeType> = IsUnion extends never ? true : T extends Coalesced.Edge ? true : false; type EdgeMultiplicity = 'single' | 'array'; type EdgeWrapper | null | undefined> = AllTrue<[AllowedEdgeType>, EdgeIsValid>]> extends false ? never : { __edge_multiplicity: M; __edge_type: T; }; //#endregion export { AvailableLocation, Coalesced, EdgeBase, EdgeMultiplicity, EdgeValueKey, EdgeWrapper, GroupWithExclude, Plain, ThreadMessage, Wrapped }; //# sourceMappingURL=edges.d.ts.map