type GuestIntroduction = "guest" | "patron"; type GuestExecutorType = (value: T) => This; interface GuestObjectType { give(value: T): this; introduction?(): GuestIntroduction; } type GuestType = GuestExecutorType | GuestObjectType; /** * @url https://kosukhin.github.io/patron.site/#/utils/give */ declare function give(data: T, guest: GuestType): void; /** * @url https://kosukhin.github.io/patron.site/#/utils/is-guest */ declare function isGuest(mbGuest: any): mbGuest is GuestType; /** * @url https://kosukhin.github.io/patron.site/#/guest */ declare class Guest implements GuestObjectType { private receiver; constructor(receiver: GuestExecutorType); give(value: T): this; } interface GuestDisposableType extends GuestObjectType { disposed(value: T | null): boolean; } type MaybeDisposableType = Partial>; /** * @url https://kosukhin.github.io/patron.site/#/guest/guest-disposable */ declare class GuestDisposable implements GuestDisposableType { private guest; private disposeCheck; constructor(guest: GuestType, disposeCheck: (value: T | null) => boolean); disposed(value: T | null): boolean; give(value: T): this; } /** * @url https://kosukhin.github.io/patron.site/#/guest/guest-cast */ declare class GuestCast implements GuestDisposableType { private sourceGuest; private targetGuest; constructor(sourceGuest: GuestType, targetGuest: GuestType); introduction(): "guest" | "patron"; give(value: T): this; disposed(value: T | null): boolean; } /** * @url https://kosukhin.github.io/patron.site/#/utils/patron-pools */ declare const patronPools: (patron: GuestObjectType) => PoolType[]; /** * @url https://kosukhin.github.io/patron.site/#/utils/remove-patron-from-pools */ declare const removePatronFromPools: (patron: GuestObjectType) => void; /** * @url https://kosukhin.github.io/patron.site/#/utils/is-patron-in-pools */ declare const isPatronInPools: (patron: GuestObjectType) => boolean; interface PoolType extends GuestObjectType { add(guest: GuestObjectType): this; distribute(receiving: T, possiblePatron: GuestObjectType): this; remove(patron: GuestObjectType): this; size(): number; } /** * @url https://kosukhin.github.io/patron.site/#/patron/patron-pool */ declare class PatronPool implements PoolType { private initiator; private patrons; give: (value: T) => this; constructor(initiator: unknown); size(): number; add(shouldBePatron: GuestType): this; remove(patron: GuestObjectType): this; distribute(receiving: T, possiblePatron: GuestType): this; private sendValueToGuest; private guestDisposed; } /** * @url https://kosukhin.github.io/patron.site/#/guest/guest-pool */ declare class GuestPool implements GuestObjectType, PoolType { private guests; private patronPool; constructor(initiator: unknown); give(value: T): this; add(guest: GuestType): this; remove(patron: GuestObjectType): this; distribute(receiving: T, possiblePatron: GuestObjectType): this; size(): number; private deliverToGuests; } interface GuestValueType extends GuestObjectType { value(): T; } /** * @url https://kosukhin.github.io/patron.site/#/guest/guest-sync */ declare class GuestSync implements GuestValueType { private theValue; constructor(theValue: T); give(value: T): this; value(): T; } /** * @url https://kosukhin.github.io/patron.site/#/guest/guest-object */ declare class GuestObject implements GuestDisposableType { private baseGuest; constructor(baseGuest: GuestType); give(value: T): this; introduction(): "guest" | "patron"; disposed(value: T | null): boolean; } /** * @url https://kosukhin.github.io/patron.site/#/guest/guest-applied */ declare class GuestApplied implements GuestObjectType { private baseGuest; private applier; constructor(baseGuest: GuestType, applier: (value: T) => R); give(value: T): this; } /** * @url https://kosukhin.github.io/patron.site/#/guest/guest-executor-applied */ declare class GuestExecutorApplied implements GuestObjectType { give: GuestExecutorType; constructor(baseGuest: GuestType, applier: (executor: GuestExecutorType) => GuestExecutorType); } /** * @url https://kosukhin.github.io/patron.site/#/patron */ declare class Patron implements GuestDisposableType { private willBePatron; constructor(willBePatron: GuestType); introduction(): "patron"; give(value: T): this; disposed(value: T | null): boolean; } /** * @url https://kosukhin.github.io/patron.site/#/utils/is-patron */ declare const isPatron: (guest: GuestType) => guest is Patron; /** * @url https://kosukhin.github.io/patron.site/#/patron/patron-once */ declare class PatronOnce implements GuestDisposableType { private baseGuest; private received; constructor(baseGuest: GuestType); introduction(): "patron"; give(value: T): this; disposed(value: T | null): boolean; } /** * @url https://kosukhin.github.io/patron.site/#/patron/patron-applied */ declare class PatronApplied implements GuestObjectType { private guestApplied; constructor(baseGuest: GuestType, applier: (value: T) => R); give(value: T): this; introduction(): "guest" | "patron"; } /** * @url https://kosukhin.github.io/patron.site/#/patron/patron-executor-applied */ declare class PatronExecutorApplied implements GuestObjectType { private guestApplied; constructor(baseGuest: GuestType, applier: (executor: GuestExecutorType) => GuestExecutorType); give(value: T): this; introduction(): "guest" | "patron"; } type SourceExecutorType = (guest: GuestType) => unknown; interface SourceObjectType { value: SourceExecutorType; } type SourceType = SourceExecutorType | SourceObjectType; /** * @url https://kosukhin.github.io/patron.site/#/utils/value */ declare function value(source: SourceType, guest: GuestType): unknown; /** * @url https://kosukhin.github.io/patron.site/#/utils/is-source */ declare function isSource(mbSource: any): mbSource is SourceType; /** * @url https://kosukhin.github.io/patron.site/#/guest/source */ declare class Source implements SourceObjectType { private source; constructor(source: SourceType); value(guest: GuestType): GuestType; } /** * @url https://kosukhin.github.io/patron.site/#/utils/source-of */ declare const sourceOf: (value: T) => Source; interface SourceAllType extends SourceObjectType { valueArray(guest: GuestObjectType): this; guestKey(key: string): GuestObjectType; } /** * @url https://kosukhin.github.io/patron.site/#/guest/source-all */ declare class SourceAll implements SourceAllType { private theAll; private keysKnown; private keysFilled; private filledAllPool; constructor(initialKnownKeys?: string[]); valueArray(guest: GuestType): this; value(guest: GuestType): this; guestKey(key: string): GuestObjectType; private isAllFilled; } /** * @url https://kosukhin.github.io/patron.site/#/utils/private */ interface PrivateType { get(...args: R): CT extends null ? T : CT; } declare class Private implements PrivateType { private buildingFn; constructor(buildingFn: (...args: any[]) => T); get(...args: R): CT extends null ? T : CT; } /** * @url https://kosukhin.github.io/patron.site/#/guest/source-sequence */ declare class SourceSequence implements SourceObjectType { private baseSource; private targetSource; constructor(baseSource: SourceType, targetSource: PrivateType>); value(guest: GuestType): this; } /** * @url https://kosukhin.github.io/patron.site/#/guest/source-map */ declare class SourceMap implements SourceObjectType { private baseSource; private targetSource; constructor(baseSource: SourceType, targetSource: PrivateType>); value(guest: GuestType): this; } /** * @url https://kosukhin.github.io/patron.site/#/guest/source-race */ declare class SourceRace implements SourceObjectType { private sources; constructor(sources: SourceType[]); value(guest: GuestType): this; } interface PoolAwareType { pool(): PatronPool; } /** * @url https://kosukhin.github.io/patron.site/#/source-with-pool */ type SourceWithPoolType = SourceObjectType & GuestObjectType & PoolAwareType; declare class SourceWithPool implements SourceWithPoolType { private sourceDocument?; private thePool; private theEmptyPool; private isEmpty; constructor(sourceDocument?: T | undefined); pool(): PatronPool; give(value: T): this; value(guest: GuestType): this; filled(): boolean; } /** * @url https://kosukhin.github.io/patron.site/#/utils/action-type */ interface ActionType

{ do(config: P): this; } interface SourceAcitveType extends SourceObjectType, ActionType { } /** * @url https://kosukhin.github.io/patron.site/#/guest/source-active */ declare class SourceActive implements SourceAcitveType { private configExecutor; private source; constructor(configExecutor: (config: R, source: SourceWithPoolType) => void); do(config: R): this; value(guest: GuestType): this; } /** * @url https://kosukhin.github.io/patron.site/#/source-dynamic */ declare class SourceDynamic implements SourceWithPoolType { private baseGuest; private baseSource; constructor(baseGuest: GuestType, baseSource: SourceType); value(guest: GuestType): this; give(value: T): this; pool(): PatronPool; } /** * @url https://kosukhin.github.io/patron.site/#/source/source-applied */ declare class SourceApplied implements SourceObjectType { private baseSource; private applier; constructor(baseSource: SourceType, applier: (v: T) => R); value(g: GuestType): this; } /** * @url https://kosukhin.github.io/patron.site/#/source/source-executor-applied */ declare class SourceExecutorApplied implements SourceObjectType { value: SourceExecutorType; constructor(source: SourceType, applier: (executor: SourceExecutorType) => SourceExecutorType); } /** * @url https://kosukhin.github.io/patron.site/#/source/source-once */ declare class SourceOnce implements SourceWithPoolType { private source; constructor(initialValue?: T); value(guest: GuestType): this; give(value: T): this; pool(): PatronPool; } interface Prototyped { prototype: T; } declare class PrivateClass implements PrivateType { private constructorFn; private modules; constructor(constructorFn: Prototyped, modules?: Record); get(...args: R): CT extends null ? T : CT; } export { type ActionType, Guest, GuestApplied, GuestCast, GuestDisposable, type GuestDisposableType, GuestExecutorApplied, type GuestExecutorType, GuestObject, type GuestObjectType, GuestPool, GuestSync, type GuestType, type GuestValueType, type MaybeDisposableType, Patron, PatronApplied, PatronExecutorApplied, PatronOnce, PatronPool, type PoolAwareType, type PoolType, Private, PrivateClass, type PrivateType, Source, type SourceAcitveType, SourceActive, SourceAll, type SourceAllType, SourceApplied, SourceDynamic, SourceExecutorApplied, type SourceExecutorType, SourceMap, type SourceObjectType, SourceOnce, SourceRace, SourceSequence, type SourceType, SourceWithPool, type SourceWithPoolType, give, isGuest, isPatron, isPatronInPools, isSource, patronPools, removePatronFromPools, sourceOf, value };