@dxos/echo-query 0.8.4-main.d05539e30a → 0.8.4-main.d9fc60f731
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/query-lite/index.d.ts +1168 -848
- package/dist/query-lite/index.d.ts.map +1 -1
- package/dist/query-lite/index.js +47 -31
- package/dist/query-lite/index.js.map +1 -1
- package/dist/types/src/query-lite/query-lite.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -16
- package/src/query-lite/query-lite.ts +125 -62
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import "@dxos/log";
|
|
1
|
+
import { inspect } from "node:util";
|
|
2
|
+
import { CallMetadata } from "@dxos/log";
|
|
4
3
|
|
|
5
4
|
//#region rolldown:runtime
|
|
6
5
|
|
|
@@ -4711,7 +4710,7 @@ declare namespace FastCheck_d_exports {
|
|
|
4711
4710
|
export { Arbitrary, ArrayConstraints$1 as ArrayConstraints, AsyncCommand, AsyncPropertyHookFunction, BigIntArrayConstraints, BigIntConstraints$1 as BigIntConstraints, BigUintConstraints, CloneValue, Command, CommandsContraints, ContextValue, DateConstraints$1 as DateConstraints, DepthContext, DepthIdentifier, DepthSize, DictionaryConstraints, DomainConstraints, DoubleConstraints, EmailAddressConstraints, ExecutionStatus, ExecutionTree, FalsyContraints, FalsyValue, Float32ArrayConstraints, Float64ArrayConstraints, FloatConstraints, GeneratorValue, GlobalAsyncPropertyHookFunction, GlobalParameters, GlobalPropertyHookFunction, IAsyncProperty, IAsyncPropertyWithHooks, ICommand, IProperty, IPropertyWithHooks, IRawProperty, IntArrayConstraints, IntegerConstraints, JsonSharedConstraints, JsonValue, LetrecLooselyTypedBuilder, LetrecLooselyTypedTie, LetrecTypedBuilder, LetrecTypedTie, LetrecValue, LoremConstraints, MaybeWeightedArbitrary, Memo, MixedCaseConstraints, ModelRunAsyncSetup, ModelRunSetup, NatConstraints, ObjectConstraints, OneOfConstraints, OneOfValue, OptionConstraints, Parameters$1 as Parameters, PreconditionFailure, PropertyFailure, PropertyHookFunction, Random, RandomType, RecordConstraints, RecordValue, RunDetails, RunDetailsCommon, RunDetailsFailureInterrupted, RunDetailsFailureProperty, RunDetailsFailureTooManySkips, RunDetailsSuccess, Scheduler, SchedulerAct, SchedulerConstraints, SchedulerReportItem, SchedulerSequenceItem, ShuffledSubarrayConstraints, Size, SizeForArbitrary, SparseArrayConstraints, Stream$1 as Stream, StringConstraints$1 as StringConstraints, StringMatchingConstraints, StringSharedConstraints, SubarrayConstraints, UnicodeJsonSharedConstraints, UniqueArrayConstraints, UniqueArrayConstraintsCustomCompare, UniqueArrayConstraintsCustomCompareSelect, UniqueArrayConstraintsRecommended, UniqueArraySharedConstraints, UuidConstraints, Value$1 as Value, VerbosityLevel, WebAuthorityConstraints, WebFragmentsConstraints, WebPathConstraints, WebQueryParametersConstraints, WebSegmentConstraints, WebUrlConstraints, WeightedArbitrary, WithAsyncToStringMethod, WithCloneMethod, WithToStringMethod, __commitHash, __type, __version, anything, array, ascii, asciiString, assert, asyncDefaultReportMessage, asyncModelRun, asyncProperty, asyncStringify, asyncToStringMethod, base64, base64String, bigInt, bigInt64Array, bigIntN, bigUint, bigUint64Array, bigUintN, boolean, char, char16bits, check, clone, cloneIfNeeded, cloneMethod, commands, compareBooleanFunc, compareFunc, configureGlobal, constant, constantFrom, context, createDepthIdentifier, date, defaultReportMessage, dictionary, domain, double, emailAddress, falsy, float, float32Array, float64Array, fullUnicode, fullUnicodeString, func, gen, getDepthContextFor, hasAsyncToStringMethod, hasCloneMethod, hasToStringMethod, hash, hexa, hexaString, infiniteStream, int16Array, int32Array, int8Array, integer, ipV4, ipV4Extended, ipV6, json, jsonValue, letrec, limitShrink, lorem, mapToConstant, maxSafeInteger, maxSafeNat, memo, mixedCase, modelRun, nat, noBias, noShrink, object, oneof, option, pre, property$1 as property, readConfigureGlobal, record, resetConfigureGlobal, sample, scheduledModelRun, scheduler, schedulerFor, shuffledSubarray, sparseArray, statistics, stream, string, string16bits, stringMatching, stringOf, stringify, subarray, toStringMethod, tuple, uint16Array, uint32Array, uint8Array, uint8ClampedArray, ulid, unicode, unicodeJson, unicodeJsonValue, unicodeString, uniqueArray, uuid, uuidV, webAuthority, webFragments, webPath, webQueryParameters, webSegment, webUrl };
|
|
4712
4711
|
}
|
|
4713
4712
|
//#endregion
|
|
4714
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
4713
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Arbitrary.d.ts
|
|
4715
4714
|
/**
|
|
4716
4715
|
* @category model
|
|
4717
4716
|
* @since 3.10.0
|
|
@@ -4756,7 +4755,7 @@ interface DateConstraints {
|
|
|
4756
4755
|
readonly constraints: DateConstraints$1;
|
|
4757
4756
|
}
|
|
4758
4757
|
//#endregion
|
|
4759
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
4758
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Types.d.ts
|
|
4760
4759
|
/**
|
|
4761
4760
|
* A utility type that transforms a union type `T` into an intersection type.
|
|
4762
4761
|
*
|
|
@@ -4846,12 +4845,8 @@ declare namespace Contravariant {
|
|
|
4846
4845
|
*/
|
|
4847
4846
|
type Type<A$1> = A$1 extends Contravariant<infer U> ? U : never;
|
|
4848
4847
|
}
|
|
4849
|
-
/**
|
|
4850
|
-
* @since 3.9.0
|
|
4851
|
-
*/
|
|
4852
|
-
type NoExcessProperties<T$1, U$1> = T$1 & { readonly [K in Exclude<keyof U$1, keyof T$1>]: never };
|
|
4853
4848
|
//#endregion
|
|
4854
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
4849
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Equivalence.d.ts
|
|
4855
4850
|
/**
|
|
4856
4851
|
* @category type class
|
|
4857
4852
|
* @since 2.0.0
|
|
@@ -4860,7 +4855,7 @@ interface Equivalence<in A$1> {
|
|
|
4860
4855
|
(self: A$1, that: A$1): boolean;
|
|
4861
4856
|
}
|
|
4862
4857
|
//#endregion
|
|
4863
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
4858
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Hash.d.ts
|
|
4864
4859
|
/**
|
|
4865
4860
|
* @since 2.0.0
|
|
4866
4861
|
* @category models
|
|
@@ -4869,7 +4864,7 @@ interface Hash {
|
|
|
4869
4864
|
[symbol](): number;
|
|
4870
4865
|
}
|
|
4871
4866
|
//#endregion
|
|
4872
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
4867
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Equal.d.ts
|
|
4873
4868
|
/**
|
|
4874
4869
|
* @since 2.0.0
|
|
4875
4870
|
* @category models
|
|
@@ -4878,7 +4873,7 @@ interface Equal extends Hash {
|
|
|
4878
4873
|
[symbol](that: Equal): boolean;
|
|
4879
4874
|
}
|
|
4880
4875
|
//#endregion
|
|
4881
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
4876
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Pipeable.d.ts
|
|
4882
4877
|
/**
|
|
4883
4878
|
* @since 2.0.0
|
|
4884
4879
|
* @category Models
|
|
@@ -4908,7 +4903,7 @@ interface Pipeable {
|
|
|
4908
4903
|
pipe<A$1, B$1 = never, C = never, D = never, E$1 = never, F = never, G = never, H$1 = never, I$1 = never, J = never, K$1 = never, L$1 = never, M = never, N = never, O = never, P$1 = never, Q = never, R$1 = never, S$1 = never, T$1 = never, U$1 = never>(this: A$1, ab: (_: A$1) => B$1, bc: (_: B$1) => C, cd: (_: C) => D, de: (_: D) => E$1, ef: (_: E$1) => F, fg: (_: F) => G, gh: (_: G) => H$1, hi: (_: H$1) => I$1, ij: (_: I$1) => J, jk: (_: J) => K$1, kl: (_: K$1) => L$1, lm: (_: L$1) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P$1, pq: (_: P$1) => Q, qr: (_: Q) => R$1, rs: (_: R$1) => S$1, st: (_: S$1) => T$1, tu: (_: T$1) => U$1): U$1;
|
|
4909
4904
|
}
|
|
4910
4905
|
//#endregion
|
|
4911
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
4906
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Unify.d.ts
|
|
4912
4907
|
/**
|
|
4913
4908
|
* @since 2.0.0
|
|
4914
4909
|
*/
|
|
@@ -4937,7 +4932,7 @@ declare const ignoreSymbol: unique symbol;
|
|
|
4937
4932
|
*/
|
|
4938
4933
|
type ignoreSymbol = typeof ignoreSymbol;
|
|
4939
4934
|
//#endregion
|
|
4940
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
4935
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Utils.d.ts
|
|
4941
4936
|
/**
|
|
4942
4937
|
* @since 3.0.6
|
|
4943
4938
|
*/
|
|
@@ -4954,7 +4949,7 @@ declare class YieldWrap<T$1> {
|
|
|
4954
4949
|
[YieldWrapTypeId](): T$1;
|
|
4955
4950
|
}
|
|
4956
4951
|
//#endregion
|
|
4957
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
4952
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Option.d.ts
|
|
4958
4953
|
/**
|
|
4959
4954
|
* The `Option` data type represents optional values. An `Option<A>` can either
|
|
4960
4955
|
* be `Some<A>`, containing a value of type `A`, or `None`, representing the
|
|
@@ -4978,12 +4973,12 @@ type Option<A$1> = None$1<A$1> | Some$1<A$1>;
|
|
|
4978
4973
|
* @category Symbols
|
|
4979
4974
|
* @since 2.0.0
|
|
4980
4975
|
*/
|
|
4981
|
-
declare const TypeId$
|
|
4976
|
+
declare const TypeId$5: unique symbol;
|
|
4982
4977
|
/**
|
|
4983
4978
|
* @category Symbols
|
|
4984
4979
|
* @since 2.0.0
|
|
4985
4980
|
*/
|
|
4986
|
-
type TypeId$
|
|
4981
|
+
type TypeId$5 = typeof TypeId$5;
|
|
4987
4982
|
/**
|
|
4988
4983
|
* @category Models
|
|
4989
4984
|
* @since 2.0.0
|
|
@@ -4991,7 +4986,7 @@ type TypeId$4 = typeof TypeId$4;
|
|
|
4991
4986
|
interface None$1<out A$1> extends Pipeable, Inspectable {
|
|
4992
4987
|
readonly _tag: "None";
|
|
4993
4988
|
readonly _op: "None";
|
|
4994
|
-
readonly [TypeId$
|
|
4989
|
+
readonly [TypeId$5]: {
|
|
4995
4990
|
readonly _A: Covariant<A$1>;
|
|
4996
4991
|
};
|
|
4997
4992
|
[typeSymbol]?: unknown;
|
|
@@ -5006,7 +5001,7 @@ interface Some$1<out A$1> extends Pipeable, Inspectable {
|
|
|
5006
5001
|
readonly _tag: "Some";
|
|
5007
5002
|
readonly _op: "Some";
|
|
5008
5003
|
readonly value: A$1;
|
|
5009
|
-
readonly [TypeId$
|
|
5004
|
+
readonly [TypeId$5]: {
|
|
5010
5005
|
readonly _A: Covariant<A$1>;
|
|
5011
5006
|
};
|
|
5012
5007
|
[typeSymbol]?: unknown;
|
|
@@ -5055,7 +5050,7 @@ declare namespace Option {
|
|
|
5055
5050
|
*/
|
|
5056
5051
|
interface OptionUnifyIgnore {}
|
|
5057
5052
|
//#endregion
|
|
5058
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
5053
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Context.d.ts
|
|
5059
5054
|
/**
|
|
5060
5055
|
* @since 2.0.0
|
|
5061
5056
|
* @category symbol
|
|
@@ -5079,7 +5074,7 @@ interface Tag$2<in out Id$1, in out Value$2> extends Pipeable, Inspectable, Read
|
|
|
5079
5074
|
readonly _Identifier: Invariant<Id$1>;
|
|
5080
5075
|
};
|
|
5081
5076
|
of(self: Value$2): Value$2;
|
|
5082
|
-
context(self: Value$2): Context$
|
|
5077
|
+
context(self: Value$2): Context$2<Id$1>;
|
|
5083
5078
|
readonly stack?: string | undefined;
|
|
5084
5079
|
readonly key: string;
|
|
5085
5080
|
[typeSymbol]?: unknown;
|
|
@@ -5090,7 +5085,7 @@ interface Tag$2<in out Id$1, in out Value$2> extends Pipeable, Inspectable, Read
|
|
|
5090
5085
|
* @since 3.5.9
|
|
5091
5086
|
* @category models
|
|
5092
5087
|
*/
|
|
5093
|
-
interface ReadonlyTag<in out Id$1, out Value$2> extends Pipeable, Inspectable, Effect<Value$2, never, Id$1> {
|
|
5088
|
+
interface ReadonlyTag<in out Id$1, out Value$2> extends Pipeable, Inspectable, Effect$1<Value$2, never, Id$1> {
|
|
5094
5089
|
readonly _op: "Tag";
|
|
5095
5090
|
readonly Service: Value$2;
|
|
5096
5091
|
readonly Identifier: Id$1;
|
|
@@ -5114,8 +5109,8 @@ interface TagClassShape<Id$1, Shape> {
|
|
|
5114
5109
|
* @since 2.0.0
|
|
5115
5110
|
* @category models
|
|
5116
5111
|
*/
|
|
5117
|
-
interface TagClass<Self, Id$1 extends string, Type$
|
|
5118
|
-
new (_: never): TagClassShape<Id$1, Type$
|
|
5112
|
+
interface TagClass<Self, Id$1 extends string, Type$6> extends Tag$2<Self, Type$6> {
|
|
5113
|
+
new (_: never): TagClassShape<Id$1, Type$6>;
|
|
5119
5114
|
readonly key: Id$1;
|
|
5120
5115
|
}
|
|
5121
5116
|
/**
|
|
@@ -5145,18 +5140,18 @@ declare namespace Tag$2 {
|
|
|
5145
5140
|
*/
|
|
5146
5141
|
type Identifier<T$1 extends Tag$2<any, any> | TagClassShape<any, any>> = T$1 extends Tag$2<any, any> ? T$1["Identifier"] : T$1 extends TagClassShape<any, any> ? T$1 : never;
|
|
5147
5142
|
}
|
|
5148
|
-
declare const TypeId$
|
|
5143
|
+
declare const TypeId$4: unique symbol;
|
|
5149
5144
|
/**
|
|
5150
5145
|
* @since 2.0.0
|
|
5151
5146
|
* @category symbol
|
|
5152
5147
|
*/
|
|
5153
|
-
type TypeId$
|
|
5148
|
+
type TypeId$4 = typeof TypeId$4;
|
|
5154
5149
|
/**
|
|
5155
5150
|
* @since 2.0.0
|
|
5156
5151
|
* @category models
|
|
5157
5152
|
*/
|
|
5158
|
-
interface Context$
|
|
5159
|
-
readonly [TypeId$
|
|
5153
|
+
interface Context$2<in Services> extends Equal, Pipeable, Inspectable {
|
|
5154
|
+
readonly [TypeId$4]: {
|
|
5160
5155
|
readonly _Services: Contravariant<Services>;
|
|
5161
5156
|
};
|
|
5162
5157
|
readonly unsafeMap: Map<string, any>;
|
|
@@ -5180,7 +5175,7 @@ interface Context$1<in Services> extends Equal, Pipeable, Inspectable {
|
|
|
5180
5175
|
*/
|
|
5181
5176
|
declare const Tag$2: <const Id$1 extends string>(id: Id$1) => <Self, Shape>() => TagClass<Self, Id$1, Shape>;
|
|
5182
5177
|
//#endregion
|
|
5183
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
5178
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Sink.d.ts
|
|
5184
5179
|
/**
|
|
5185
5180
|
* @since 2.0.0
|
|
5186
5181
|
* @category symbols
|
|
@@ -5236,7 +5231,7 @@ declare namespace Sink {
|
|
|
5236
5231
|
}
|
|
5237
5232
|
}
|
|
5238
5233
|
//#endregion
|
|
5239
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
5234
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/STM.d.ts
|
|
5240
5235
|
/**
|
|
5241
5236
|
* @since 2.0.0
|
|
5242
5237
|
* @category symbols
|
|
@@ -5284,7 +5279,7 @@ type STMTypeId = typeof STMTypeId;
|
|
|
5284
5279
|
* @since 2.0.0
|
|
5285
5280
|
* @category models
|
|
5286
5281
|
*/
|
|
5287
|
-
interface STM<out A$1, out E$1 = never, out R$1 = never> extends Effect<A$1, E$1, R$1>, STM.Variance<A$1, E$1, R$1>, Pipeable {
|
|
5282
|
+
interface STM<out A$1, out E$1 = never, out R$1 = never> extends Effect$1<A$1, E$1, R$1>, STM.Variance<A$1, E$1, R$1>, Pipeable {
|
|
5288
5283
|
[typeSymbol]?: unknown;
|
|
5289
5284
|
[unifySymbol]?: STMUnify<this>;
|
|
5290
5285
|
[ignoreSymbol]?: STMUnifyIgnore;
|
|
@@ -5355,7 +5350,7 @@ declare namespace STM {
|
|
|
5355
5350
|
}
|
|
5356
5351
|
}
|
|
5357
5352
|
//#endregion
|
|
5358
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
5353
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Stream.d.ts
|
|
5359
5354
|
/**
|
|
5360
5355
|
* @since 2.0.0
|
|
5361
5356
|
* @category symbols
|
|
@@ -5468,7 +5463,7 @@ declare namespace Stream {
|
|
|
5468
5463
|
type DynamicTupleOf<T$1, N extends number, R$1 extends Array<unknown>> = R$1["length"] extends N ? R$1 : DynamicTupleOf<T$1, N, [T$1, ...R$1]>;
|
|
5469
5464
|
}
|
|
5470
5465
|
//#endregion
|
|
5471
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
5466
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Channel.d.ts
|
|
5472
5467
|
/**
|
|
5473
5468
|
* @since 2.0.0
|
|
5474
5469
|
* @category symbols
|
|
@@ -5562,7 +5557,7 @@ declare namespace Channel {
|
|
|
5562
5557
|
}
|
|
5563
5558
|
}
|
|
5564
5559
|
//#endregion
|
|
5565
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
5560
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Cause.d.ts
|
|
5566
5561
|
/**
|
|
5567
5562
|
* A unique symbol identifying the `NoSuchElementException` type.
|
|
5568
5563
|
*
|
|
@@ -5610,11 +5605,11 @@ type UnknownExceptionTypeId = typeof UnknownExceptionTypeId;
|
|
|
5610
5605
|
* @category Models
|
|
5611
5606
|
*/
|
|
5612
5607
|
interface YieldableError extends Pipeable, Inspectable, Error {
|
|
5613
|
-
readonly [EffectTypeId]: Effect.VarianceStruct<never, this, never>;
|
|
5608
|
+
readonly [EffectTypeId]: Effect$1.VarianceStruct<never, this, never>;
|
|
5614
5609
|
readonly [StreamTypeId]: Stream.VarianceStruct<never, this, never>;
|
|
5615
5610
|
readonly [SinkTypeId]: Sink.VarianceStruct<never, unknown, never, this, never>;
|
|
5616
5611
|
readonly [ChannelTypeId]: Channel.VarianceStruct<never, unknown, this, unknown, never, unknown, never>;
|
|
5617
|
-
[Symbol.iterator](): EffectGenerator<Effect<never, this, never>>;
|
|
5612
|
+
[Symbol.iterator](): EffectGenerator<Effect$1<never, this, never>>;
|
|
5618
5613
|
}
|
|
5619
5614
|
/**
|
|
5620
5615
|
* Creates an error that occurs at runtime, extendable for other exception
|
|
@@ -5702,7 +5697,7 @@ declare const NoSuchElementException: new (message?: string | undefined) => NoSu
|
|
|
5702
5697
|
*/
|
|
5703
5698
|
declare const UnknownException: new (error: unknown, message?: string | undefined) => UnknownException;
|
|
5704
5699
|
//#endregion
|
|
5705
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
5700
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Effect.d.ts
|
|
5706
5701
|
/**
|
|
5707
5702
|
* @since 2.0.0
|
|
5708
5703
|
* @category Symbols
|
|
@@ -5735,18 +5730,18 @@ type EffectTypeId = typeof EffectTypeId;
|
|
|
5735
5730
|
* @since 2.0.0
|
|
5736
5731
|
* @category Models
|
|
5737
5732
|
*/
|
|
5738
|
-
interface Effect<out A$1, out E$1 = never, out R$1 = never> extends Effect.Variance<A$1, E$1, R$1>, Pipeable {
|
|
5733
|
+
interface Effect$1<out A$1, out E$1 = never, out R$1 = never> extends Effect$1.Variance<A$1, E$1, R$1>, Pipeable {
|
|
5739
5734
|
readonly [typeSymbol]?: unknown;
|
|
5740
5735
|
readonly [unifySymbol]?: EffectUnify<this>;
|
|
5741
5736
|
readonly [ignoreSymbol]?: EffectUnifyIgnore;
|
|
5742
|
-
[Symbol.iterator](): EffectGenerator<Effect<A$1, E$1, R$1>>;
|
|
5737
|
+
[Symbol.iterator](): EffectGenerator<Effect$1<A$1, E$1, R$1>>;
|
|
5743
5738
|
}
|
|
5744
5739
|
/**
|
|
5745
5740
|
* @since 3.0.0
|
|
5746
5741
|
* @category Models
|
|
5747
5742
|
*/
|
|
5748
|
-
interface EffectGenerator<T$1 extends Effect<any, any, any>> {
|
|
5749
|
-
next(...args: ReadonlyArray<any>): IteratorResult<YieldWrap<T$1>, Effect.Success<T$1>>;
|
|
5743
|
+
interface EffectGenerator<T$1 extends Effect$1<any, any, any>> {
|
|
5744
|
+
next(...args: ReadonlyArray<any>): IteratorResult<YieldWrap<T$1>, Effect$1.Success<T$1>>;
|
|
5750
5745
|
}
|
|
5751
5746
|
/**
|
|
5752
5747
|
* @since 2.0.0
|
|
@@ -5755,7 +5750,7 @@ interface EffectGenerator<T$1 extends Effect<any, any, any>> {
|
|
|
5755
5750
|
interface EffectUnify<A$1 extends {
|
|
5756
5751
|
[typeSymbol]?: any;
|
|
5757
5752
|
}> extends EitherUnify<A$1>, OptionUnify<A$1>, TagUnify<A$1> {
|
|
5758
|
-
Effect?: () => A$1[typeSymbol] extends Effect<infer A0, infer E0, infer R0> | infer _ ? Effect<A0, E0, R0> : never;
|
|
5753
|
+
Effect?: () => A$1[typeSymbol] extends Effect$1<infer A0, infer E0, infer R0> | infer _ ? Effect$1<A0, E0, R0> : never;
|
|
5759
5754
|
}
|
|
5760
5755
|
/**
|
|
5761
5756
|
* @category Models
|
|
@@ -5771,10 +5766,10 @@ interface EffectUnifyIgnore {
|
|
|
5771
5766
|
* @category Models
|
|
5772
5767
|
*/
|
|
5773
5768
|
declare module "./Context.js" {
|
|
5774
|
-
interface Tag<Id$1, Value$2> extends Effect<Value$2, never, Id$1> {
|
|
5769
|
+
interface Tag<Id$1, Value$2> extends Effect$1<Value$2, never, Id$1> {
|
|
5775
5770
|
[Symbol.iterator](): EffectGenerator<Tag$1<Id$1, Value$2>>;
|
|
5776
5771
|
}
|
|
5777
|
-
interface Reference<Id$1, Value$2> extends Effect<Value$2> {
|
|
5772
|
+
interface Reference<Id$1, Value$2> extends Effect$1<Value$2> {
|
|
5778
5773
|
[Symbol.iterator](): EffectGenerator<Reference<Id$1, Value$2>>;
|
|
5779
5774
|
}
|
|
5780
5775
|
interface TagUnifyIgnore {
|
|
@@ -5788,11 +5783,11 @@ declare module "./Context.js" {
|
|
|
5788
5783
|
* @category Models
|
|
5789
5784
|
*/
|
|
5790
5785
|
declare module "./Either.js" {
|
|
5791
|
-
interface Left<E$1, A$1> extends Effect<A$1, E$1> {
|
|
5786
|
+
interface Left<E$1, A$1> extends Effect$1<A$1, E$1> {
|
|
5792
5787
|
readonly _tag: "Left";
|
|
5793
5788
|
[Symbol.iterator](): EffectGenerator<Left<E$1, A$1>>;
|
|
5794
5789
|
}
|
|
5795
|
-
interface Right<E$1, A$1> extends Effect<A$1, E$1> {
|
|
5790
|
+
interface Right<E$1, A$1> extends Effect$1<A$1, E$1> {
|
|
5796
5791
|
readonly _tag: "Right";
|
|
5797
5792
|
[Symbol.iterator](): EffectGenerator<Right<E$1, A$1>>;
|
|
5798
5793
|
}
|
|
@@ -5807,11 +5802,11 @@ declare module "./Either.js" {
|
|
|
5807
5802
|
* @category Models
|
|
5808
5803
|
*/
|
|
5809
5804
|
declare module "./Option.js" {
|
|
5810
|
-
interface None<A$1> extends Effect<A$1, NoSuchElementException> {
|
|
5805
|
+
interface None<A$1> extends Effect$1<A$1, NoSuchElementException> {
|
|
5811
5806
|
readonly _tag: "None";
|
|
5812
5807
|
[Symbol.iterator](): EffectGenerator<None<A$1>>;
|
|
5813
5808
|
}
|
|
5814
|
-
interface Some<A$1> extends Effect<A$1, NoSuchElementException> {
|
|
5809
|
+
interface Some<A$1> extends Effect$1<A$1, NoSuchElementException> {
|
|
5815
5810
|
readonly _tag: "Some";
|
|
5816
5811
|
[Symbol.iterator](): EffectGenerator<Some<A$1>>;
|
|
5817
5812
|
}
|
|
@@ -5824,7 +5819,7 @@ declare module "./Option.js" {
|
|
|
5824
5819
|
/**
|
|
5825
5820
|
* @since 2.0.0
|
|
5826
5821
|
*/
|
|
5827
|
-
declare namespace Effect {
|
|
5822
|
+
declare namespace Effect$1 {
|
|
5828
5823
|
/**
|
|
5829
5824
|
* @since 2.0.0
|
|
5830
5825
|
* @category Models
|
|
@@ -5846,22 +5841,22 @@ declare namespace Effect {
|
|
|
5846
5841
|
* @since 2.0.0
|
|
5847
5842
|
* @category Effect Type Extractors
|
|
5848
5843
|
*/
|
|
5849
|
-
type Context<T$1 extends Effect<any, any, any>> = [T$1] extends [Effect<infer _A, infer _E, infer _R>] ? _R : never;
|
|
5844
|
+
type Context<T$1 extends Effect$1<any, any, any>> = [T$1] extends [Effect$1<infer _A, infer _E, infer _R>] ? _R : never;
|
|
5850
5845
|
/**
|
|
5851
5846
|
* @since 2.0.0
|
|
5852
5847
|
* @category Effect Type Extractors
|
|
5853
5848
|
*/
|
|
5854
|
-
type Error<T$1 extends Effect<any, any, any>> = [T$1] extends [Effect<infer _A, infer _E, infer _R>] ? _E : never;
|
|
5849
|
+
type Error<T$1 extends Effect$1<any, any, any>> = [T$1] extends [Effect$1<infer _A, infer _E, infer _R>] ? _E : never;
|
|
5855
5850
|
/**
|
|
5856
5851
|
* @since 2.0.0
|
|
5857
5852
|
* @category Effect Type Extractors
|
|
5858
5853
|
*/
|
|
5859
|
-
type Success<T$1 extends Effect<any, any, any>> = [T$1] extends [Effect<infer _A, infer _E, infer _R>] ? _A : never;
|
|
5854
|
+
type Success<T$1 extends Effect$1<any, any, any>> = [T$1] extends [Effect$1<infer _A, infer _E, infer _R>] ? _A : never;
|
|
5860
5855
|
/**
|
|
5861
5856
|
* @since 3.15.5
|
|
5862
5857
|
* @category Effect Type Extractors
|
|
5863
5858
|
*/
|
|
5864
|
-
type AsEffect<T$1 extends Effect<any, any, any>> = Effect<T$1 extends Effect<infer _A, infer _E, infer _R> ? _A : never, T$1 extends Effect<infer _A, infer _E, infer _R> ? _E : never, T$1 extends Effect<infer _A, infer _E, infer _R> ? _R : never> extends infer Q ? Q : never;
|
|
5859
|
+
type AsEffect<T$1 extends Effect$1<any, any, any>> = Effect$1<T$1 extends Effect$1<infer _A, infer _E, infer _R> ? _A : never, T$1 extends Effect$1<infer _A, infer _E, infer _R> ? _E : never, T$1 extends Effect$1<infer _A, infer _E, infer _R> ? _R : never> extends infer Q ? Q : never;
|
|
5865
5860
|
}
|
|
5866
5861
|
/**
|
|
5867
5862
|
* @since 2.0.0
|
|
@@ -5893,7 +5888,7 @@ declare namespace Tag$1 {
|
|
|
5893
5888
|
* @since 3.9.0
|
|
5894
5889
|
* @category Models
|
|
5895
5890
|
*/
|
|
5896
|
-
type Proxy<Self, Type$
|
|
5891
|
+
type Proxy<Self, Type$6> = { [k in keyof Type$6 as Type$6[k] extends ((...args: infer Args extends ReadonlyArray<any>) => infer Ret) ? ((...args: Readonly<Args>) => Ret) extends Type$6[k] ? k : never : k]: Type$6[k] extends ((...args: infer Args extends ReadonlyArray<any>) => Effect$1<infer A, infer E, infer R>) ? (...args: Readonly<Args>) => Effect$1<A, E, Self | R> : Type$6[k] extends ((...args: infer Args extends ReadonlyArray<any>) => Promise<infer A>) ? (...args: Readonly<Args>) => Effect$1<A, UnknownException, Self> : Type$6[k] extends ((...args: infer Args extends ReadonlyArray<any>) => infer A) ? (...args: Readonly<Args>) => Effect$1<A, never, Self> : Type$6[k] extends Effect$1<infer A, infer E, infer R> ? Effect$1<A, E, Self | R> : Effect$1<Type$6[k], never, Self> };
|
|
5897
5892
|
}
|
|
5898
5893
|
/**
|
|
5899
5894
|
* Creates a unique tag for a dependency, embedding the service's methods as
|
|
@@ -5928,11 +5923,11 @@ declare namespace Tag$1 {
|
|
|
5928
5923
|
* @since 2.0.0
|
|
5929
5924
|
* @category Context
|
|
5930
5925
|
*/
|
|
5931
|
-
declare const Tag$1: <const Id$1 extends string>(id: Id$1) => <Self, Type$
|
|
5932
|
-
use: <X>(body: (_: Type$
|
|
5926
|
+
declare const Tag$1: <const Id$1 extends string>(id: Id$1) => <Self, Type$6 extends Tag$1.AllowedType>() => TagClass<Self, Id$1, Type$6> & (Type$6 extends Record<PropertyKey, any> ? Tag$1.Proxy<Self, Type$6> : {}) & {
|
|
5927
|
+
use: <X>(body: (_: Type$6) => X) => [X] extends [Effect$1<infer A, infer E, infer R>] ? Effect$1<A, E, R | Self> : [X] extends [PromiseLike<infer A>] ? Effect$1<A, UnknownException, Self> : Effect$1<X, never, Self>;
|
|
5933
5928
|
};
|
|
5934
5929
|
//#endregion
|
|
5935
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
5930
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Inspectable.d.ts
|
|
5936
5931
|
/**
|
|
5937
5932
|
* @since 2.0.0
|
|
5938
5933
|
* @category models
|
|
@@ -5943,7 +5938,7 @@ interface Inspectable {
|
|
|
5943
5938
|
[NodeInspectSymbol](): unknown;
|
|
5944
5939
|
}
|
|
5945
5940
|
//#endregion
|
|
5946
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
5941
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Either.d.ts
|
|
5947
5942
|
/**
|
|
5948
5943
|
* @category models
|
|
5949
5944
|
* @since 2.0.0
|
|
@@ -5953,12 +5948,12 @@ type Either<A$1, E$1 = never> = Left$1<E$1, A$1> | Right$1<E$1, A$1>;
|
|
|
5953
5948
|
* @category symbols
|
|
5954
5949
|
* @since 2.0.0
|
|
5955
5950
|
*/
|
|
5956
|
-
declare const TypeId$
|
|
5951
|
+
declare const TypeId$3: unique symbol;
|
|
5957
5952
|
/**
|
|
5958
5953
|
* @category symbols
|
|
5959
5954
|
* @since 2.0.0
|
|
5960
5955
|
*/
|
|
5961
|
-
type TypeId$
|
|
5956
|
+
type TypeId$3 = typeof TypeId$3;
|
|
5962
5957
|
/**
|
|
5963
5958
|
* @category models
|
|
5964
5959
|
* @since 2.0.0
|
|
@@ -5967,7 +5962,7 @@ interface Left$1<out E$1, out A$1> extends Pipeable, Inspectable {
|
|
|
5967
5962
|
readonly _tag: "Left";
|
|
5968
5963
|
readonly _op: "Left";
|
|
5969
5964
|
readonly left: E$1;
|
|
5970
|
-
readonly [TypeId$
|
|
5965
|
+
readonly [TypeId$3]: {
|
|
5971
5966
|
readonly _R: Covariant<A$1>;
|
|
5972
5967
|
readonly _L: Covariant<E$1>;
|
|
5973
5968
|
};
|
|
@@ -5983,7 +5978,7 @@ interface Right$1<out E$1, out A$1> extends Pipeable, Inspectable {
|
|
|
5983
5978
|
readonly _tag: "Right";
|
|
5984
5979
|
readonly _op: "Right";
|
|
5985
5980
|
readonly right: A$1;
|
|
5986
|
-
readonly [TypeId$
|
|
5981
|
+
readonly [TypeId$3]: {
|
|
5987
5982
|
readonly _R: Covariant<A$1>;
|
|
5988
5983
|
readonly _L: Covariant<E$1>;
|
|
5989
5984
|
};
|
|
@@ -6021,7 +6016,7 @@ declare namespace Either {
|
|
|
6021
6016
|
type Right<T$1 extends Either<any, any>> = [T$1] extends [Either<infer _A, infer _E>] ? _A : never;
|
|
6022
6017
|
}
|
|
6023
6018
|
//#endregion
|
|
6024
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
6019
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Array.d.ts
|
|
6025
6020
|
/**
|
|
6026
6021
|
* @category models
|
|
6027
6022
|
* @since 2.0.0
|
|
@@ -6033,7 +6028,7 @@ type NonEmptyReadonlyArray<A$1> = readonly [A$1, ...Array<A$1>];
|
|
|
6033
6028
|
*/
|
|
6034
6029
|
type NonEmptyArray<A$1> = [A$1, ...Array<A$1>];
|
|
6035
6030
|
//#endregion
|
|
6036
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
6031
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/SchemaAST.d.ts
|
|
6037
6032
|
/**
|
|
6038
6033
|
* @category model
|
|
6039
6034
|
* @since 3.10.0
|
|
@@ -6057,15 +6052,15 @@ type SchemaIdAnnotation = string | symbol;
|
|
|
6057
6052
|
* @category annotations
|
|
6058
6053
|
* @since 3.10.0
|
|
6059
6054
|
*/
|
|
6060
|
-
type MessageAnnotation = (issue: ParseIssue) => string | Effect<string> | {
|
|
6061
|
-
readonly message: string | Effect<string>;
|
|
6055
|
+
type MessageAnnotation = (issue: ParseIssue) => string | Effect$1<string> | {
|
|
6056
|
+
readonly message: string | Effect$1<string>;
|
|
6062
6057
|
readonly override: boolean;
|
|
6063
6058
|
};
|
|
6064
6059
|
/**
|
|
6065
6060
|
* @category annotations
|
|
6066
6061
|
* @since 3.10.0
|
|
6067
6062
|
*/
|
|
6068
|
-
type MissingMessageAnnotation = () => string | Effect<string>;
|
|
6063
|
+
type MissingMessageAnnotation = () => string | Effect$1<string>;
|
|
6069
6064
|
/**
|
|
6070
6065
|
* @category annotations
|
|
6071
6066
|
* @since 3.10.0
|
|
@@ -6125,7 +6120,7 @@ type ParseIssueTitleAnnotation = (issue: ParseIssue) => string | undefined;
|
|
|
6125
6120
|
* @category annotations
|
|
6126
6121
|
* @since 3.10.0
|
|
6127
6122
|
*/
|
|
6128
|
-
type DecodingFallbackAnnotation<A$1> = (issue: ParseIssue) => Effect<A$1, ParseIssue>;
|
|
6123
|
+
type DecodingFallbackAnnotation<A$1> = (issue: ParseIssue) => Effect$1<A$1, ParseIssue>;
|
|
6129
6124
|
/**
|
|
6130
6125
|
* @category annotations
|
|
6131
6126
|
* @since 3.10.0
|
|
@@ -6147,14 +6142,14 @@ interface Annotated {
|
|
|
6147
6142
|
*/
|
|
6148
6143
|
declare class Declaration implements Annotated {
|
|
6149
6144
|
readonly typeParameters: ReadonlyArray<AST>;
|
|
6150
|
-
readonly decodeUnknown: (...typeParameters: ReadonlyArray<AST>) => (input: unknown, options: ParseOptions, self: Declaration) => Effect<any, ParseIssue, any>;
|
|
6151
|
-
readonly encodeUnknown: (...typeParameters: ReadonlyArray<AST>) => (input: unknown, options: ParseOptions, self: Declaration) => Effect<any, ParseIssue, any>;
|
|
6145
|
+
readonly decodeUnknown: (...typeParameters: ReadonlyArray<AST>) => (input: unknown, options: ParseOptions, self: Declaration) => Effect$1<any, ParseIssue, any>;
|
|
6146
|
+
readonly encodeUnknown: (...typeParameters: ReadonlyArray<AST>) => (input: unknown, options: ParseOptions, self: Declaration) => Effect$1<any, ParseIssue, any>;
|
|
6152
6147
|
readonly annotations: Annotations$1;
|
|
6153
6148
|
/**
|
|
6154
6149
|
* @since 3.10.0
|
|
6155
6150
|
*/
|
|
6156
6151
|
readonly _tag = "Declaration";
|
|
6157
|
-
constructor(typeParameters: ReadonlyArray<AST>, decodeUnknown: (...typeParameters: ReadonlyArray<AST>) => (input: unknown, options: ParseOptions, self: Declaration) => Effect<any, ParseIssue, any>, encodeUnknown: (...typeParameters: ReadonlyArray<AST>) => (input: unknown, options: ParseOptions, self: Declaration) => Effect<any, ParseIssue, any>, annotations?: Annotations$1);
|
|
6152
|
+
constructor(typeParameters: ReadonlyArray<AST>, decodeUnknown: (...typeParameters: ReadonlyArray<AST>) => (input: unknown, options: ParseOptions, self: Declaration) => Effect$1<any, ParseIssue, any>, encodeUnknown: (...typeParameters: ReadonlyArray<AST>) => (input: unknown, options: ParseOptions, self: Declaration) => Effect$1<any, ParseIssue, any>, annotations?: Annotations$1);
|
|
6158
6153
|
/**
|
|
6159
6154
|
* @since 3.10.0
|
|
6160
6155
|
*/
|
|
@@ -6500,7 +6495,7 @@ declare class TemplateLiteral implements Annotated {
|
|
|
6500
6495
|
* @category model
|
|
6501
6496
|
* @since 3.10.0
|
|
6502
6497
|
*/
|
|
6503
|
-
declare class Type$
|
|
6498
|
+
declare class Type$5 implements Annotated {
|
|
6504
6499
|
readonly type: AST;
|
|
6505
6500
|
readonly annotations: Annotations$1;
|
|
6506
6501
|
constructor(type: AST, annotations?: Annotations$1);
|
|
@@ -6517,7 +6512,7 @@ declare class Type$4 implements Annotated {
|
|
|
6517
6512
|
* @category model
|
|
6518
6513
|
* @since 3.10.0
|
|
6519
6514
|
*/
|
|
6520
|
-
declare class OptionalType extends Type$
|
|
6515
|
+
declare class OptionalType extends Type$5 {
|
|
6521
6516
|
readonly isOptional: boolean;
|
|
6522
6517
|
constructor(type: AST, isOptional: boolean, annotations?: Annotations$1);
|
|
6523
6518
|
/**
|
|
@@ -6535,14 +6530,14 @@ declare class OptionalType extends Type$4 {
|
|
|
6535
6530
|
*/
|
|
6536
6531
|
declare class TupleType$1 implements Annotated {
|
|
6537
6532
|
readonly elements: ReadonlyArray<OptionalType>;
|
|
6538
|
-
readonly rest: ReadonlyArray<Type$
|
|
6533
|
+
readonly rest: ReadonlyArray<Type$5>;
|
|
6539
6534
|
readonly isReadonly: boolean;
|
|
6540
6535
|
readonly annotations: Annotations$1;
|
|
6541
6536
|
/**
|
|
6542
6537
|
* @since 3.10.0
|
|
6543
6538
|
*/
|
|
6544
6539
|
readonly _tag = "TupleType";
|
|
6545
|
-
constructor(elements: ReadonlyArray<OptionalType>, rest: ReadonlyArray<Type$
|
|
6540
|
+
constructor(elements: ReadonlyArray<OptionalType>, rest: ReadonlyArray<Type$5>, isReadonly: boolean, annotations?: Annotations$1);
|
|
6546
6541
|
/**
|
|
6547
6542
|
* @since 3.10.0
|
|
6548
6543
|
*/
|
|
@@ -6793,13 +6788,13 @@ type TransformationKind = FinalTransformation | ComposeTransformation | TypeLite
|
|
|
6793
6788
|
* @since 3.10.0
|
|
6794
6789
|
*/
|
|
6795
6790
|
declare class FinalTransformation {
|
|
6796
|
-
readonly decode: (fromA: any, options: ParseOptions, self: Transformation$1, fromI: any) => Effect<any, ParseIssue, any>;
|
|
6797
|
-
readonly encode: (toI: any, options: ParseOptions, self: Transformation$1, toA: any) => Effect<any, ParseIssue, any>;
|
|
6791
|
+
readonly decode: (fromA: any, options: ParseOptions, self: Transformation$1, fromI: any) => Effect$1<any, ParseIssue, any>;
|
|
6792
|
+
readonly encode: (toI: any, options: ParseOptions, self: Transformation$1, toA: any) => Effect$1<any, ParseIssue, any>;
|
|
6798
6793
|
/**
|
|
6799
6794
|
* @since 3.10.0
|
|
6800
6795
|
*/
|
|
6801
6796
|
readonly _tag = "FinalTransformation";
|
|
6802
|
-
constructor(decode: (fromA: any, options: ParseOptions, self: Transformation$1, fromI: any) => Effect<any, ParseIssue, any>, encode: (toI: any, options: ParseOptions, self: Transformation$1, toA: any) => Effect<any, ParseIssue, any>);
|
|
6797
|
+
constructor(decode: (fromA: any, options: ParseOptions, self: Transformation$1, fromI: any) => Effect$1<any, ParseIssue, any>, encode: (toI: any, options: ParseOptions, self: Transformation$1, toA: any) => Effect$1<any, ParseIssue, any>);
|
|
6803
6798
|
}
|
|
6804
6799
|
/**
|
|
6805
6800
|
* @category model
|
|
@@ -6845,14 +6840,14 @@ declare class TypeLiteralTransformation {
|
|
|
6845
6840
|
constructor(propertySignatureTransformations: ReadonlyArray<PropertySignatureTransformation$1>);
|
|
6846
6841
|
}
|
|
6847
6842
|
//#endregion
|
|
6848
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
6843
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/ParseResult.d.ts
|
|
6849
6844
|
/**
|
|
6850
6845
|
* `ParseIssue` is a type that represents the different types of errors that can occur when decoding/encoding a value.
|
|
6851
6846
|
*
|
|
6852
6847
|
* @category model
|
|
6853
6848
|
* @since 3.10.0
|
|
6854
6849
|
*/
|
|
6855
|
-
type ParseIssue = Type$
|
|
6850
|
+
type ParseIssue = Type$4 | Missing | Unexpected | Forbidden | Pointer | Refinement | Transformation | Composite;
|
|
6856
6851
|
/**
|
|
6857
6852
|
* @category model
|
|
6858
6853
|
* @since 3.10.0
|
|
@@ -6909,7 +6904,7 @@ declare class Missing {
|
|
|
6909
6904
|
/**
|
|
6910
6905
|
* @since 3.10.0
|
|
6911
6906
|
*/
|
|
6912
|
-
readonly ast: Type$
|
|
6907
|
+
readonly ast: Type$5;
|
|
6913
6908
|
/**
|
|
6914
6909
|
* @since 3.10.0
|
|
6915
6910
|
*/
|
|
@@ -6926,7 +6921,7 @@ declare class Missing {
|
|
|
6926
6921
|
/**
|
|
6927
6922
|
* @since 3.10.0
|
|
6928
6923
|
*/
|
|
6929
|
-
ast: Type$
|
|
6924
|
+
ast: Type$5,
|
|
6930
6925
|
/**
|
|
6931
6926
|
* @since 3.10.0
|
|
6932
6927
|
*/
|
|
@@ -6990,7 +6985,7 @@ declare class Transformation {
|
|
|
6990
6985
|
* @category model
|
|
6991
6986
|
* @since 3.10.0
|
|
6992
6987
|
*/
|
|
6993
|
-
declare class Type$
|
|
6988
|
+
declare class Type$4 {
|
|
6994
6989
|
readonly ast: AST;
|
|
6995
6990
|
readonly actual: unknown;
|
|
6996
6991
|
readonly message?: string | undefined;
|
|
@@ -7017,7 +7012,7 @@ declare class Forbidden {
|
|
|
7017
7012
|
constructor(ast: AST, actual: unknown, message?: string | undefined);
|
|
7018
7013
|
}
|
|
7019
7014
|
//#endregion
|
|
7020
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
7015
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Pretty.d.ts
|
|
7021
7016
|
/**
|
|
7022
7017
|
* @category model
|
|
7023
7018
|
* @since 3.10.0
|
|
@@ -7031,7 +7026,7 @@ interface Pretty<To> {
|
|
|
7031
7026
|
*/
|
|
7032
7027
|
type PrettyAnnotation<A$1, TypeParameters extends ReadonlyArray<any> = readonly []> = (...pretties: { readonly [K in keyof TypeParameters]: Pretty<TypeParameters[K]> }) => Pretty<A$1>;
|
|
7033
7028
|
//#endregion
|
|
7034
|
-
//#region ../../../../node_modules/.pnpm/effect@3.
|
|
7029
|
+
//#region ../../../../node_modules/.pnpm/effect@3.21.2/node_modules/effect/dist/dts/Schema.d.ts
|
|
7035
7030
|
/**
|
|
7036
7031
|
* @since 3.10.0
|
|
7037
7032
|
*/
|
|
@@ -7040,12 +7035,12 @@ type Simplify<A$1> = { [K in keyof A$1]: A$1[K] } & {};
|
|
|
7040
7035
|
* @since 3.10.0
|
|
7041
7036
|
* @category symbol
|
|
7042
7037
|
*/
|
|
7043
|
-
declare const TypeId$
|
|
7038
|
+
declare const TypeId$2: unique symbol;
|
|
7044
7039
|
/**
|
|
7045
7040
|
* @since 3.10.0
|
|
7046
7041
|
* @category symbol
|
|
7047
7042
|
*/
|
|
7048
|
-
type TypeId$
|
|
7043
|
+
type TypeId$2 = typeof TypeId$2;
|
|
7049
7044
|
/**
|
|
7050
7045
|
* @category model
|
|
7051
7046
|
* @since 3.10.0
|
|
@@ -7106,7 +7101,7 @@ declare namespace Schema {
|
|
|
7106
7101
|
* @since 3.10.0
|
|
7107
7102
|
*/
|
|
7108
7103
|
interface Variance<A$1, I$1, R$1> {
|
|
7109
|
-
readonly [TypeId$
|
|
7104
|
+
readonly [TypeId$2]: {
|
|
7110
7105
|
readonly _A: Invariant<A$1>;
|
|
7111
7106
|
readonly _I: Invariant<I$1>;
|
|
7112
7107
|
readonly _R: Covariant<R$1>;
|
|
@@ -7413,14 +7408,14 @@ type PropertySignatureTypeId = typeof PropertySignatureTypeId;
|
|
|
7413
7408
|
* @category PropertySignature
|
|
7414
7409
|
* @since 3.10.0
|
|
7415
7410
|
*/
|
|
7416
|
-
interface PropertySignature<TypeToken extends PropertySignature.Token, Type$
|
|
7411
|
+
interface PropertySignature<TypeToken extends PropertySignature.Token, Type$6, Key$1 extends PropertyKey, EncodedToken extends PropertySignature.Token, Encoded$1, HasDefault extends boolean = false, R$1 = never> extends Schema.Variance<Type$6, Encoded$1, R$1>, Pipeable {
|
|
7417
7412
|
readonly [PropertySignatureTypeId]: null;
|
|
7418
7413
|
readonly _TypeToken: TypeToken;
|
|
7419
7414
|
readonly _EncodedToken: EncodedToken;
|
|
7420
7415
|
readonly _HasDefault: HasDefault;
|
|
7421
7416
|
readonly _Key: Key$1;
|
|
7422
7417
|
readonly ast: PropertySignature.AST;
|
|
7423
|
-
annotations(annotations: PropertySignature.Annotations<Type$
|
|
7418
|
+
annotations(annotations: PropertySignature.Annotations<Type$6>): PropertySignature<TypeToken, Type$6, Key$1, EncodedToken, Encoded$1, HasDefault, R$1>;
|
|
7424
7419
|
}
|
|
7425
7420
|
/**
|
|
7426
7421
|
* @category api interface
|
|
@@ -7749,12 +7744,6 @@ declare namespace Annotations {
|
|
|
7749
7744
|
*/
|
|
7750
7745
|
interface Filter<A$1, P$1 = A$1> extends Schema<A$1, readonly [P$1]> {}
|
|
7751
7746
|
}
|
|
7752
|
-
declare const NonEmptyString_base: filter<typeof String$>;
|
|
7753
|
-
/**
|
|
7754
|
-
* @category string constructors
|
|
7755
|
-
* @since 3.10.0
|
|
7756
|
-
*/
|
|
7757
|
-
declare class NonEmptyString extends NonEmptyString_base {}
|
|
7758
7747
|
type RequiredKeys<T$1> = { [K in keyof T$1]-?: {} extends Pick<T$1, K> ? never : K }[keyof T$1];
|
|
7759
7748
|
/**
|
|
7760
7749
|
* @category Constructor utils
|
|
@@ -7764,76 +7753,92 @@ type MakeOptions = boolean | {
|
|
|
7764
7753
|
readonly disableValidation?: boolean | undefined;
|
|
7765
7754
|
};
|
|
7766
7755
|
//#endregion
|
|
7767
|
-
//#region ../../../common/
|
|
7756
|
+
//#region ../../../common/keys/dist/types/src/URI.d.ts
|
|
7757
|
+
/**
|
|
7758
|
+
* Branded string type for any URI.
|
|
7759
|
+
* Base type for more specific URI schemes like DXN and EID.
|
|
7760
|
+
*/
|
|
7761
|
+
type URI = string & {
|
|
7762
|
+
readonly __URI: unique symbol;
|
|
7763
|
+
};
|
|
7764
|
+
//#endregion
|
|
7765
|
+
//#region ../../../common/keys/dist/types/src/DXN.d.ts
|
|
7768
7766
|
/**
|
|
7769
|
-
*
|
|
7767
|
+
* DXN names a resource (type, plugin, capability, etc.).
|
|
7770
7768
|
*
|
|
7771
|
-
*
|
|
7772
|
-
* NOTE: Must be enabled in chrome devtools preferences.
|
|
7769
|
+
* Format: `dxn:<nsid>[:<version>]` where NSID is an atproto-style dotted name.
|
|
7773
7770
|
*
|
|
7774
7771
|
* @example
|
|
7775
|
-
* ```
|
|
7776
|
-
*
|
|
7777
|
-
*
|
|
7778
|
-
*
|
|
7779
|
-
* }
|
|
7772
|
+
* ```
|
|
7773
|
+
* dxn:org.dxos.type.calendar
|
|
7774
|
+
* dxn:org.dxos.type.calendar:1.0.0
|
|
7775
|
+
* dxn:org.dxos.plugin.markdown
|
|
7780
7776
|
* ```
|
|
7781
7777
|
*/
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7778
|
+
type DXN = URI & {
|
|
7779
|
+
readonly __DXN: unique symbol;
|
|
7780
|
+
};
|
|
7781
|
+
//#endregion
|
|
7782
|
+
//#region ../../../common/keys/dist/types/src/entity-id.d.ts
|
|
7783
|
+
declare const EntityIdSchema: refine<string, typeof String$>;
|
|
7784
|
+
type EntityId = typeof EntityIdSchema.Type;
|
|
7785
|
+
interface EntityIdClass extends SchemaClass<EntityId, string> {
|
|
7785
7786
|
/**
|
|
7786
|
-
*
|
|
7787
|
+
* @returns true if the string is a valid EntityId.
|
|
7787
7788
|
*/
|
|
7788
|
-
|
|
7789
|
-
hasBody?: (config?: any) => boolean;
|
|
7790
|
-
body?: (config?: any) => JsonML | null;
|
|
7791
|
-
}
|
|
7792
|
-
//#endregion
|
|
7793
|
-
//#region ../../../common/debug/dist/types/src/inspect-custom.d.ts
|
|
7794
|
-
/**
|
|
7795
|
-
* Using this allows code to be written in a portable fashion, so that the custom inspect function is used in an Node.js environment and ignored in the browser.
|
|
7796
|
-
*/
|
|
7797
|
-
declare const inspectCustom: unique symbol;
|
|
7798
|
-
//#endregion
|
|
7799
|
-
//#region ../../../common/keys/dist/types/src/object-id.d.ts
|
|
7800
|
-
declare const ObjectIdSchema: refine<string, typeof String$>;
|
|
7801
|
-
type ObjectId = typeof ObjectIdSchema.Type;
|
|
7802
|
-
interface ObjectIdClass extends SchemaClass<ObjectId, string> {
|
|
7789
|
+
isValid(id: string): id is EntityId;
|
|
7803
7790
|
/**
|
|
7804
|
-
*
|
|
7791
|
+
* Creates an EntityId from a string validating the format.
|
|
7805
7792
|
*/
|
|
7806
|
-
|
|
7793
|
+
make(id: string): EntityId;
|
|
7807
7794
|
/**
|
|
7808
|
-
*
|
|
7795
|
+
* Generates a random EntityId.
|
|
7809
7796
|
*/
|
|
7810
|
-
|
|
7797
|
+
random(): EntityId;
|
|
7811
7798
|
/**
|
|
7812
|
-
*
|
|
7799
|
+
* Derives a deterministic ULID-format EntityId from arbitrary seed values.
|
|
7800
|
+
*
|
|
7801
|
+
* The same inputs always produce the same id, across processes, isolates, and workers.
|
|
7802
|
+
* Unlike `random()`, this method does not call `crypto.getRandomValues()` and is therefore
|
|
7803
|
+
* safe to call at module top-level — required for Cloudflare workerd, which forbids random
|
|
7804
|
+
* generation in global scope.
|
|
7805
|
+
*
|
|
7806
|
+
* Intended for stable identity of declarative artefacts (e.g. `Type.Type` entities derived
|
|
7807
|
+
* from a `(typename, version)` pair, fixtures, well-known objects). NOT a substitute for
|
|
7808
|
+
* `random()` when global uniqueness is required: callers must guarantee seed uniqueness
|
|
7809
|
+
* themselves; identical seeds yield identical ids and therefore collide.
|
|
7810
|
+
*
|
|
7811
|
+
* The result always passes `EntityId.isValid(...)`.
|
|
7812
|
+
*
|
|
7813
|
+
* @param seed - One or more seed values; coerced to strings and joined.
|
|
7814
|
+
*
|
|
7815
|
+
* ```ts
|
|
7816
|
+
* EntityId.deterministic('org.dxos.type.person', '0.1.0'); // stable across runs
|
|
7817
|
+
* ```
|
|
7813
7818
|
*/
|
|
7814
|
-
|
|
7819
|
+
deterministic(...seed: (string | number)[]): EntityId;
|
|
7815
7820
|
/**
|
|
7816
7821
|
* WARNING: To be used only within tests.
|
|
7817
7822
|
*
|
|
7818
|
-
* Disables randomness in
|
|
7823
|
+
* Disables randomness in EntityId generation, causing the same sequence of IDs to be generated.
|
|
7819
7824
|
* Do not use in production code as this will cause data collisions.
|
|
7820
7825
|
* Place this at the top of the test file to ensure that the same sequence of IDs is generated.
|
|
7821
7826
|
*
|
|
7822
7827
|
* ```ts
|
|
7823
|
-
*
|
|
7828
|
+
* EntityId.dangerouslyDisableRandomness();
|
|
7824
7829
|
*
|
|
7825
7830
|
* describe('suite', () => {
|
|
7826
7831
|
* // ...
|
|
7827
7832
|
* });
|
|
7828
7833
|
* ```
|
|
7829
7834
|
*
|
|
7830
|
-
* NOTE: The generated IDs depend on the order of
|
|
7835
|
+
* NOTE: The generated IDs depend on the order of EntityId.random() calls, which might be affected by test order, scheduling, etc.
|
|
7831
7836
|
*/
|
|
7832
7837
|
dangerouslyDisableRandomness(): void;
|
|
7833
7838
|
/**
|
|
7834
7839
|
* WARNING: To be used only within tests.
|
|
7835
7840
|
*
|
|
7836
|
-
* Pins the time component of generated
|
|
7841
|
+
* Pins the time component of generated EntityIds and seeds the PRNG used for the random component,
|
|
7837
7842
|
* causing the same sequence of IDs to be generated across runs.
|
|
7838
7843
|
* Do not use in production code as this will cause data collisions.
|
|
7839
7844
|
*
|
|
@@ -7841,10 +7846,10 @@ interface ObjectIdClass extends SchemaClass<ObjectId, string> {
|
|
|
7841
7846
|
* @param seed - Seed value for the PRNG used for the ULID random component.
|
|
7842
7847
|
*
|
|
7843
7848
|
* ```ts
|
|
7844
|
-
*
|
|
7849
|
+
* EntityId.dangerouslySetSeed(new Date('2025-01-01').getTime(), 42);
|
|
7845
7850
|
* ```
|
|
7846
7851
|
*
|
|
7847
|
-
* NOTE: The generated IDs depend on the order of
|
|
7852
|
+
* NOTE: The generated IDs depend on the order of EntityId.random() calls, which might be affected by test order, scheduling, etc.
|
|
7848
7853
|
*/
|
|
7849
7854
|
dangerouslySetSeed(time: number, seed: number): void;
|
|
7850
7855
|
}
|
|
@@ -7853,7 +7858,7 @@ interface ObjectIdClass extends SchemaClass<ObjectId, string> {
|
|
|
7853
7858
|
*
|
|
7854
7859
|
* Follows ULID spec.
|
|
7855
7860
|
*/
|
|
7856
|
-
declare const
|
|
7861
|
+
declare const EntityId: EntityIdClass;
|
|
7857
7862
|
//#endregion
|
|
7858
7863
|
//#region ../../../common/keys/dist/types/src/space-id.d.ts
|
|
7859
7864
|
/**
|
|
@@ -7873,125 +7878,20 @@ declare const SpaceId: Schema<SpaceId, string> & {
|
|
|
7873
7878
|
random: () => SpaceId;
|
|
7874
7879
|
};
|
|
7875
7880
|
//#endregion
|
|
7876
|
-
//#region ../../../common/keys/dist/types/src/
|
|
7877
|
-
declare const QueueSubspaceTags: Readonly<{
|
|
7878
|
-
DATA: "data";
|
|
7879
|
-
TRACE: "trace";
|
|
7880
|
-
}>;
|
|
7881
|
-
type QueueSubspaceTag = (typeof QueueSubspaceTags)[keyof typeof QueueSubspaceTags];
|
|
7881
|
+
//#region ../../../common/keys/dist/types/src/EID.d.ts
|
|
7882
7882
|
/**
|
|
7883
|
-
*
|
|
7884
|
-
* Each DXN starts with a dxn prefix, followed by a resource kind.
|
|
7885
|
-
* Colon Symbol : is used a delimiter between parts.
|
|
7886
|
-
* DXNs may contain slashes.
|
|
7887
|
-
* '@' in the place of the space id is used to denote that the DXN should be resolved in the local space.
|
|
7883
|
+
* Addresses an ECHO object or space. Uses the `echo:` URI scheme.
|
|
7888
7884
|
*
|
|
7889
7885
|
* @example
|
|
7890
7886
|
* ```
|
|
7891
|
-
*
|
|
7892
|
-
*
|
|
7893
|
-
*
|
|
7894
|
-
* dxn:type:org.dxos.type.calendar
|
|
7895
|
-
* dxn:plugin:org.dxos.agent.plugin.functions
|
|
7887
|
+
* echo://BA25QRC2FEWCSAMRP4RZL65LWJ7352CKE/01J00J9B45YHYSGZQTQMSKMGJ6
|
|
7888
|
+
* echo:/01J00J9B45YHYSGZQTQMSKMGJ6
|
|
7889
|
+
* echo://BA25QRC2FEWCSAMRP4RZL65LWJ7352CKE
|
|
7896
7890
|
* ```
|
|
7897
7891
|
*/
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
static hash(dxn: DXN): string;
|
|
7902
|
-
/**
|
|
7903
|
-
* Kind constants.
|
|
7904
|
-
*/
|
|
7905
|
-
static kind: Readonly<{
|
|
7906
|
-
/**
|
|
7907
|
-
* dxn:type:<type_name>[:<version>]
|
|
7908
|
-
*/
|
|
7909
|
-
TYPE: "type";
|
|
7910
|
-
/**
|
|
7911
|
-
* dxn:echo:<space_id>:<echo_id>
|
|
7912
|
-
* dxn:echo:@:<echo_id>
|
|
7913
|
-
*/
|
|
7914
|
-
ECHO: "echo";
|
|
7915
|
-
/**
|
|
7916
|
-
* The subspace tag enables us to partition queues by usage within the context of a space.
|
|
7917
|
-
* dxn:queue:<subspace_tag>:<space_id>:<queue_id>[:object_id]
|
|
7918
|
-
* dxn:queue:data:BA25QRC2FEWCSAMRP4RZL65LWJ7352CKE:01J00J9B45YHYSGZQTQMSKMGJ6
|
|
7919
|
-
* dxn:queue:trace:BA25QRC2FEWCSAMRP4RZL65LWJ7352CKE:01J00J9B45YHYSGZQTQMSKMGJ6
|
|
7920
|
-
*/
|
|
7921
|
-
QUEUE: "queue";
|
|
7922
|
-
}>;
|
|
7923
|
-
/**
|
|
7924
|
-
* Exactly equals.
|
|
7925
|
-
*/
|
|
7926
|
-
static equals(a: DXN, b: DXN): boolean;
|
|
7927
|
-
static equalsEchoId(a: DXN, b: DXN): boolean;
|
|
7928
|
-
static isDXNString(dxn: string): boolean;
|
|
7929
|
-
static parse(dxn: string): DXN;
|
|
7930
|
-
static tryParse(dxn: string): DXN | undefined;
|
|
7931
|
-
/**
|
|
7932
|
-
* @example `dxn:type:com.example.type.person`
|
|
7933
|
-
*/
|
|
7934
|
-
static fromTypename(typename: string): DXN;
|
|
7935
|
-
/**
|
|
7936
|
-
* @example `dxn:type:com.example.type.person:0.1.0`
|
|
7937
|
-
*/
|
|
7938
|
-
static fromTypenameAndVersion(typename: string, version: string): DXN;
|
|
7939
|
-
/**
|
|
7940
|
-
* @example `dxn:echo:BA25QRC2FEWCSAMRP4RZL65LWJ7352CKE:01J00J9B45YHYSGZQTQMSKMGJ6`
|
|
7941
|
-
*/
|
|
7942
|
-
static fromSpaceAndObjectId(spaceId: SpaceId, objectId: ObjectId): DXN;
|
|
7943
|
-
/**
|
|
7944
|
-
* @example `dxn:echo:@:01J00J9B45YHYSGZQTQMSKMGJ6`
|
|
7945
|
-
*/
|
|
7946
|
-
static fromLocalObjectId(id: string): DXN;
|
|
7947
|
-
static fromQueue(subspaceTag: QueueSubspaceTag, spaceId: SpaceId, queueId: ObjectId, objectId?: ObjectId): DXN;
|
|
7948
|
-
constructor(kind: string, parts: string[]);
|
|
7949
|
-
toString(): DXN.String;
|
|
7950
|
-
toJSON(): string;
|
|
7951
|
-
/**
|
|
7952
|
-
* Used by Node.js to get textual representation of this object when it's printed with a `console.log` statement.
|
|
7953
|
-
*/
|
|
7954
|
-
[inspectCustom](depth: number, options: InspectOptionsStylized, inspectFn: typeof inspect): string;
|
|
7955
|
-
get [devtoolsFormatter](): DevtoolsFormatter;
|
|
7956
|
-
get kind(): string;
|
|
7957
|
-
get parts(): string[];
|
|
7958
|
-
get typename(): string;
|
|
7959
|
-
equals(other: DXN): boolean;
|
|
7960
|
-
hasTypenameOf(typename: string): boolean;
|
|
7961
|
-
isLocalObjectId(): boolean;
|
|
7962
|
-
asTypeDXN(): DXN.TypeDXN | undefined;
|
|
7963
|
-
asEchoDXN(): DXN.EchoDXN | undefined;
|
|
7964
|
-
asQueueDXN(): DXN.QueueDXN | undefined;
|
|
7965
|
-
/**
|
|
7966
|
-
* Produces a new DXN with the given parts appended.
|
|
7967
|
-
*/
|
|
7968
|
-
extend(parts: string[]): DXN;
|
|
7969
|
-
}
|
|
7970
|
-
/**
|
|
7971
|
-
* API namespace.
|
|
7972
|
-
*/
|
|
7973
|
-
declare namespace DXN {
|
|
7974
|
-
/**
|
|
7975
|
-
* DXN represented as a javascript string.
|
|
7976
|
-
*/
|
|
7977
|
-
type String = string & {
|
|
7978
|
-
__DXNString: never;
|
|
7979
|
-
};
|
|
7980
|
-
type TypeDXN = {
|
|
7981
|
-
type: string;
|
|
7982
|
-
version?: string;
|
|
7983
|
-
};
|
|
7984
|
-
type EchoDXN = {
|
|
7985
|
-
spaceId?: SpaceId;
|
|
7986
|
-
echoId: string;
|
|
7987
|
-
};
|
|
7988
|
-
type QueueDXN = {
|
|
7989
|
-
subspaceTag: QueueSubspaceTag;
|
|
7990
|
-
spaceId: SpaceId;
|
|
7991
|
-
queueId: string;
|
|
7992
|
-
objectId?: string;
|
|
7993
|
-
};
|
|
7994
|
-
}
|
|
7892
|
+
type EID = URI & {
|
|
7893
|
+
readonly __EID: unique symbol;
|
|
7894
|
+
};
|
|
7995
7895
|
//#endregion
|
|
7996
7896
|
//#region ../echo-protocol/dist/types/src/foreign-key.d.ts
|
|
7997
7897
|
declare const ForeignKey_: Struct<{
|
|
@@ -8011,30 +7911,24 @@ type ForeignKey = Schema.Type<typeof ForeignKey_>;
|
|
|
8011
7911
|
*/
|
|
8012
7912
|
declare const ForeignKey: Schema<ForeignKey>;
|
|
8013
7913
|
//#endregion
|
|
8014
|
-
//#region ../../../common/util/dist/types/src/types.d.ts
|
|
8015
|
-
/**
|
|
8016
|
-
* Removes readonly modifiers from top-level properties of T.
|
|
8017
|
-
* Also converts readonly arrays at the top level to mutable arrays.
|
|
8018
|
-
* For nested properties, mutability depends on the schema definition.
|
|
8019
|
-
*/
|
|
8020
|
-
type ToMutable<T$1> = T$1 extends object ? { -readonly [K in keyof T$1]: T$1[K] extends readonly (infer U)[] ? U[] : T$1[K] } : T$1;
|
|
8021
|
-
//#endregion
|
|
8022
|
-
//#region ../../../common/async/dist/types/src/cleanup.d.ts
|
|
8023
|
-
type CleanupFn = () => void;
|
|
8024
|
-
//#endregion
|
|
8025
7914
|
//#region ../echo-protocol/dist/types/src/reference.d.ts
|
|
8026
7915
|
/**
|
|
8027
7916
|
* Reference as it is stored in Automerge document.
|
|
8028
7917
|
*/
|
|
8029
7918
|
type EncodedReference = {
|
|
8030
|
-
'/':
|
|
7919
|
+
'/': URI;
|
|
8031
7920
|
};
|
|
8032
7921
|
declare const EncodedReference: Readonly<{
|
|
8033
7922
|
isEncodedReference: (value: any) => value is EncodedReference;
|
|
8034
|
-
|
|
8035
|
-
|
|
8036
|
-
|
|
8037
|
-
|
|
7923
|
+
/**
|
|
7924
|
+
* Returns the opaque URI stored in the encoded reference (any scheme: `echo:` or `dxn:`).
|
|
7925
|
+
* Consumers can narrow with `EID.isEID(uri)` / `DXN.isDXN(uri)`.
|
|
7926
|
+
*/
|
|
7927
|
+
toURI: (value: EncodedReference) => URI;
|
|
7928
|
+
/**
|
|
7929
|
+
* Creates an encoded reference from an opaque URI.
|
|
7930
|
+
*/
|
|
7931
|
+
fromURI: (uri: URI) => EncodedReference;
|
|
8038
7932
|
}>;
|
|
8039
7933
|
//#endregion
|
|
8040
7934
|
//#region ../echo-protocol/dist/types/src/query/ast.d.ts
|
|
@@ -8045,8 +7939,8 @@ declare const EncodedReference: Readonly<{
|
|
|
8045
7939
|
*/
|
|
8046
7940
|
declare const FilterObject_: Struct<{
|
|
8047
7941
|
type: Literal<["object"]>;
|
|
8048
|
-
typename: Union<[
|
|
8049
|
-
id: optional<Array$<
|
|
7942
|
+
typename: Union<[Schema<URI, URI, never>, typeof Null]>;
|
|
7943
|
+
id: optional<Array$<EntityIdClass>>;
|
|
8050
7944
|
/**
|
|
8051
7945
|
* Filter by property.
|
|
8052
7946
|
* Must not include object ID.
|
|
@@ -8181,7 +8075,7 @@ declare const FilterOr: Schema<FilterOr>;
|
|
|
8181
8075
|
declare const FilterChildOf_: Struct<{
|
|
8182
8076
|
type: Literal<["child-of"]>;
|
|
8183
8077
|
/** Parent DXNs to match children of. */
|
|
8184
|
-
parents: Array$<
|
|
8078
|
+
parents: Array$<Schema<EID, EID, never>>;
|
|
8185
8079
|
/** Whether to match transitively (grandchildren, etc.). Defaults to true. */
|
|
8186
8080
|
transitive: typeof Boolean$;
|
|
8187
8081
|
}>;
|
|
@@ -8232,7 +8126,7 @@ declare const QueryIncomingReferencesClause_: Struct<{
|
|
|
8232
8126
|
* If null, matches references from any property.
|
|
8233
8127
|
*/
|
|
8234
8128
|
property: NullOr<typeof String$>;
|
|
8235
|
-
typename: Union<[
|
|
8129
|
+
typename: Union<[Schema<URI, URI, never>, typeof Null]>;
|
|
8236
8130
|
}>;
|
|
8237
8131
|
interface QueryIncomingReferencesClause extends Schema.Type<typeof QueryIncomingReferencesClause_> {}
|
|
8238
8132
|
declare const QueryIncomingReferencesClause: Schema<QueryIncomingReferencesClause>;
|
|
@@ -8368,15 +8262,27 @@ declare const QueryFromClause_: Struct<{
|
|
|
8368
8262
|
type: Literal<["from"]>;
|
|
8369
8263
|
query: suspend<QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, never>;
|
|
8370
8264
|
from: Union<[TaggedStruct<"scope", {
|
|
8371
|
-
|
|
8372
|
-
readonly
|
|
8373
|
-
readonly
|
|
8374
|
-
readonly
|
|
8265
|
+
scopes: Array$<suspend<{
|
|
8266
|
+
readonly _tag: "space";
|
|
8267
|
+
readonly spaceId?: string | undefined;
|
|
8268
|
+
readonly includeAllFeeds?: boolean | undefined;
|
|
8269
|
+
} | {
|
|
8270
|
+
readonly _tag: "feed";
|
|
8271
|
+
readonly feedUri: string;
|
|
8272
|
+
} | {
|
|
8273
|
+
readonly _tag: "registry";
|
|
8274
|
+
readonly location: "local" | "remote";
|
|
8375
8275
|
}, {
|
|
8376
|
-
readonly
|
|
8377
|
-
readonly
|
|
8378
|
-
readonly
|
|
8379
|
-
}
|
|
8276
|
+
readonly _tag: "space";
|
|
8277
|
+
readonly includeAllFeeds?: boolean | undefined;
|
|
8278
|
+
readonly spaceId?: string | undefined;
|
|
8279
|
+
} | {
|
|
8280
|
+
readonly _tag: "feed";
|
|
8281
|
+
readonly feedUri: string;
|
|
8282
|
+
} | {
|
|
8283
|
+
readonly _tag: "registry";
|
|
8284
|
+
readonly location: "local" | "remote";
|
|
8285
|
+
}, never>>;
|
|
8380
8286
|
}>, TaggedStruct<"query", {
|
|
8381
8287
|
query: suspend<QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, QueryFilterClause | QueryFromClause | QueryHierarchyTraversalClause | QueryIncomingReferencesClause | QueryLimitClause | QueryOptionsClause | QueryOrderClause | QueryReferenceTraversalClause | QueryRelationClause | QueryRelationTraversalClause | QuerySelectClause | QuerySetDifferenceClause | QueryUnionClause, never>;
|
|
8382
8288
|
}>]>;
|
|
@@ -8384,8 +8290,8 @@ declare const QueryFromClause_: Struct<{
|
|
|
8384
8290
|
interface QueryFromClause extends Schema.Type<typeof QueryFromClause_> {}
|
|
8385
8291
|
declare const QueryFromClause: Schema<QueryFromClause>;
|
|
8386
8292
|
declare const Query_: Union<[Schema<QuerySelectClause, QuerySelectClause, never>, Schema<QueryFilterClause, QueryFilterClause, never>, Schema<QueryReferenceTraversalClause, QueryReferenceTraversalClause, never>, Schema<QueryIncomingReferencesClause, QueryIncomingReferencesClause, never>, Schema<QueryRelationClause, QueryRelationClause, never>, Schema<QueryRelationTraversalClause, QueryRelationTraversalClause, never>, Schema<QueryHierarchyTraversalClause, QueryHierarchyTraversalClause, never>, Schema<QueryUnionClause, QueryUnionClause, never>, Schema<QuerySetDifferenceClause, QuerySetDifferenceClause, never>, Schema<QueryOrderClause, QueryOrderClause, never>, Schema<QueryOptionsClause, QueryOptionsClause, never>, Schema<QueryLimitClause, QueryLimitClause, never>, Schema<QueryFromClause, QueryFromClause, never>]>;
|
|
8387
|
-
type Query$
|
|
8388
|
-
declare const Query$
|
|
8293
|
+
type Query$1 = Schema.Type<typeof Query_>;
|
|
8294
|
+
declare const Query$1: Schema<Query$1>;
|
|
8389
8295
|
declare const QueryOptions: Struct<{
|
|
8390
8296
|
/**
|
|
8391
8297
|
* Nested select statements will use this option to filter deleted objects.
|
|
@@ -8399,26 +8305,86 @@ declare const QueryOptions: Struct<{
|
|
|
8399
8305
|
interface QueryOptions extends Schema.Type<typeof QueryOptions> {}
|
|
8400
8306
|
/**
|
|
8401
8307
|
* Specifies the scope of the data to query from.
|
|
8308
|
+
* A `from` clause may carry multiple scopes; results are unioned across them.
|
|
8309
|
+
*/
|
|
8310
|
+
declare const Scope: Union<[TaggedStruct<"space", {
|
|
8311
|
+
spaceId: optional<typeof String$>;
|
|
8312
|
+
includeAllFeeds: optional<typeof Boolean$>;
|
|
8313
|
+
}>, TaggedStruct<"feed", {
|
|
8314
|
+
feedUri: typeof String$;
|
|
8315
|
+
}>, TaggedStruct<"registry", {
|
|
8316
|
+
location: Literal<["local", "remote"]>;
|
|
8317
|
+
}>]>;
|
|
8318
|
+
type Scope = Schema.Type<typeof Scope>;
|
|
8319
|
+
//#endregion
|
|
8320
|
+
//#region ../echo/dist/types/src/internal/common/types/entity.d.ts
|
|
8321
|
+
/**
|
|
8322
|
+
* String key used to identify the kind of an entity instance (object or relation).
|
|
8402
8323
|
*/
|
|
8403
|
-
declare const
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8324
|
+
declare const KindId$1: '~@dxos/echo/Kind';
|
|
8325
|
+
type KindId$1 = typeof KindId$1;
|
|
8326
|
+
/**
|
|
8327
|
+
* String key used to identify the kind of a schema (object schema or relation schema).
|
|
8328
|
+
* Parallels KindId which identifies instance kinds.
|
|
8329
|
+
*/
|
|
8330
|
+
declare const SchemaKindId: '~@dxos/echo/SchemaKind';
|
|
8331
|
+
type SchemaKindId = typeof SchemaKindId;
|
|
8332
|
+
/**
|
|
8333
|
+
* Hidden slot on a static `Type.Type` entity that holds the source Effect
|
|
8334
|
+
* Schema. `Type.getSchema(...)` reads this for static types; persisted types
|
|
8335
|
+
* rebuild from `jsonSchema` instead. Stored as a string key for declaration
|
|
8336
|
+
* portability (see KindId comment above).
|
|
8337
|
+
*/
|
|
8338
|
+
declare const StaticTypeSchemaSlot: '~@dxos/echo/Type.StaticSchema';
|
|
8339
|
+
type StaticTypeSchemaSlot = typeof StaticTypeSchemaSlot;
|
|
8340
|
+
/**
|
|
8341
|
+
* Phantom string key on `Type<A>` entities that carries the instance type `A`.
|
|
8342
|
+
* Lets internal helpers (`makeObject`, `createObject`, etc.) pattern-match the
|
|
8343
|
+
* instance type from an entity input without importing from the top-level
|
|
8344
|
+
* `Type` module. Mirrors `Type.InstancePhantomId` (declared in `Type.ts`).
|
|
8345
|
+
*
|
|
8346
|
+
* Stored as a string key so declarations remain portable across packages
|
|
8347
|
+
* (see KindId comment above).
|
|
8348
|
+
*/
|
|
8349
|
+
declare const InstancePhantomId$1: '~@dxos/echo/Type.Instance';
|
|
8350
|
+
type InstancePhantomId$1 = typeof InstancePhantomId$1;
|
|
8351
|
+
/**
|
|
8352
|
+
* Nominal brand carried by the well-known "any object" / "any relation"
|
|
8353
|
+
* schemas (`Obj.Unknown`, `Relation.Unknown`). The brand lets `Ref.Ref`,
|
|
8354
|
+
* `Filter.type`, and `Query.type` accept these schemas in addition to
|
|
8355
|
+
* `Type.Type` entities, without opening the door to arbitrary raw schemas.
|
|
8356
|
+
*
|
|
8357
|
+
* Stored as a string key so declarations remain portable across packages
|
|
8358
|
+
* (see KindId comment above).
|
|
8359
|
+
*/
|
|
8360
|
+
declare const UnknownTypeSchemaBrandId: '~@dxos/echo/UnknownTypeSchemaBrand';
|
|
8361
|
+
type UnknownTypeSchemaBrandId = typeof UnknownTypeSchemaBrandId;
|
|
8362
|
+
/**
|
|
8363
|
+
* Schema-side companion to `Type.Type` entities for the "any object" /
|
|
8364
|
+
* "any relation" cases. Branded so `Ref.Ref` / `Filter.type` / `Query.type`
|
|
8365
|
+
* can pattern-match on it; arbitrary `Schema.Schema` values do not satisfy
|
|
8366
|
+
* this shape.
|
|
8367
|
+
*/
|
|
8368
|
+
interface UnknownTypeSchema<A$1, K$1 extends EntityKind> extends Schema<A$1, any, never> {
|
|
8369
|
+
readonly [UnknownTypeSchemaBrandId]: K$1;
|
|
8370
|
+
}
|
|
8371
|
+
/**
|
|
8372
|
+
* Kinds of entities stored in ECHO: objects, relations, and types.
|
|
8373
|
+
*/
|
|
8374
|
+
declare enum EntityKind {
|
|
8375
|
+
Object = "object",
|
|
8376
|
+
Relation = "relation",
|
|
8377
|
+
Type = "type",
|
|
8378
|
+
}
|
|
8379
|
+
//#endregion
|
|
8380
|
+
//#region ../../../common/util/dist/types/src/types.d.ts
|
|
8381
|
+
type MaybePromise<T$1> = T$1 | Promise<T$1>;
|
|
8382
|
+
/**
|
|
8383
|
+
* Removes readonly modifiers from top-level properties of T.
|
|
8384
|
+
* Also converts readonly arrays at the top level to mutable arrays.
|
|
8385
|
+
* For nested properties, mutability depends on the schema definition.
|
|
8386
|
+
*/
|
|
8387
|
+
type ToMutable<T$1> = T$1 extends object ? { -readonly [K in keyof T$1]: T$1[K] extends readonly (infer U)[] ? U[] : T$1[K] } : T$1;
|
|
8422
8388
|
//#endregion
|
|
8423
8389
|
//#region ../../../common/effect/dist/types/src/json-path.d.ts
|
|
8424
8390
|
type JsonPath = string & {
|
|
@@ -8429,7 +8395,7 @@ type JsonPath = string & {
|
|
|
8429
8395
|
*/
|
|
8430
8396
|
declare const JsonPath: Schema<JsonPath>;
|
|
8431
8397
|
//#endregion
|
|
8432
|
-
//#region ../../../../node_modules/.pnpm/@effect-atom+atom@0.5.
|
|
8398
|
+
//#region ../../../../node_modules/.pnpm/@effect-atom+atom@0.5.3_patch_hash=90a97dcb5aa93197ad34b41c932b405a7ba98679af6885de637f_0b7fb499561b7d4cf5206aa61a152dc5/node_modules/@effect-atom/atom/dist/dts/AtomHttpApi.d.ts
|
|
8433
8399
|
declare global {
|
|
8434
8400
|
interface ErrorConstructor {
|
|
8435
8401
|
stackTraceLimit: number;
|
|
@@ -8440,7 +8406,7 @@ declare global {
|
|
|
8440
8406
|
* @category Constructors
|
|
8441
8407
|
*/
|
|
8442
8408
|
//#endregion
|
|
8443
|
-
//#region ../../../../node_modules/.pnpm/@effect-atom+atom@0.5.
|
|
8409
|
+
//#region ../../../../node_modules/.pnpm/@effect-atom+atom@0.5.3_patch_hash=90a97dcb5aa93197ad34b41c932b405a7ba98679af6885de637f_0b7fb499561b7d4cf5206aa61a152dc5/node_modules/@effect-atom/atom/dist/dts/AtomRpc.d.ts
|
|
8444
8410
|
declare global {
|
|
8445
8411
|
interface ErrorConstructor {
|
|
8446
8412
|
stackTraceLimit: number;
|
|
@@ -8451,20 +8417,284 @@ declare global {
|
|
|
8451
8417
|
* @category Constructors
|
|
8452
8418
|
*/
|
|
8453
8419
|
//#endregion
|
|
8454
|
-
//#region
|
|
8455
|
-
type
|
|
8456
|
-
|
|
8420
|
+
//#region ../../../common/context/dist/types/src/context.d.ts
|
|
8421
|
+
type ContextErrorHandler = (error: Error, ctx: Context$1) => void;
|
|
8422
|
+
type DisposeCallback = () => any | Promise<any>;
|
|
8423
|
+
type CreateContextProps = {
|
|
8424
|
+
name?: string;
|
|
8425
|
+
parent?: Context$1;
|
|
8426
|
+
attributes?: Record<string, any>;
|
|
8427
|
+
onError?: ContextErrorHandler;
|
|
8428
|
+
};
|
|
8429
|
+
/**
|
|
8430
|
+
* NOTE: Context is not reusable after it is disposed.
|
|
8431
|
+
*/
|
|
8432
|
+
declare class Context$1 {
|
|
8433
|
+
#private;
|
|
8434
|
+
static default(): Context$1;
|
|
8435
|
+
maxSafeDisposeCallbacks: number;
|
|
8436
|
+
constructor(params?: CreateContextProps, callMeta?: Partial<CallMetadata>);
|
|
8437
|
+
get disposed(): boolean;
|
|
8438
|
+
get disposeCallbacksLength(): number;
|
|
8439
|
+
get signal(): AbortSignal;
|
|
8440
|
+
/**
|
|
8441
|
+
* Schedules a callback to run when the context is disposed.
|
|
8442
|
+
* May be async, in this case the disposer might choose to wait for all resource to released.
|
|
8443
|
+
* Throwing an error inside the callback will result in the error being logged, but not re-thrown.
|
|
8444
|
+
*
|
|
8445
|
+
* NOTE: Will call the callback immediately if the context is already disposed.
|
|
8446
|
+
*
|
|
8447
|
+
* @returns A function that can be used to remove the callback from the dispose list.
|
|
8448
|
+
*/
|
|
8449
|
+
onDispose(callback: DisposeCallback): () => void;
|
|
8450
|
+
/**
|
|
8451
|
+
* Runs all dispose callbacks.
|
|
8452
|
+
* Callbacks are run in the reverse order they were added.
|
|
8453
|
+
* This function never throws.
|
|
8454
|
+
* It is safe to ignore the returned promise if the caller does not wish to wait for callbacks to complete.
|
|
8455
|
+
* Disposing context means that onDispose will throw an error and any errors raised will be logged and not propagated.
|
|
8456
|
+
* @returns true if there were no errors during the dispose process.
|
|
8457
|
+
*/
|
|
8458
|
+
dispose(throwOnError?: boolean): Promise<boolean>;
|
|
8459
|
+
/**
|
|
8460
|
+
* Raise the error inside the context.
|
|
8461
|
+
* The error will be propagated to the error handler.
|
|
8462
|
+
* IF the error handler is not set, the error will dispose the context and cause an unhandled rejection.
|
|
8463
|
+
*/
|
|
8464
|
+
raise(error: Error): void;
|
|
8465
|
+
derive({
|
|
8466
|
+
onError,
|
|
8467
|
+
attributes
|
|
8468
|
+
}?: CreateContextProps): Context$1;
|
|
8469
|
+
getAttribute(key: string): any;
|
|
8470
|
+
[Symbol.toStringTag]: string;
|
|
8471
|
+
[inspect.custom]: () => string;
|
|
8472
|
+
toString(): string;
|
|
8473
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
8474
|
+
}
|
|
8475
|
+
//#endregion
|
|
8476
|
+
//#region ../../../common/async/dist/types/src/cleanup.d.ts
|
|
8477
|
+
type CleanupFn = () => void;
|
|
8478
|
+
//#endregion
|
|
8479
|
+
//#region ../../../common/async/dist/types/src/events.d.ts
|
|
8480
|
+
type Effect = () => CleanupFn | undefined;
|
|
8481
|
+
interface EventEmitterLike {
|
|
8482
|
+
on(event: string, cb: (data?: any) => void): void;
|
|
8483
|
+
off(event: string, cb: (data?: any) => void): void;
|
|
8484
|
+
}
|
|
8485
|
+
type ListenerOptions = {
|
|
8486
|
+
weak?: boolean;
|
|
8487
|
+
once?: boolean;
|
|
8488
|
+
};
|
|
8489
|
+
type EventCallback<T$1> = (data: T$1) => MaybePromise<void>;
|
|
8490
|
+
/**
|
|
8491
|
+
* An EventEmitter variant that does not do event multiplexing and represents a single event.
|
|
8492
|
+
*
|
|
8493
|
+
* ## Typical usage:
|
|
8494
|
+
* ```javascript
|
|
8495
|
+
* class Model {
|
|
8496
|
+
* public readonly update = new Event<UpdateData>();
|
|
8497
|
+
* private readonly privateEvent = new Event<void>();
|
|
8498
|
+
*
|
|
8499
|
+
* onUpdate(data: UpdateData) {
|
|
8500
|
+
* ...
|
|
8501
|
+
* this.update.emit(data);
|
|
8502
|
+
* }
|
|
8503
|
+
* }
|
|
8504
|
+
*
|
|
8505
|
+
* model.update.on(data => {
|
|
8506
|
+
* ...
|
|
8507
|
+
* });
|
|
8508
|
+
* ```
|
|
8509
|
+
*
|
|
8510
|
+
* ## Advantages over traditional EventEmitter:
|
|
8511
|
+
* 1. User describes explicitly what events a class has as they are defined as class fields.
|
|
8512
|
+
* 2. User can explicitly define event visibility (public, protected, private).
|
|
8513
|
+
* 3. Having events as class fields allows the compiler to check for correct event usage.
|
|
8514
|
+
* 4. User can type the data that event will be emitting.
|
|
8515
|
+
* 5. Uses composition instead of inheritance.
|
|
8516
|
+
* 6. Removes the cases where event names intersect when used in cases with inheritance.
|
|
8517
|
+
* 7. Remove the need to namespace events when developing a class with events that will be used as a base-class.
|
|
8518
|
+
*/
|
|
8519
|
+
declare class Event$1<T$1 = void> implements ReadOnlyEvent<T$1> {
|
|
8457
8520
|
/**
|
|
8458
|
-
*
|
|
8459
|
-
* Makes EchoTypeSchema satisfy the Type.AnyObj or Type.Relation.Any type.
|
|
8521
|
+
* Wrap objects that have on/off style event emitters.
|
|
8460
8522
|
*/
|
|
8461
|
-
|
|
8523
|
+
static wrap<T$1>(emitter: EventEmitterLike, eventName: string): Event$1<T$1>;
|
|
8524
|
+
private readonly _listeners;
|
|
8525
|
+
private readonly _effects;
|
|
8462
8526
|
/**
|
|
8463
|
-
*
|
|
8464
|
-
*
|
|
8527
|
+
* Emit an event.
|
|
8528
|
+
* In most cases should only be called by the class or entity containing the event.
|
|
8529
|
+
* All listeners are called in order of subscription with persistent ones first.
|
|
8530
|
+
* Listeners are called synchronously in the same stack.
|
|
8531
|
+
* A thrown exception in the listener will stop the event from being emitted to the rest of the listeners.
|
|
8532
|
+
*
|
|
8533
|
+
* @param data param that will be passed to all listeners.
|
|
8465
8534
|
*/
|
|
8466
|
-
|
|
8467
|
-
|
|
8535
|
+
emit(data: T$1): void;
|
|
8536
|
+
/**
|
|
8537
|
+
* Emit an event and wait for async listeners to complete.
|
|
8538
|
+
* In most cases should only be called by the class or entity containing the event.
|
|
8539
|
+
* All listeners are called in order of subscription with persistent ones first.
|
|
8540
|
+
* Listeners are called sequentially.
|
|
8541
|
+
*
|
|
8542
|
+
* @param data param that will be passed to all listeners.
|
|
8543
|
+
*/
|
|
8544
|
+
emitAsync(data: T$1): Promise<void>;
|
|
8545
|
+
/**
|
|
8546
|
+
* Register an event listener.
|
|
8547
|
+
* If provided callback was already registered as once-listener, it is made permanent.
|
|
8548
|
+
*
|
|
8549
|
+
* @param callback
|
|
8550
|
+
* @param options.weak If true, the callback will be weakly referenced and will be garbage collected if no other references to it exist.
|
|
8551
|
+
* @returns function that unsubscribes this event listener
|
|
8552
|
+
*/
|
|
8553
|
+
on(callback: EventCallback<T$1>): CleanupFn;
|
|
8554
|
+
on(ctx: Context$1, callback: EventCallback<T$1>, options?: ListenerOptions): CleanupFn;
|
|
8555
|
+
/**
|
|
8556
|
+
* Unsubscribe this callback from new events. Includes persistent and once-listeners.
|
|
8557
|
+
* NOTE: It is recommended to use `Event.on`'s return value instead.
|
|
8558
|
+
* If the callback is not subscribed this is no-op.
|
|
8559
|
+
*
|
|
8560
|
+
* @param callback
|
|
8561
|
+
*/
|
|
8562
|
+
off(callback: (data: T$1) => void): void;
|
|
8563
|
+
/**
|
|
8564
|
+
* Register a callback to be called only once when the next event is emitted.
|
|
8565
|
+
* If this callback is already registered as permanent listener, this is no-op.
|
|
8566
|
+
*
|
|
8567
|
+
* @param callback
|
|
8568
|
+
*/
|
|
8569
|
+
once(callback: (data: T$1) => void): CleanupFn;
|
|
8570
|
+
once(ctx: Context$1, callback: (data: T$1) => void): CleanupFn;
|
|
8571
|
+
/**
|
|
8572
|
+
* An async iterator that iterates over events.
|
|
8573
|
+
* This iterator runs indefinitely.
|
|
8574
|
+
*/
|
|
8575
|
+
[Symbol.asyncIterator](): AsyncIterator<T$1>;
|
|
8576
|
+
/**
|
|
8577
|
+
* Returns a promise that resolves with the first event emitted that matches the provided predicate.
|
|
8578
|
+
*
|
|
8579
|
+
* @param predicate
|
|
8580
|
+
*/
|
|
8581
|
+
waitFor(predicate: (data: T$1) => boolean): Promise<T$1>;
|
|
8582
|
+
/**
|
|
8583
|
+
* Returns a promise that resolves once a specific number of events was emitted since this method was called.
|
|
8584
|
+
*
|
|
8585
|
+
* @param expectedCount
|
|
8586
|
+
*/
|
|
8587
|
+
waitForCount(expectedCount: number): Promise<T$1>;
|
|
8588
|
+
/**
|
|
8589
|
+
* Similar to waitFor, but the promise resolves immediately if the condition is already true.
|
|
8590
|
+
*/
|
|
8591
|
+
waitForCondition(predicate: () => boolean): Promise<void>;
|
|
8592
|
+
/**
|
|
8593
|
+
* Returns the number of persistent listeners.
|
|
8594
|
+
*/
|
|
8595
|
+
listenerCount(): number;
|
|
8596
|
+
/**
|
|
8597
|
+
* Add a side effect that will be activated once the event has at least one subscriber.
|
|
8598
|
+
* The provided callback can return a function that will be used to clean up after the last subscriber unsubscribes from the event.
|
|
8599
|
+
* The API is similar to `useEffect` from React.
|
|
8600
|
+
*
|
|
8601
|
+
* ## Example:
|
|
8602
|
+
* ```typescript
|
|
8603
|
+
* event.addEffect(() => {
|
|
8604
|
+
* // do stuff
|
|
8605
|
+
* return () => {
|
|
8606
|
+
* // clean-up
|
|
8607
|
+
* };
|
|
8608
|
+
* });
|
|
8609
|
+
* ```
|
|
8610
|
+
*
|
|
8611
|
+
* @returns Callback that will remove this effect once called.
|
|
8612
|
+
*/
|
|
8613
|
+
addEffect(effect: Effect): CleanupFn;
|
|
8614
|
+
/**
|
|
8615
|
+
* Triggers an event with at least `timeout` milliseconds between each event.
|
|
8616
|
+
* If the event is triggered more often, the event is delayed until the timeout is reached.
|
|
8617
|
+
* If event is emitted for the first time or event wasn't fired for `timeout` milliseconds,
|
|
8618
|
+
* the event is emitted after `timeout / 8` ms.
|
|
8619
|
+
*/
|
|
8620
|
+
debounce(timeout?: number): Event$1<void>;
|
|
8621
|
+
/**
|
|
8622
|
+
* Turn any variant of `Event<T>` into an `Event<void>` discarding the callback parameter.
|
|
8623
|
+
*/
|
|
8624
|
+
discardParameter(): Event$1<void>;
|
|
8625
|
+
/**
|
|
8626
|
+
* Pipe the events into another event.
|
|
8627
|
+
* @param event
|
|
8628
|
+
*/
|
|
8629
|
+
pipeInto(event: Event$1<T$1>): CleanupFn;
|
|
8630
|
+
/**
|
|
8631
|
+
* Overridden to not return implementation details.
|
|
8632
|
+
*/
|
|
8633
|
+
toJSON(): {
|
|
8634
|
+
listenerCount: number;
|
|
8635
|
+
};
|
|
8636
|
+
private _addListener;
|
|
8637
|
+
private _runEffects;
|
|
8638
|
+
private _cleanupEffects;
|
|
8639
|
+
}
|
|
8640
|
+
/**
|
|
8641
|
+
* A version of Event class which only has subscribe methods.
|
|
8642
|
+
* Useful in cases where you want to explicitly prohibit calling `emit` method.
|
|
8643
|
+
*/
|
|
8644
|
+
interface ReadOnlyEvent<T$1 = void> {
|
|
8645
|
+
/**
|
|
8646
|
+
* Register an event listener.
|
|
8647
|
+
* If provided callback was already registered as once-listener, it is made permanent.
|
|
8648
|
+
*
|
|
8649
|
+
* @param callback
|
|
8650
|
+
* @param options.weak If true, the callback will be weakly referenced and will be garbage collected if no other references to it exist.
|
|
8651
|
+
* @returns function that unsubscribes this event listener
|
|
8652
|
+
*/
|
|
8653
|
+
on(callback: (data: T$1) => void): CleanupFn;
|
|
8654
|
+
on(ctx: Context$1, callback: (data: T$1) => void, options?: ListenerOptions): CleanupFn;
|
|
8655
|
+
/**
|
|
8656
|
+
* Unsubscribes this callback from new events. Includes persistent and once-listeners.
|
|
8657
|
+
* NOTE: It is recommended to us `Event.on`'s return value.
|
|
8658
|
+
* If the callback is not subscribed this is no-op.
|
|
8659
|
+
*
|
|
8660
|
+
* @param callback
|
|
8661
|
+
*/
|
|
8662
|
+
off(callback: (data: T$1) => void): void;
|
|
8663
|
+
/**
|
|
8664
|
+
* Register a callback to be called only once when the next event is emitted.
|
|
8665
|
+
* If this callback is already registered as permanent listener, this is no-op.
|
|
8666
|
+
*
|
|
8667
|
+
* @param callback
|
|
8668
|
+
*/
|
|
8669
|
+
once(callback: (data: T$1) => void): CleanupFn;
|
|
8670
|
+
/**
|
|
8671
|
+
* An async iterator that iterates over events.
|
|
8672
|
+
* This iterator runs indefinitely.
|
|
8673
|
+
*/
|
|
8674
|
+
[Symbol.asyncIterator](): AsyncIterator<T$1>;
|
|
8675
|
+
/**
|
|
8676
|
+
* Returns a promise that resolves with the first event emitted that matches the provided predicate.
|
|
8677
|
+
*
|
|
8678
|
+
* @param predicate
|
|
8679
|
+
*/
|
|
8680
|
+
waitFor(predicate: (data: T$1) => boolean): Promise<T$1>;
|
|
8681
|
+
/**
|
|
8682
|
+
* Returns a promise that resolves once a specific number of events was emitted since this method was called.
|
|
8683
|
+
*
|
|
8684
|
+
* @param expectedCount
|
|
8685
|
+
*/
|
|
8686
|
+
waitForCount(expectedCount: number): Promise<T$1>;
|
|
8687
|
+
/**
|
|
8688
|
+
* Turn any variant of `Event<T>` into an `Event<void>` discarding the callback parameter.
|
|
8689
|
+
*/
|
|
8690
|
+
discardParameter(): Event$1<void>;
|
|
8691
|
+
/**
|
|
8692
|
+
* Triggers an event with at least `timeout` milliseconds between each event.
|
|
8693
|
+
* If the event is triggered more often, the event is delayed until the timeout is reached.
|
|
8694
|
+
* If event is emitted for the first time or event wasn't fired for `timeout` milliseconds,
|
|
8695
|
+
* the event is emitted after `timeout / 8` ms.
|
|
8696
|
+
*/
|
|
8697
|
+
debounce(timeout?: number): Event$1<void>;
|
|
8468
8698
|
}
|
|
8469
8699
|
//#endregion
|
|
8470
8700
|
//#region ../echo/dist/types/src/internal/JsonSchema/json-schema-type.d.ts
|
|
@@ -8679,30 +8909,333 @@ declare const _JsonSchemaType: Struct<{
|
|
|
8679
8909
|
interface JsonSchemaType extends Schema.Type<typeof _JsonSchemaType> {}
|
|
8680
8910
|
declare const JsonSchemaType: Schema<JsonSchemaType>;
|
|
8681
8911
|
//#endregion
|
|
8682
|
-
//#region ../echo/dist/types/src/internal/
|
|
8683
|
-
|
|
8912
|
+
//#region ../echo/dist/types/src/internal/Entity/entity.d.ts
|
|
8913
|
+
type EchoTypeSchemaProps<T$1, ExtraFields = {}> = Simplify$1<AnyEntity & ToMutable<T$1> & ExtraFields>;
|
|
8684
8914
|
/**
|
|
8685
|
-
*
|
|
8915
|
+
* Options accepted by every `Type.makeObject` / `Type.makeRelation` / type-kind
|
|
8916
|
+
* factory. Defaults are derived from `(typename, version)` so callers normally
|
|
8917
|
+
* pass nothing.
|
|
8686
8918
|
*/
|
|
8687
|
-
|
|
8919
|
+
type EchoTypeOptions = {
|
|
8920
|
+
/**
|
|
8921
|
+
* Override the entity id stamped on the in-memory `Type.Type` value.
|
|
8922
|
+
*
|
|
8923
|
+
* Defaults to `EntityId.deterministic(typename, version)` — stable across processes
|
|
8924
|
+
* and workerd-safe (no `crypto.getRandomValues()` at module-evaluation time).
|
|
8925
|
+
* Pass an explicit id (typically `EntityId.random()`) to opt out of the
|
|
8926
|
+
* deterministic default.
|
|
8927
|
+
*/
|
|
8928
|
+
id?: EntityId;
|
|
8929
|
+
};
|
|
8688
8930
|
/**
|
|
8689
|
-
*
|
|
8931
|
+
* In-memory `Type.Type` entity shape produced by `Type.makeObject(dxn)` /
|
|
8932
|
+
* `Type.makeRelation({...})`. A live reactive `TypeSchema` instance —
|
|
8933
|
+
* identical to a persisted `Type.Type` except for database attachment.
|
|
8934
|
+
*
|
|
8935
|
+
* NOT a `Schema.Schema`. The underlying Effect Schema is cached on the hidden
|
|
8936
|
+
* `StaticTypeSchemaSlot` slot — retrieve it via `Type.getSchema(...)`.
|
|
8690
8937
|
*/
|
|
8691
|
-
interface
|
|
8692
|
-
<S$1 extends Schema.Any>(schema: S$1): RefSchema$1<Schema.Type<S$1>>;
|
|
8938
|
+
interface EchoTypeSchema<Self extends Schema.Any, ExtraFields = {}, K$1 extends EntityKind = EntityKind, Fields extends Struct.Fields = Struct.Fields> {
|
|
8693
8939
|
/**
|
|
8694
|
-
*
|
|
8940
|
+
* Entity-kind brand. Type entities are their own kind (`Type`) regardless of
|
|
8941
|
+
* the kind of instance they describe — `[SchemaKindId]` carries the latter.
|
|
8942
|
+
* This lets predicates like `Obj.isObject` / `Relation.isRelation` cleanly
|
|
8943
|
+
* reject type entities without also having to inspect `[SchemaKindId]`.
|
|
8695
8944
|
*/
|
|
8696
|
-
|
|
8945
|
+
readonly [KindId$1]: EntityKind.Type;
|
|
8946
|
+
/** Schema-kind brand indicating what kind of instance this type describes. */
|
|
8947
|
+
readonly [SchemaKindId]: K$1;
|
|
8697
8948
|
/**
|
|
8698
|
-
*
|
|
8949
|
+
* Entity id. Always present — stamped at construction — but NOT the type's
|
|
8950
|
+
* identity while in-memory: an unattached type resolves its URI to the typename
|
|
8951
|
+
* DXN, switching to `echo:/<id>` only once attached to a database (see
|
|
8952
|
+
* `getTypeURIFromSpecifier`, which discriminates by database attachment).
|
|
8699
8953
|
*/
|
|
8700
|
-
|
|
8954
|
+
readonly id: EntityId;
|
|
8955
|
+
/** Source Effect Schema (kept on a hidden slot for `Type.getSchema`). */
|
|
8956
|
+
readonly [StaticTypeSchemaSlot]: Schema.AnyNoContext;
|
|
8957
|
+
readonly jsonSchema: JsonSchemaType;
|
|
8958
|
+
/** Struct fields for introspection. */
|
|
8959
|
+
readonly fields: Fields;
|
|
8960
|
+
/** Phantom — instance type produced by `Obj.make(self, ...)`. */
|
|
8961
|
+
readonly _instance?: EchoTypeSchemaProps<Schema.Type<Self>, ExtraFields>;
|
|
8701
8962
|
/**
|
|
8702
|
-
*
|
|
8963
|
+
* Phantom slot mirroring `Type<A>` so internal helpers (`makeObject`,
|
|
8964
|
+
* `createObject`, `Ref.make`) infer the instance type uniformly whether
|
|
8965
|
+
* the caller passes an `EchoTypeSchema` or a top-level `Type.Type` entity.
|
|
8966
|
+
*
|
|
8967
|
+
* Includes the instance-kind brand (`[KindId]`) so the phantom is assignable
|
|
8968
|
+
* to the matching public-side interface in `Type.ts` (`Type.Obj` /
|
|
8969
|
+
* `Type.Relation` / `Type.Type`). Each kind projects identity: instances of
|
|
8970
|
+
* an object-kind schema are object-kind entities, type-kind schemas produce
|
|
8971
|
+
* type-kind (persisted Type.Type) entities — the latter additionally carry
|
|
8972
|
+
* the `[SchemaKindId]` / `[StaticTypeSchemaSlot]` brands the echo-handler
|
|
8973
|
+
* proxy exposes on persisted Type entities.
|
|
8703
8974
|
*/
|
|
8704
|
-
|
|
8705
|
-
|
|
8975
|
+
readonly [InstancePhantomId$1]?: EchoTypeSchemaProps<Schema.Type<Self>, ExtraFields> & {
|
|
8976
|
+
readonly [KindId$1]: K$1;
|
|
8977
|
+
} & (K$1 extends EntityKind.Type ? {
|
|
8978
|
+
readonly [SchemaKindId]: EntityKind.Type;
|
|
8979
|
+
readonly [StaticTypeSchemaSlot]: Schema.AnyNoContext;
|
|
8980
|
+
} : {});
|
|
8981
|
+
}
|
|
8982
|
+
//#endregion
|
|
8983
|
+
//#region ../echo/dist/types/src/internal/Entity/type-kind.d.ts
|
|
8984
|
+
/**
|
|
8985
|
+
* Type-kind schema marker — produced by {@link EchoTypeKindSchema}.
|
|
8986
|
+
*
|
|
8987
|
+
* Distinguishes meta-schemas (entities of `EntityKind.Type`, such as the
|
|
8988
|
+
* built-in `Type.Type` TypeSchema) from object and relation types.
|
|
8989
|
+
*/
|
|
8990
|
+
type EchoTypeKindSchema<Self extends Schema.Any, Fields extends Struct.Fields = Struct.Fields> = EchoTypeSchema<Self, {}, EntityKind.Type, Fields>;
|
|
8991
|
+
/**
|
|
8992
|
+
* Pipeable that brands a schema as a type-kind ECHO entity. Mirrors
|
|
8993
|
+
* {@link EchoObjectSchema} / {@link EchoRelationSchema}, but stamps the
|
|
8994
|
+
* resulting entity with `[SchemaKindId]: EntityKind.Type` and a matching
|
|
8995
|
+
* `TypeAnnotation.kind = 'type'` so meta-schemas surface uniformly through
|
|
8996
|
+
* `Type.isTypeKind`, `Filter.type`, etc.
|
|
8997
|
+
*/
|
|
8998
|
+
declare const EchoTypeKindSchema: {
|
|
8999
|
+
(dxn: DXN, options?: EchoTypeOptions): <Self extends Schema.Any, Fields extends Struct.Fields = Struct.Fields>(self: Self & {
|
|
9000
|
+
fields?: Fields;
|
|
9001
|
+
}) => EchoTypeKindSchema<Self, Fields>;
|
|
9002
|
+
};
|
|
9003
|
+
//#endregion
|
|
9004
|
+
//#region ../echo/dist/types/src/internal/Type/type-schema.d.ts
|
|
9005
|
+
/**
|
|
9006
|
+
* Raw struct backing {@link TypeSchema}. Exposed only so `TypeSchema`
|
|
9007
|
+
* (the TS type) can derive its data fields via `Schema.Schema.Type<typeof ...>`;
|
|
9008
|
+
* runtime callers should use {@link TypeSchema} (the piped, branded entity).
|
|
9009
|
+
*
|
|
9010
|
+
* `typename` and `version` are NOT data fields — they live in `EntityMeta.key` /
|
|
9011
|
+
* `EntityMeta.version` (the canonical registry-provenance pair, queryable via
|
|
9012
|
+
* `Filter.key(...)`). The same `jsonSchema` payload also embeds them so a
|
|
9013
|
+
* standalone JSON-Schema export remains self-describing, but the schema-registry
|
|
9014
|
+
* reads/writes them through meta.
|
|
9015
|
+
*/
|
|
9016
|
+
declare const TypeSchemaStruct: Struct<{
|
|
9017
|
+
name: optional<typeof String$>;
|
|
9018
|
+
jsonSchema: Schema<JsonSchemaType, JsonSchemaType, never>;
|
|
9019
|
+
}>;
|
|
9020
|
+
/**
|
|
9021
|
+
* Persistent representation of a schema.
|
|
9022
|
+
*/
|
|
9023
|
+
declare const TypeSchema: EchoTypeKindSchema<Struct<{
|
|
9024
|
+
name: optional<typeof String$>;
|
|
9025
|
+
jsonSchema: Schema<JsonSchemaType, JsonSchemaType, never>;
|
|
9026
|
+
}>, Readonly<{
|
|
9027
|
+
name: optional<typeof String$>;
|
|
9028
|
+
jsonSchema: Schema<JsonSchemaType, JsonSchemaType, never>;
|
|
9029
|
+
}>>;
|
|
9030
|
+
/**
|
|
9031
|
+
* Persistent representation of a schema — the runtime shape that
|
|
9032
|
+
* `db.addType(Type.makeObjectFromJsonSchema(...))` produces
|
|
9033
|
+
* and `Filter.type(Type.Type).run()` returns.
|
|
9034
|
+
*
|
|
9035
|
+
* Structurally identical to a static `Type.Type` entity: the entity-handler's
|
|
9036
|
+
* `get` trap exposes `[SchemaKindId]` (derived from `system.kind` and
|
|
9037
|
+
* `data.jsonSchema.entityKind`) and rebuilds `[StaticTypeSchemaSlot]` lazily
|
|
9038
|
+
* from `jsonSchema`, so a persisted instance satisfies the public `Type<A>`
|
|
9039
|
+
* interface without casting.
|
|
9040
|
+
*/
|
|
9041
|
+
type TypeSchema = Schema.Type<typeof TypeSchemaStruct> & {
|
|
9042
|
+
/** Object identifier — injected by `EchoTypeKindSchema` and stamped at construction. */
|
|
9043
|
+
readonly id: string;
|
|
9044
|
+
/** Entity-kind discriminator (object/relation/type) carried on every entity instance. */
|
|
9045
|
+
readonly [KindId$1]: EntityKind.Type;
|
|
9046
|
+
/** Kind of schema described by this meta-instance — always `EntityKind.Type` for `Type.Type` itself. */
|
|
9047
|
+
readonly [SchemaKindId]: EntityKind.Type;
|
|
9048
|
+
/** Effect Schema rebuilt lazily from `jsonSchema`; satisfies `Type.getSchema(...)` without an extra cast. */
|
|
9049
|
+
readonly [StaticTypeSchemaSlot]: Schema.AnyNoContext;
|
|
9050
|
+
};
|
|
9051
|
+
//#endregion
|
|
9052
|
+
//#region ../echo/dist/types/src/Relation.d.ts
|
|
9053
|
+
type Endpoints$1<Source$1, Target$2> = {
|
|
9054
|
+
[Source$1]: Source$1;
|
|
9055
|
+
[Target$2]: Target$2;
|
|
9056
|
+
};
|
|
9057
|
+
/**
|
|
9058
|
+
* Get relation source type.
|
|
9059
|
+
*/
|
|
9060
|
+
type SourceOf<A$1> = A$1 extends Endpoints$1<infer S, infer _T> ? S : never;
|
|
9061
|
+
/**
|
|
9062
|
+
* Get relation target type.
|
|
9063
|
+
*/
|
|
9064
|
+
type TargetOf<A$1> = A$1 extends Endpoints$1<infer _S, infer T> ? T : never;
|
|
9065
|
+
//#endregion
|
|
9066
|
+
//#region ../echo/dist/types/src/Type.d.ts
|
|
9067
|
+
/**
|
|
9068
|
+
* Structural base shared by the three sibling type-entity interfaces
|
|
9069
|
+
* ({@link Obj}, {@link Relation}, {@link Type}). NOT exported — callers
|
|
9070
|
+
* should constrain on {@link AnyEntity} when they want "any of the three"
|
|
9071
|
+
* and on the specific kind interface otherwise.
|
|
9072
|
+
*/
|
|
9073
|
+
interface BaseTypeEntity<A$1> {
|
|
9074
|
+
/**
|
|
9075
|
+
* Entity-kind brand of the type-entity value itself — always `EntityKind.Type`.
|
|
9076
|
+
* The kind of instance the type *describes* lives on `[SchemaKindId]`
|
|
9077
|
+
* (Object / Relation / Type). Lets `Obj.isObject` / `Relation.isRelation`
|
|
9078
|
+
* reject type entities by a single `[KindId]` check.
|
|
9079
|
+
*/
|
|
9080
|
+
readonly [KindId$1]: EntityKind.Type;
|
|
9081
|
+
/**
|
|
9082
|
+
* Object id. Like all ECHO entities, type entities always carry an id —
|
|
9083
|
+
* stamped at construction for in-memory (static) declarations and assigned by
|
|
9084
|
+
* the database once persisted. The id does NOT determine the entity's URI:
|
|
9085
|
+
* static types resolve to their typename DXN, persisted types to `echo:/<id>`
|
|
9086
|
+
* (see `getTypeURIFromSpecifier`).
|
|
9087
|
+
*/
|
|
9088
|
+
readonly id: EntityId;
|
|
9089
|
+
readonly name?: string;
|
|
9090
|
+
readonly jsonSchema: JsonSchemaType;
|
|
9091
|
+
readonly [InstancePhantomId]?: A$1;
|
|
9092
|
+
}
|
|
9093
|
+
/**
|
|
9094
|
+
* TypeScript type for an ECHO object type — a `Type.Type<A>` entity.
|
|
9095
|
+
*
|
|
9096
|
+
* `T` is the instance type produced by `Obj.make(Foo, props)`. `Fields` is
|
|
9097
|
+
* retained as a structural hint (the runtime value still carries `.fields`),
|
|
9098
|
+
* but consumers should derive instance/encoded types via `Type.InstanceType`.
|
|
9099
|
+
*
|
|
9100
|
+
* **Not a `Schema.Schema`.** `Foo.ast` / `Schema.Schema.Type<typeof Foo>` /
|
|
9101
|
+
* `Schema.extend(Foo)` no longer typecheck — extract the Effect Schema via
|
|
9102
|
+
* `Type.getSchema(Foo)` first, or derive instance types via
|
|
9103
|
+
* `Type.InstanceType<typeof Foo>`.
|
|
9104
|
+
*
|
|
9105
|
+
* @example
|
|
9106
|
+
* ```ts
|
|
9107
|
+
* const Person = Schema.Struct({
|
|
9108
|
+
* name: Schema.String,
|
|
9109
|
+
* }).pipe(Type.makeObject(DXN.make('com.example.type.person', '0.1.0')));
|
|
9110
|
+
*
|
|
9111
|
+
* type Person = Type.InstanceType<typeof Person>;
|
|
9112
|
+
* ```
|
|
9113
|
+
*/
|
|
9114
|
+
interface Obj$1<T$1, Fields extends Struct.Fields = Struct.Fields> extends BaseTypeEntity<T$1 & OfKind<typeof Kind.Object>> {
|
|
9115
|
+
/** Schema-kind brand (object). */
|
|
9116
|
+
readonly [SchemaKindId]: EntityKind.Object;
|
|
9117
|
+
/** Source Effect Schema — used internally by `Type.getSchema(self)`. */
|
|
9118
|
+
readonly [StaticTypeSchemaSlot]: Schema.AnyNoContext;
|
|
9119
|
+
/**
|
|
9120
|
+
* The fields defined in the original struct schema.
|
|
9121
|
+
* Allows accessing field definitions for introspection.
|
|
9122
|
+
*/
|
|
9123
|
+
readonly fields: Fields;
|
|
9124
|
+
}
|
|
9125
|
+
/**
|
|
9126
|
+
* Type that represents any ECHO object type — a `Type.Type` entity branded
|
|
9127
|
+
* with the object entity kind, i.e. what `Type.makeObject(dxn)` produces.
|
|
9128
|
+
*/
|
|
9129
|
+
type AnyObj = Obj$1<unknown>;
|
|
9130
|
+
/**
|
|
9131
|
+
* ECHO meta-schema entity — stores `{ name?, typename, version, jsonSchema }`.
|
|
9132
|
+
* Type-kind sibling of `Type.makeObject(...)` / `Type.makeRelation(...)` outputs.
|
|
9133
|
+
* Stored types live under this entity; filter via `Filter.type(Type.Type)`.
|
|
9134
|
+
*/
|
|
9135
|
+
declare const Type$3: Type$3<TypeSchema>;
|
|
9136
|
+
/**
|
|
9137
|
+
* TypeScript type for an ECHO relation type — a `Type.Type<A>` entity.
|
|
9138
|
+
*
|
|
9139
|
+
* `T` is the instance-property type produced by `Relation.make(...)` (excluding
|
|
9140
|
+
* source/target endpoints). `Source` and `Target` are the endpoint types.
|
|
9141
|
+
*
|
|
9142
|
+
* **Not a `Schema.Schema`.** See {@link Obj}'s note.
|
|
9143
|
+
*/
|
|
9144
|
+
interface Relation<T$1, Source$1, Target$2, Fields extends Struct.Fields = Struct.Fields> extends BaseTypeEntity<Endpoints$1<Source$1, Target$2> & T$1 & OfKind<typeof Kind.Relation>> {
|
|
9145
|
+
/** Schema-kind brand (relation). */
|
|
9146
|
+
readonly [SchemaKindId]: EntityKind.Relation;
|
|
9147
|
+
/** Source Effect Schema — used internally by `Type.getSchema(self)`. */
|
|
9148
|
+
readonly [StaticTypeSchemaSlot]: Schema.AnyNoContext;
|
|
9149
|
+
/**
|
|
9150
|
+
* The fields defined in the original struct schema.
|
|
9151
|
+
* Allows accessing field definitions for introspection.
|
|
9152
|
+
*/
|
|
9153
|
+
readonly fields: Fields;
|
|
9154
|
+
}
|
|
9155
|
+
/**
|
|
9156
|
+
* Type that represents any ECHO relation type — a `Type.Type` entity branded
|
|
9157
|
+
* with the relation entity kind, i.e. what `Type.makeRelation(...)` produces.
|
|
9158
|
+
*/
|
|
9159
|
+
type AnyRelation = Relation<unknown, unknown, unknown>;
|
|
9160
|
+
/**
|
|
9161
|
+
* Type that represents any ECHO type-kind entity — a `Type.Type` meta-schema
|
|
9162
|
+
* value (static `Type.Type` or a persisted draft from `db.addType(...)`).
|
|
9163
|
+
* Mirrors {@link AnyObj} / {@link AnyRelation} for the third sibling kind.
|
|
9164
|
+
*/
|
|
9165
|
+
type AnyType = Type$3<unknown>;
|
|
9166
|
+
/**
|
|
9167
|
+
* Any ECHO type-entity — one of the three sibling kinds: object-kind, relation-kind,
|
|
9168
|
+
* or type-kind (the meta-schema). APIs that want "any ECHO type" use this union;
|
|
9169
|
+
* the underlying Effect Schema is retrieved via `Type.getSchema`.
|
|
9170
|
+
*/
|
|
9171
|
+
type AnyEntity$1 = AnyObj | AnyRelation | AnyType;
|
|
9172
|
+
/**
|
|
9173
|
+
* String key used to phantom-carry the instance type produced by a `Type.Type`.
|
|
9174
|
+
* Used by `Type.InstanceType<typeof Foo>` to recover the schema instance type
|
|
9175
|
+
* since `Type.makeObject(dxn)` does not return a `Schema.Schema`.
|
|
9176
|
+
*
|
|
9177
|
+
* Re-exported from the internal types layer so both `Type.ts` and internal
|
|
9178
|
+
* helpers (`makeObject`, `createObject`) reference the same phantom key.
|
|
9179
|
+
*/
|
|
9180
|
+
declare const InstancePhantomId: "~@dxos/echo/Type.Instance";
|
|
9181
|
+
type InstancePhantomId = InstancePhantomId$1;
|
|
9182
|
+
/**
|
|
9183
|
+
* Sibling of {@link Obj} / {@link Relation} for the third ECHO entity kind:
|
|
9184
|
+
* **type-kind** entities (meta-schemas). The singleton {@link Type} const is
|
|
9185
|
+
* the canonical example — it describes stored type definitions themselves.
|
|
9186
|
+
*
|
|
9187
|
+
* Not a `Schema.Schema`. Use `Type.getSchema(value)` to obtain the underlying
|
|
9188
|
+
* Effect Schema and `Type.update(value, draft => ...)` to mutate.
|
|
9189
|
+
*
|
|
9190
|
+
* `A` is the instance-type phantom — what `Obj.make(value, ...)` would produce.
|
|
9191
|
+
* Merged with the `Type` const value via TypeScript declaration merging.
|
|
9192
|
+
*/
|
|
9193
|
+
interface Type$3<A$1 = unknown> extends BaseTypeEntity<A$1 & OfKind<typeof Kind.Type>> {
|
|
9194
|
+
/** Schema-kind brand (type — the meta-schema kind). */
|
|
9195
|
+
readonly [SchemaKindId]: EntityKind.Type;
|
|
9196
|
+
/** Source Effect Schema — used internally by `Type.getSchema(self)`. */
|
|
9197
|
+
readonly [StaticTypeSchemaSlot]: Schema.AnyNoContext;
|
|
9198
|
+
}
|
|
9199
|
+
/**
|
|
9200
|
+
* Instance type produced by a Type entity.
|
|
9201
|
+
*
|
|
9202
|
+
* Accepts ONLY {@link AnyEntity} inputs — `Type.Obj`, `Type.Relation`, or
|
|
9203
|
+
* `Type.Type`. Raw Effect `Schema.Schema` values are rejected: for those, use
|
|
9204
|
+
* `Schema.Schema.Type<typeof Foo>` directly. This separation keeps the type
|
|
9205
|
+
* system honest about which values represent ECHO entities versus plain
|
|
9206
|
+
* Effect schemas.
|
|
9207
|
+
*
|
|
9208
|
+
* Dispatches on the entity kind:
|
|
9209
|
+
* - `Relation<Props, S, T>` → `Endpoints<S,T> & Props & OfKind<Relation>`
|
|
9210
|
+
* - `Obj<A>` → `A & OfKind<Object>`
|
|
9211
|
+
* - `Type<A>` → `A & OfKind<Type>`
|
|
9212
|
+
*/
|
|
9213
|
+
type InstanceType$1<T$1 extends AnyEntity$1> = T$1 extends Relation<infer Props, infer Source, infer Target, any> ? Endpoints$1<Source, Target> & Props & OfKind<typeof Kind.Relation> : T$1 extends Obj$1<infer A, any> ? A & OfKind<typeof Kind.Object> : T$1 extends Type$3<infer A> ? A & OfKind<typeof Kind.Type> : never;
|
|
9214
|
+
//#endregion
|
|
9215
|
+
//#region ../echo/dist/types/src/internal/Ref/ref.d.ts
|
|
9216
|
+
declare const RefTypeId: unique symbol;
|
|
9217
|
+
/**
|
|
9218
|
+
* Reference Schema.
|
|
9219
|
+
*/
|
|
9220
|
+
interface RefSchema$1<T$1 extends AnyEntity> extends SchemaClass<Ref<T$1>, EncodedReference> {}
|
|
9221
|
+
/**
|
|
9222
|
+
* Type of the `Ref` function and extra methods attached to it.
|
|
9223
|
+
*/
|
|
9224
|
+
interface RefFn {
|
|
9225
|
+
<S$1 extends AnyEntity$1 | UnknownTypeSchema<any, any> = AnyEntity$1>(schema: S$1): RefSchema$1<S$1 extends AnyType ? AnyEntity$1 : S$1 extends AnyObj | AnyRelation ? InstanceType$1<S$1> : S$1 extends UnknownTypeSchema<infer A, any> ? A : never>;
|
|
9226
|
+
/**
|
|
9227
|
+
* @returns True if the object is a reference.
|
|
9228
|
+
*/
|
|
9229
|
+
isRef: (obj: unknown) => obj is Ref<any>;
|
|
9230
|
+
/**
|
|
9231
|
+
* @returns True if the reference points to the given object id.
|
|
9232
|
+
*/
|
|
9233
|
+
hasEntityId: (id: EntityId) => (ref: Ref<any>) => boolean;
|
|
9234
|
+
/**
|
|
9235
|
+
* @returns True if the schema is a reference schema.
|
|
9236
|
+
*/
|
|
9237
|
+
isRefSchema: (schema: Schema<any, any>) => schema is RefSchema$1<any>;
|
|
9238
|
+
/**
|
|
8706
9239
|
* @returns True if the schema AST is a reference schema.
|
|
8707
9240
|
*/
|
|
8708
9241
|
isRefSchemaAST: (ast: AST) => boolean;
|
|
@@ -8711,9 +9244,10 @@ interface RefFn {
|
|
|
8711
9244
|
*/
|
|
8712
9245
|
make: <T$1 extends AnyEntity>(object: T$1) => Ref<T$1>;
|
|
8713
9246
|
/**
|
|
8714
|
-
* Constructs a reference that points to the object specified by the provided
|
|
9247
|
+
* Constructs a reference that points to the object specified by the provided URI
|
|
9248
|
+
* (either an `echo:` EID for an object reference or a `dxn:` DXN for a type reference).
|
|
8715
9249
|
*/
|
|
8716
|
-
|
|
9250
|
+
fromURI: (uri: URI) => Ref<any>;
|
|
8717
9251
|
}
|
|
8718
9252
|
/**
|
|
8719
9253
|
* Schema builder for references.
|
|
@@ -8725,9 +9259,9 @@ declare const Ref: RefFn;
|
|
|
8725
9259
|
*/
|
|
8726
9260
|
interface Ref<T$1> extends Pipeable {
|
|
8727
9261
|
/**
|
|
8728
|
-
* Target object DXN.
|
|
9262
|
+
* Target URI (either an `echo:` EID for an object reference or a `dxn:` DXN for a type reference).
|
|
8729
9263
|
*/
|
|
8730
|
-
get
|
|
9264
|
+
get uri(): URI;
|
|
8731
9265
|
/**
|
|
8732
9266
|
* Returns true if the reference has a target available (inlined or resolver set).
|
|
8733
9267
|
*/
|
|
@@ -8794,16 +9328,24 @@ interface RefResolver {
|
|
|
8794
9328
|
/**
|
|
8795
9329
|
* Resolve ref synchronously from the objects in the working set.
|
|
8796
9330
|
*
|
|
8797
|
-
* @param
|
|
9331
|
+
* @param uri
|
|
8798
9332
|
* @param load If true the resolver should attempt to load the object from disk.
|
|
8799
9333
|
* @param onLoad Callback to call when the object is loaded.
|
|
8800
9334
|
*/
|
|
8801
|
-
resolveSync(
|
|
9335
|
+
resolveSync(uri: URI, load: boolean, onLoad?: () => void): AnyProperties | undefined;
|
|
8802
9336
|
/**
|
|
8803
9337
|
* Resolver ref asynchronously.
|
|
8804
9338
|
*/
|
|
8805
|
-
resolve(
|
|
8806
|
-
resolveSchema(
|
|
9339
|
+
resolve(uri: URI): Promise<AnyProperties | undefined>;
|
|
9340
|
+
resolveSchema(uri: URI): Promise<Schema.AnyNoContext | undefined>;
|
|
9341
|
+
/**
|
|
9342
|
+
* Resolve the source `Type.AnyEntity` entity for a type URI. Used by
|
|
9343
|
+
* deserialization paths (`Obj.fromJSON`) to set the back-reference accessed
|
|
9344
|
+
* via `Obj.getType` / `Entity.getType`. Optional — resolvers that only
|
|
9345
|
+
* carry raw schemas may leave this unimplemented; the deserializer falls
|
|
9346
|
+
* back to leaving the type entity unset.
|
|
9347
|
+
*/
|
|
9348
|
+
resolveType?(uri: URI): Promise<unknown | undefined>;
|
|
8807
9349
|
}
|
|
8808
9350
|
//#endregion
|
|
8809
9351
|
//#region ../echo/dist/types/src/Ref.d.ts
|
|
@@ -8835,10 +9377,14 @@ type Unknown$2 = Ref<Unknown$1>;
|
|
|
8835
9377
|
* ```ts
|
|
8836
9378
|
* const Task = Schema.Struct({
|
|
8837
9379
|
* assignee: Ref.Ref(Person), // Creates a Ref schema
|
|
8838
|
-
* }).pipe(Type.
|
|
9380
|
+
* }).pipe(Type.makeObject(DXN.make('com.example.type.task', '0.1.0')));
|
|
8839
9381
|
* ```
|
|
8840
9382
|
*/
|
|
8841
|
-
declare const Ref$1:
|
|
9383
|
+
declare const Ref$1: {
|
|
9384
|
+
<S$1 extends AnyObj | AnyRelation>(type: S$1): RefSchema<InstanceType$1<S$1> & Unknown$1>;
|
|
9385
|
+
<T$1 extends Type$3<any>>(type: T$1): RefSchema<InstanceType$1<T$1>>;
|
|
9386
|
+
<S$1 extends UnknownTypeSchema<any, any>>(schema: S$1): RefSchema<Schema.Type<S$1> & Unknown$1>;
|
|
9387
|
+
};
|
|
8842
9388
|
/**
|
|
8843
9389
|
* TypeScript type for a Ref schema.
|
|
8844
9390
|
* This is the type of the SCHEMA itself, not the runtime ref instance.
|
|
@@ -8857,265 +9403,12 @@ interface RefSchema<T$1 extends Unknown> extends RefSchema$1<T$1> {}
|
|
|
8857
9403
|
/**
|
|
8858
9404
|
* Extract reference target.
|
|
8859
9405
|
*/
|
|
8860
|
-
type Target<R$1 extends Unknown$2> = R$1 extends Ref<infer T> ? T : never;
|
|
9406
|
+
type Target$1<R$1 extends Unknown$2> = R$1 extends Ref<infer T> ? T : never;
|
|
8861
9407
|
/**
|
|
8862
9408
|
* Reference resolver.
|
|
8863
9409
|
*/
|
|
8864
9410
|
type Resolver = RefResolver;
|
|
8865
9411
|
//#endregion
|
|
8866
|
-
//#region ../echo/dist/types/src/internal/Obj/typed-object.d.ts
|
|
8867
|
-
/**
|
|
8868
|
-
* Definition for an object type that can be stored in an ECHO database.
|
|
8869
|
-
* Implements effect schema to define object properties.
|
|
8870
|
-
* Has a typename and version.
|
|
8871
|
-
*
|
|
8872
|
-
* In contrast to {@link EchoSchema} this definition is not recorded in the database.
|
|
8873
|
-
*
|
|
8874
|
-
* @deprecated Use `Type.AnyObj` from `@dxos/echo` instead.
|
|
8875
|
-
*/
|
|
8876
|
-
interface TypedObject<A$1 = any, I$1 = any> extends TypeMeta, Schema<A$1, I$1> {}
|
|
8877
|
-
/**
|
|
8878
|
-
* Typed object that could be used as a prototype in class definitions.
|
|
8879
|
-
* This is an internal API type.
|
|
8880
|
-
*
|
|
8881
|
-
* @deprecated Use `Type.AnyObj` from `@dxos/echo` instead.
|
|
8882
|
-
*/
|
|
8883
|
-
interface TypedObjectPrototype<A$1 = any, I$1 = any> extends TypedObject<A$1, I$1> {
|
|
8884
|
-
/** Type constructor. */
|
|
8885
|
-
new (): AnyEntity & A$1;
|
|
8886
|
-
}
|
|
8887
|
-
//#endregion
|
|
8888
|
-
//#region ../echo/dist/types/src/internal/Type/persistent-schema.d.ts
|
|
8889
|
-
/**
|
|
8890
|
-
* Persistent representation of a schema.
|
|
8891
|
-
*/
|
|
8892
|
-
declare const PersistentSchema: EchoObjectSchema<Struct<{
|
|
8893
|
-
name: optional<typeof String$>;
|
|
8894
|
-
typename: refine<string, typeof String$>;
|
|
8895
|
-
version: refine<string, typeof String$>;
|
|
8896
|
-
jsonSchema: Schema<JsonSchemaType, JsonSchemaType, never>;
|
|
8897
|
-
}>, Readonly<{
|
|
8898
|
-
name: optional<typeof String$>;
|
|
8899
|
-
typename: refine<string, typeof String$>;
|
|
8900
|
-
version: refine<string, typeof String$>;
|
|
8901
|
-
jsonSchema: Schema<JsonSchemaType, JsonSchemaType, never>;
|
|
8902
|
-
}>>;
|
|
8903
|
-
interface PersistentSchema extends Schema.Type<typeof PersistentSchema> {}
|
|
8904
|
-
//#endregion
|
|
8905
|
-
//#region ../echo/dist/types/src/internal/Type/echo-schema.d.ts
|
|
8906
|
-
/**
|
|
8907
|
-
* Base schema type.
|
|
8908
|
-
*/
|
|
8909
|
-
interface BaseSchema<A$1 = any, I$1 = any> extends TypedObject<A$1, I$1> {
|
|
8910
|
-
get readonly(): boolean;
|
|
8911
|
-
get mutable(): EchoSchema<A$1, I$1>;
|
|
8912
|
-
get snapshot(): Schema<A$1, I$1>;
|
|
8913
|
-
get jsonSchema(): JsonSchemaType;
|
|
8914
|
-
}
|
|
8915
|
-
declare const EchoSchema_base: TypedObjectPrototype<any, any>;
|
|
8916
|
-
/**
|
|
8917
|
-
* Represents a schema that is persisted in the ECHO database.
|
|
8918
|
-
* Schema can me mutable or readonly (specified by the {@link EchoSchema.readonly} field).
|
|
8919
|
-
*
|
|
8920
|
-
* Schema that can be modified at runtime via the API.
|
|
8921
|
-
* Is an instance of effect-schema (`Schema.Schema.AnyNoContext`) so it can be used in the same way as a regular schema.
|
|
8922
|
-
* IMPORTANT: The schema AST will change reactively when the schema is updated, including synced updates from remote peers.
|
|
8923
|
-
*
|
|
8924
|
-
* The class constructor is a schema instance itself, and can be used in the echo object definitions:
|
|
8925
|
-
*
|
|
8926
|
-
* @example
|
|
8927
|
-
* ```ts
|
|
8928
|
-
* export class TableType extends Schema.Struct({...}).pipe(Type.object({ typename: 'com.example.type.table', version: '0.1.0' })){
|
|
8929
|
-
* title: Schema.String,
|
|
8930
|
-
* schema: Schema.optional(ref(EchoSchema)),
|
|
8931
|
-
* props: Schema.mutable(S.Array(TablePropSchema)),
|
|
8932
|
-
* }) {}
|
|
8933
|
-
* ```
|
|
8934
|
-
*
|
|
8935
|
-
* The ECHO API will translate any references to PersistentSchema objects to be resolved as EchoSchema objects.
|
|
8936
|
-
*/
|
|
8937
|
-
declare class EchoSchema<A$1 = any, I$1 = any> extends EchoSchema_base implements BaseSchema<A$1, I$1> {
|
|
8938
|
-
private readonly _persistentSchema;
|
|
8939
|
-
private _schema;
|
|
8940
|
-
private _isDirty;
|
|
8941
|
-
/**
|
|
8942
|
-
* Schema kind key that marks this as an ECHO schema.
|
|
8943
|
-
* Makes EchoSchema satisfy the Type.AnyObj type.
|
|
8944
|
-
*/
|
|
8945
|
-
readonly [SchemaKindId]: EntityKind.Object;
|
|
8946
|
-
constructor(_persistentSchema: PersistentSchema);
|
|
8947
|
-
get [TypeId$1](): {
|
|
8948
|
-
_A: (_: any) => any;
|
|
8949
|
-
_I: (_: any) => any;
|
|
8950
|
-
_R: (_: never) => never;
|
|
8951
|
-
};
|
|
8952
|
-
get Type(): A$1;
|
|
8953
|
-
get Encoded(): I$1;
|
|
8954
|
-
get Context(): never;
|
|
8955
|
-
get ast(): AST;
|
|
8956
|
-
get annotations(): (annotations: Annotations.GenericSchema<any>) => Schema<any, any, never>;
|
|
8957
|
-
get pipe(): Schema.AnyNoContext['pipe'];
|
|
8958
|
-
get kind(): EntityKind.Object;
|
|
8959
|
-
get typename(): string;
|
|
8960
|
-
get version(): string;
|
|
8961
|
-
get readonly(): boolean;
|
|
8962
|
-
/**
|
|
8963
|
-
* Returns an immutable schema snapshot of the current state of the schema.
|
|
8964
|
-
*/
|
|
8965
|
-
get snapshot(): Schema.AnyNoContext;
|
|
8966
|
-
/**
|
|
8967
|
-
* Returns the JSON schema for the schema.
|
|
8968
|
-
*/
|
|
8969
|
-
get jsonSchema(): JsonSchemaType;
|
|
8970
|
-
/**
|
|
8971
|
-
* Returns a mutable schema.
|
|
8972
|
-
*/
|
|
8973
|
-
get mutable(): EchoSchema;
|
|
8974
|
-
/**
|
|
8975
|
-
* Id of the ECHO object containing the schema.
|
|
8976
|
-
*/
|
|
8977
|
-
get id(): ObjectId;
|
|
8978
|
-
/**
|
|
8979
|
-
* Short name of the schema.
|
|
8980
|
-
*/
|
|
8981
|
-
get name(): string | undefined;
|
|
8982
|
-
get [SchemaMetaSymbol](): SchemaMeta;
|
|
8983
|
-
/**
|
|
8984
|
-
* Reference to the underlying persistent schema object.
|
|
8985
|
-
*/
|
|
8986
|
-
get persistentSchema(): PersistentType;
|
|
8987
|
-
getProperties(): PropertySignature$1[];
|
|
8988
|
-
/**
|
|
8989
|
-
* @throws Error if the schema is readonly.
|
|
8990
|
-
*/
|
|
8991
|
-
updateTypename(typename: string): void;
|
|
8992
|
-
/**
|
|
8993
|
-
* @throws Error if the schema is readonly.
|
|
8994
|
-
*/
|
|
8995
|
-
addFields(fields: Struct.Fields): void;
|
|
8996
|
-
/**
|
|
8997
|
-
* @throws Error if the schema is readonly.
|
|
8998
|
-
*/
|
|
8999
|
-
updateFields(fields: Struct.Fields): void;
|
|
9000
|
-
/**
|
|
9001
|
-
* @throws Error if the schema is readonly.
|
|
9002
|
-
*/
|
|
9003
|
-
updateFieldPropertyName({
|
|
9004
|
-
before,
|
|
9005
|
-
after
|
|
9006
|
-
}: {
|
|
9007
|
-
before: PropertyKey;
|
|
9008
|
-
after: PropertyKey;
|
|
9009
|
-
}): void;
|
|
9010
|
-
/**
|
|
9011
|
-
* @throws Error if the schema is readonly.
|
|
9012
|
-
*/
|
|
9013
|
-
removeFields(fieldNames: string[]): void;
|
|
9014
|
-
/**
|
|
9015
|
-
* Wrapper for Obj.update that handles the change context for the persistent schema.
|
|
9016
|
-
*/
|
|
9017
|
-
private _change;
|
|
9018
|
-
/**
|
|
9019
|
-
* Called by DatabaseSchemaRegistry on update.
|
|
9020
|
-
*/
|
|
9021
|
-
_invalidate(): void;
|
|
9022
|
-
/**
|
|
9023
|
-
* Rebuilds this schema if it is dirty.
|
|
9024
|
-
*/
|
|
9025
|
-
_rebuild(): void;
|
|
9026
|
-
_getSchema(): Schema.AnyNoContext;
|
|
9027
|
-
}
|
|
9028
|
-
//#endregion
|
|
9029
|
-
//#region ../echo/dist/types/src/Relation.d.ts
|
|
9030
|
-
type Endpoints$1<Source, Target$1> = {
|
|
9031
|
-
[Source]: Source;
|
|
9032
|
-
[Target$1]: Target$1;
|
|
9033
|
-
};
|
|
9034
|
-
/**
|
|
9035
|
-
* Get relation source type.
|
|
9036
|
-
*/
|
|
9037
|
-
type SourceOf<A$1> = A$1 extends Endpoints$1<infer S, infer _T> ? S : never;
|
|
9038
|
-
/**
|
|
9039
|
-
* Get relation target type.
|
|
9040
|
-
*/
|
|
9041
|
-
type TargetOf<A$1> = A$1 extends Endpoints$1<infer _S, infer T> ? T : never;
|
|
9042
|
-
//#endregion
|
|
9043
|
-
//#region ../echo/dist/types/src/Type.d.ts
|
|
9044
|
-
/**
|
|
9045
|
-
* Dynamic type that can be constructed, mutated, and persisted in the ECHO database.
|
|
9046
|
-
*/
|
|
9047
|
-
declare const RuntimeType: typeof EchoSchema;
|
|
9048
|
-
/**
|
|
9049
|
-
* Dynamic type that can be constructed, mutated, and persisted in the ECHO database.
|
|
9050
|
-
*/
|
|
9051
|
-
type RuntimeType = EchoSchema;
|
|
9052
|
-
/**
|
|
9053
|
-
* Type that marks a schema as an ECHO schema.
|
|
9054
|
-
* The value indicates the entity kind (Object or Relation).
|
|
9055
|
-
*/
|
|
9056
|
-
type EchoSchemaKind<K$1 extends EntityKind = EntityKind> = {
|
|
9057
|
-
readonly [SchemaKindId]: K$1;
|
|
9058
|
-
};
|
|
9059
|
-
/**
|
|
9060
|
-
* TypeScript type for an ECHO object schema.
|
|
9061
|
-
* `T` is the instance type produced by the schema.
|
|
9062
|
-
* `Fields` is the optional struct fields type for introspection.
|
|
9063
|
-
*
|
|
9064
|
-
* @example
|
|
9065
|
-
* ```ts
|
|
9066
|
-
* const PersonSchema: Type.Obj<Person> = Schema.Struct({
|
|
9067
|
-
* name: Schema.String,
|
|
9068
|
-
* }).pipe(Type.object({ typename: 'Person', version: '0.1.0' }));
|
|
9069
|
-
*
|
|
9070
|
-
* // Access fields for introspection:
|
|
9071
|
-
* Object.keys(PersonSchema.fields); // ['name']
|
|
9072
|
-
* ```
|
|
9073
|
-
*/
|
|
9074
|
-
interface Obj$1<T$1, Fields extends Struct.Fields = Struct.Fields> extends TypeMeta, EchoSchemaKind<EntityKind.Object>, AnnotableClass<Obj$1<T$1, Fields>, OfKind<typeof Kind.Object> & T$1, Simplify<BaseObjJson & ToMutable<T$1>>, never> {
|
|
9075
|
-
/**
|
|
9076
|
-
* The fields defined in the original struct schema.
|
|
9077
|
-
* Allows accessing field definitions for introspection.
|
|
9078
|
-
*/
|
|
9079
|
-
readonly fields: Fields;
|
|
9080
|
-
}
|
|
9081
|
-
/**
|
|
9082
|
-
* Structural base type for any ECHO object schema.
|
|
9083
|
-
* Accepts both static schemas (created with Type.object()) and EchoSchema.
|
|
9084
|
-
* NOTE: Does not include the brand symbol to avoid TS4053 declaration portability issues.
|
|
9085
|
-
* Use Type.isObjectSchema() for runtime type guards.
|
|
9086
|
-
*/
|
|
9087
|
-
type ObjectSchemaBase = Schema.AnyNoContext & {
|
|
9088
|
-
readonly typename: string;
|
|
9089
|
-
readonly version: string;
|
|
9090
|
-
};
|
|
9091
|
-
/**
|
|
9092
|
-
* Type that represents any ECHO object schema.
|
|
9093
|
-
* Accepts both static schemas (Type.object()) and mutable schemas (EchoSchema).
|
|
9094
|
-
*/
|
|
9095
|
-
type AnyObj = ObjectSchemaBase;
|
|
9096
|
-
declare const PersistentType: Obj$1<PersistentSchema>;
|
|
9097
|
-
interface PersistentType extends Schema.Type<typeof PersistentType> {}
|
|
9098
|
-
/**
|
|
9099
|
-
* Structural base type for any ECHO relation schema.
|
|
9100
|
-
* Accepts static schemas (created with Type.relation()).
|
|
9101
|
-
* NOTE: Does not include the brand symbol to avoid TS4053 declaration portability issues.
|
|
9102
|
-
* Use Type.isRelationSchema() for runtime type guards.
|
|
9103
|
-
*/
|
|
9104
|
-
type RelationSchemaBase = Schema.AnyNoContext & {
|
|
9105
|
-
readonly typename: string;
|
|
9106
|
-
readonly version: string;
|
|
9107
|
-
};
|
|
9108
|
-
/**
|
|
9109
|
-
* Type that represents any ECHO relation schema.
|
|
9110
|
-
* Accepts static schemas (Type.relation()).
|
|
9111
|
-
*/
|
|
9112
|
-
type AnyRelation = RelationSchemaBase;
|
|
9113
|
-
/**
|
|
9114
|
-
* Type alias for any ECHO entity schema (object or relation).
|
|
9115
|
-
* Use this in type annotations for schema parameters.
|
|
9116
|
-
*/
|
|
9117
|
-
type AnyEntity$1 = AnyObj | AnyRelation;
|
|
9118
|
-
//#endregion
|
|
9119
9412
|
//#region ../echo/dist/types/src/Obj.d.ts
|
|
9120
9413
|
/**
|
|
9121
9414
|
* Base type for all ECHO objects.
|
|
@@ -9124,7 +9417,7 @@ interface BaseObj extends AnyEntity, OfKind<typeof Kind.Object> {}
|
|
|
9124
9417
|
/**
|
|
9125
9418
|
* Object type with specific properties.
|
|
9126
9419
|
*/
|
|
9127
|
-
type OfShape<Props$
|
|
9420
|
+
type OfShape<Props$2> = BaseObj & Props$2;
|
|
9128
9421
|
/**
|
|
9129
9422
|
* Object with no known properties beyond id and kind.
|
|
9130
9423
|
* Use this when the object's schema/properties are not known.
|
|
@@ -9152,18 +9445,12 @@ interface Unknown$1 extends BaseObj {}
|
|
|
9152
9445
|
* // Reference to any object type
|
|
9153
9446
|
* const Collection = Schema.Struct({
|
|
9154
9447
|
* objects: Schema.Array(Ref.Ref(Obj.Unknown)),
|
|
9155
|
-
* }).pipe(Type.
|
|
9448
|
+
* }).pipe(Type.makeObject(DXN.make('com.example.type.collection', '0.1.0')));
|
|
9156
9449
|
* ```
|
|
9157
9450
|
*/
|
|
9158
|
-
declare const Unknown$1:
|
|
9159
|
-
/**
|
|
9160
|
-
* JSON-encoded properties for objects.
|
|
9161
|
-
*/
|
|
9162
|
-
interface BaseObjJson {
|
|
9163
|
-
id: string;
|
|
9164
|
-
}
|
|
9451
|
+
declare const Unknown$1: UnknownTypeSchema<Unknown$1, typeof Kind.Object>;
|
|
9165
9452
|
declare namespace Filter_d_exports {
|
|
9166
|
-
export { Any$3 as Any, ChildOfOptions, Filter, KeyFilterOptions, Props, TextSearchOptions, Type$2 as Type, and, between, childOf, contains, created, eq, everything, foreignKeys, fromAst$1 as fromAst, gt, gte, id, in$ as in, is$1 as is, key$1 as key, lt, lte, neq, not, nothing, or, pretty$1 as pretty, props, tag, text, type$2 as type,
|
|
9453
|
+
export { Any$3 as Any, ChildOfOptions, Filter, KeyFilterOptions, Props$1 as Props, TextSearchOptions, Type$2 as Type, and, between, childOf, contains, created, eq, everything, foreignKeys, fromAst$1 as fromAst, gt, gte, id, in$ as in, is$1 as is, key$1 as key, lt, lte, neq, not, nothing, or, pretty$1 as pretty, props, tag, text, type$2 as type, typeURI, typename, updated };
|
|
9167
9454
|
}
|
|
9168
9455
|
interface Filter<T$1> {
|
|
9169
9456
|
'~Filter': {
|
|
@@ -9171,7 +9458,7 @@ interface Filter<T$1> {
|
|
|
9171
9458
|
};
|
|
9172
9459
|
ast: Filter$1;
|
|
9173
9460
|
}
|
|
9174
|
-
type Props<T$1> = { [K in keyof T$1 & string]?: Filter<T$1[K]> | T$1[K] };
|
|
9461
|
+
type Props$1<T$1> = { [K in keyof T$1 & string]?: Filter<T$1[K]> | T$1[K] };
|
|
9175
9462
|
type Any$3 = Filter<any>;
|
|
9176
9463
|
type Type$2<F extends Any$3> = F extends Filter<infer T> ? T : never;
|
|
9177
9464
|
declare class FilterClass implements Any$3 {
|
|
@@ -9193,19 +9480,30 @@ declare const everything: () => FilterClass;
|
|
|
9193
9480
|
* Filter that matches no objects.
|
|
9194
9481
|
*/
|
|
9195
9482
|
declare const nothing: () => FilterClass;
|
|
9196
|
-
declare const id: (...ids:
|
|
9483
|
+
declare const id: (...ids: EntityId[]) => Any$3;
|
|
9197
9484
|
/**
|
|
9198
9485
|
* Filter by type.
|
|
9486
|
+
*
|
|
9487
|
+
* Accepts a `Type.Type` entity (the value produced by `Type.makeObject` /
|
|
9488
|
+
* `Type.makeRelation`), a `Schema.Union` of such entities (for filtering across a
|
|
9489
|
+
* union of ECHO types), or a non-qualified typename string.
|
|
9199
9490
|
*/
|
|
9200
|
-
declare const type$2:
|
|
9491
|
+
declare const type$2: {
|
|
9492
|
+
<T$1 extends AnyEntity$1>(type: T$1, props?: Props$1<InstanceType$1<T$1>>): Filter<InstanceType$1<T$1>>;
|
|
9493
|
+
<S$1 extends UnknownTypeSchema<any, any>>(schema: S$1, props?: Props$1<Schema.Type<S$1>>): Filter<Schema.Type<S$1>>;
|
|
9494
|
+
<S$1 extends Union<readonly Schema.AnyNoContext[]>>(union: S$1, props?: Props$1<Schema.Type<S$1>>): Filter<Schema.Type<S$1>>;
|
|
9495
|
+
(schema: string, props?: Props$1<unknown>): Filter<any>;
|
|
9496
|
+
(input: AnyEntity$1 | string, props?: Props$1<unknown>): Filter<unknown>;
|
|
9497
|
+
};
|
|
9201
9498
|
/**
|
|
9202
9499
|
* Filter by non-qualified typename.
|
|
9203
9500
|
*/
|
|
9204
|
-
declare const typename
|
|
9501
|
+
declare const typename: (typename: string) => Any$3;
|
|
9205
9502
|
/**
|
|
9206
|
-
* Filter by fully qualified type DXN
|
|
9503
|
+
* Filter by fully qualified type URI — either a typename DXN (for static schemas) or
|
|
9504
|
+
* a schema-as-object EID (for stored dynamic schemas). See `getSchemaURI`.
|
|
9207
9505
|
*/
|
|
9208
|
-
declare const
|
|
9506
|
+
declare const typeURI: (uri: URI) => Any$3;
|
|
9209
9507
|
/**
|
|
9210
9508
|
* Filter by tag.
|
|
9211
9509
|
*/
|
|
@@ -9234,7 +9532,7 @@ declare const key$1: (key: string, options?: KeyFilterOptions) => Any$3;
|
|
|
9234
9532
|
/**
|
|
9235
9533
|
* Filter by properties.
|
|
9236
9534
|
*/
|
|
9237
|
-
declare const props: <T$1>(props: Props<T$1>) => Filter<T$1>;
|
|
9535
|
+
declare const props: <T$1>(props: Props$1<T$1>) => Filter<T$1>;
|
|
9238
9536
|
type TextSearchOptions = {
|
|
9239
9537
|
type?: 'full-text' | 'vector';
|
|
9240
9538
|
};
|
|
@@ -9245,7 +9543,7 @@ declare const text: (text: string, options?: TextSearchOptions) => Any$3;
|
|
|
9245
9543
|
/**
|
|
9246
9544
|
* Filter by foreign keys.
|
|
9247
9545
|
*/
|
|
9248
|
-
declare const foreignKeys: <S$1 extends
|
|
9546
|
+
declare const foreignKeys: <S$1 extends AnyEntity$1 | string>(schema: S$1, keys: ForeignKey[]) => Filter<S$1 extends AnyEntity$1 ? InstanceType$1<S$1> : unknown>;
|
|
9249
9547
|
/**
|
|
9250
9548
|
* Predicate for property to be equal to the provided value.
|
|
9251
9549
|
*/
|
|
@@ -9305,7 +9603,7 @@ type ChildOfOptions = {
|
|
|
9305
9603
|
/**
|
|
9306
9604
|
* Filter objects that are children of the specified parent(s).
|
|
9307
9605
|
* Accepts ECHO objects, Refs, or arrays of either.
|
|
9308
|
-
* Refs are resolved to DXNs without loading; objects use {@link Obj.
|
|
9606
|
+
* Refs are resolved to DXNs without loading; objects use {@link Obj.getURI}.
|
|
9309
9607
|
* With transitive=true (default), also matches grandchildren and beyond.
|
|
9310
9608
|
*/
|
|
9311
9609
|
declare const childOf: (parents: Unknown$1 | Unknown$2 | readonly (Unknown$1 | Unknown$2)[], options?: ChildOfOptions) => Any$3;
|
|
@@ -9326,12 +9624,15 @@ declare const or: <Filters extends readonly Any$3[]>(...filters: Filters) => Fil
|
|
|
9326
9624
|
*/
|
|
9327
9625
|
declare const pretty$1: (filter: Any$3) => string;
|
|
9328
9626
|
//#endregion
|
|
9329
|
-
//#region ../echo/dist/types/src/
|
|
9627
|
+
//#region ../echo/dist/types/src/Collection.d.ts
|
|
9330
9628
|
/**
|
|
9331
|
-
*
|
|
9629
|
+
* A an ordered set of objects.
|
|
9332
9630
|
*/
|
|
9333
|
-
|
|
9334
|
-
|
|
9631
|
+
declare const Collection: Obj$1<{
|
|
9632
|
+
readonly name?: string | undefined;
|
|
9633
|
+
readonly objects: readonly Ref<Unknown$1>[];
|
|
9634
|
+
}, Struct.Fields>;
|
|
9635
|
+
type Collection = InstanceType$1<typeof Collection>;
|
|
9335
9636
|
//#endregion
|
|
9336
9637
|
//#region ../echo/dist/types/src/QueryResult.d.ts
|
|
9337
9638
|
/**
|
|
@@ -9408,155 +9709,6 @@ interface QueryResult<T$1> {
|
|
|
9408
9709
|
subscribe(callback?: (query: QueryResult<T$1>) => void, opts?: SubscriptionOptions): CleanupFn;
|
|
9409
9710
|
}
|
|
9410
9711
|
//#endregion
|
|
9411
|
-
//#region ../echo/dist/types/src/SchemaRegistry.d.ts
|
|
9412
|
-
type Query$1 = {
|
|
9413
|
-
/**
|
|
9414
|
-
* Filter by schema ID.
|
|
9415
|
-
* Schema id is a DXN with `echo` or `type` kind.
|
|
9416
|
-
*/
|
|
9417
|
-
id?: string | string[];
|
|
9418
|
-
/**
|
|
9419
|
-
* Id of the backing ECHO object.
|
|
9420
|
-
*/
|
|
9421
|
-
backingObjectId?: ObjectId | ObjectId[];
|
|
9422
|
-
/**
|
|
9423
|
-
* One or more typenames to filter by.
|
|
9424
|
-
*/
|
|
9425
|
-
typename?: string | string[];
|
|
9426
|
-
/**
|
|
9427
|
-
* [Semver Range](https://docs.npmjs.com/cli/v6/using-npm/semver#ranges) for the schema version.
|
|
9428
|
-
*/
|
|
9429
|
-
version?: string;
|
|
9430
|
-
/**
|
|
9431
|
-
* Where to look for the schema.
|
|
9432
|
-
*
|
|
9433
|
-
* Database schema are stored in the database of the current space.
|
|
9434
|
-
* Runtime schema are registered in the runtime.
|
|
9435
|
-
*
|
|
9436
|
-
* @default ['database']
|
|
9437
|
-
*/
|
|
9438
|
-
location?: ('database' | 'runtime')[];
|
|
9439
|
-
/**
|
|
9440
|
-
* Include system schemas.
|
|
9441
|
-
* @default false
|
|
9442
|
-
*
|
|
9443
|
-
* The system schema include but are not limited to:
|
|
9444
|
-
* - org.dxos.type.schema
|
|
9445
|
-
*/
|
|
9446
|
-
includeSystem?: boolean;
|
|
9447
|
-
};
|
|
9448
|
-
/**
|
|
9449
|
-
* Input for schema registration.
|
|
9450
|
-
* The typename, version and schema mutability metadata is read from the schema annotations.
|
|
9451
|
-
*
|
|
9452
|
-
* Accepts:
|
|
9453
|
-
* - Branded ECHO schemas created with Type.Obj() or Type.Relation()
|
|
9454
|
-
* - JSON schema with typename and version
|
|
9455
|
-
*/
|
|
9456
|
-
type RegisterSchemaInput = AnyEntity$1 | {
|
|
9457
|
-
typename: string;
|
|
9458
|
-
version: string;
|
|
9459
|
-
jsonSchema: JsonSchema;
|
|
9460
|
-
/**
|
|
9461
|
-
* Display name of the schema.
|
|
9462
|
-
*/
|
|
9463
|
-
name?: string;
|
|
9464
|
-
};
|
|
9465
|
-
type ExtractQueryResult<Query$3> = Query$3 extends {
|
|
9466
|
-
location: ('database' | 'runtime')[];
|
|
9467
|
-
} ? AnyEntity$1 : RuntimeType;
|
|
9468
|
-
interface SchemaRegistry {
|
|
9469
|
-
/**
|
|
9470
|
-
* Checks if the provided schema is registered.
|
|
9471
|
-
*/
|
|
9472
|
-
hasSchema(schema: AnyEntity$1): boolean;
|
|
9473
|
-
/**
|
|
9474
|
-
* Registers the provided schema.
|
|
9475
|
-
*
|
|
9476
|
-
* @returns Mutable runtime instances of schemas that were registered.
|
|
9477
|
-
*
|
|
9478
|
-
* The behavior of this method depends on the state of the database.
|
|
9479
|
-
* The general principle is that the schema will be upserted into the space.
|
|
9480
|
-
* If an equivalent schema with the same name and version already exists, the method does nothing.
|
|
9481
|
-
* If a different schema with the same name and version exists, the method throws an error.
|
|
9482
|
-
* If no schema with the same name and version exists, a new schema will be inserted based on semantic versioning rules.
|
|
9483
|
-
*/
|
|
9484
|
-
register(input: RegisterSchemaInput[]): Promise<RuntimeType[]>;
|
|
9485
|
-
/**
|
|
9486
|
-
*
|
|
9487
|
-
*/
|
|
9488
|
-
query<Q extends NoExcessProperties<Query$1, Q>>(query?: Q & Query$1): QueryResult<ExtractQueryResult<Q>>;
|
|
9489
|
-
}
|
|
9490
|
-
//#endregion
|
|
9491
|
-
//#region ../echo/dist/types/src/Hypergraph.d.ts
|
|
9492
|
-
/**
|
|
9493
|
-
* Resolution context.
|
|
9494
|
-
* Affects how non-absolute DXNs are resolved.
|
|
9495
|
-
*/
|
|
9496
|
-
interface RefResolutionContext {
|
|
9497
|
-
/**
|
|
9498
|
-
* Space that the resolution is happening from.
|
|
9499
|
-
*/
|
|
9500
|
-
space?: SpaceId;
|
|
9501
|
-
/**
|
|
9502
|
-
* Feed that the resolution is happening from (as the underlying queue DXN).
|
|
9503
|
-
* This feed will be searched first, and then the space it belongs to.
|
|
9504
|
-
*/
|
|
9505
|
-
feed?: DXN;
|
|
9506
|
-
}
|
|
9507
|
-
interface RefResolverOptions {
|
|
9508
|
-
/**
|
|
9509
|
-
* Resolution context.
|
|
9510
|
-
* Affects how non-absolute DXNs are resolved.
|
|
9511
|
-
*/
|
|
9512
|
-
context?: RefResolutionContext;
|
|
9513
|
-
/**
|
|
9514
|
-
* Middleware to change the resolved object before returning it.
|
|
9515
|
-
* @deprecated On track to be removed.
|
|
9516
|
-
*/
|
|
9517
|
-
middleware?: (obj: AnyProperties) => AnyProperties;
|
|
9518
|
-
}
|
|
9519
|
-
/**
|
|
9520
|
-
* Manages cross-space database interactions.
|
|
9521
|
-
*/
|
|
9522
|
-
interface Hypergraph extends Queryable {
|
|
9523
|
-
get schemaRegistry(): SchemaRegistry;
|
|
9524
|
-
/**
|
|
9525
|
-
* Query objects.
|
|
9526
|
-
*/
|
|
9527
|
-
query: QueryFn;
|
|
9528
|
-
/**
|
|
9529
|
-
* Creates a reference to an existing object in the database.
|
|
9530
|
-
*
|
|
9531
|
-
* NOTE: The reference may be dangling if the object is not present in the database.
|
|
9532
|
-
* NOTE: Difference from `Ref.fromDXN`
|
|
9533
|
-
* `Ref.fromDXN(dxn)` returns an unhydrated reference. The `.load` and `.target` APIs will not work.
|
|
9534
|
-
* `db.makeRef(dxn)` is preferable in cases with access to the database.
|
|
9535
|
-
*/
|
|
9536
|
-
makeRef<T$1 extends Unknown = Unknown>(dxn: DXN): Ref$1<T$1>;
|
|
9537
|
-
/**
|
|
9538
|
-
* @param hostDb Host database for reference resolution.
|
|
9539
|
-
* @param middleware Called with the loaded object. The caller may change the object.
|
|
9540
|
-
* @returns Result of `onLoad`.
|
|
9541
|
-
*/
|
|
9542
|
-
createRefResolver(options: RefResolverOptions): Resolver;
|
|
9543
|
-
/**
|
|
9544
|
-
* Get a database by space ID.
|
|
9545
|
-
* @returns The database for the given space ID, or undefined if not found.
|
|
9546
|
-
*/
|
|
9547
|
-
getDatabase(spaceId: SpaceId): Database | undefined;
|
|
9548
|
-
}
|
|
9549
|
-
//#endregion
|
|
9550
|
-
//#region ../echo/dist/types/src/Collection.d.ts
|
|
9551
|
-
/**
|
|
9552
|
-
* A an ordered set of objects.
|
|
9553
|
-
*/
|
|
9554
|
-
declare const Collection: Obj$1<{
|
|
9555
|
-
readonly name?: string | undefined;
|
|
9556
|
-
readonly objects: readonly Ref<OfKind<EntityKind.Object> & Unknown$1>[];
|
|
9557
|
-
}, Struct.Fields>;
|
|
9558
|
-
interface Collection extends Schema.Type<typeof Collection> {}
|
|
9559
|
-
//#endregion
|
|
9560
9712
|
//#region ../echo/dist/types/src/Feed.d.ts
|
|
9561
9713
|
/**
|
|
9562
9714
|
* Runtime schema for a Feed object.
|
|
@@ -9574,7 +9726,7 @@ declare const Feed: Obj$1<{
|
|
|
9574
9726
|
/**
|
|
9575
9727
|
* TypeScript instance type for a Feed object.
|
|
9576
9728
|
*/
|
|
9577
|
-
|
|
9729
|
+
type Feed = InstanceType$1<typeof Feed>;
|
|
9578
9730
|
//#endregion
|
|
9579
9731
|
//#region ../echo/dist/types/src/View.d.ts
|
|
9580
9732
|
/**
|
|
@@ -9597,25 +9749,32 @@ declare const ViewSchema: Obj$1<{
|
|
|
9597
9749
|
readonly pivotFieldId?: string | undefined;
|
|
9598
9750
|
};
|
|
9599
9751
|
}, Struct.Fields>;
|
|
9600
|
-
interface View extends
|
|
9601
|
-
/**
|
|
9602
|
-
* View instance type.
|
|
9603
|
-
*/
|
|
9752
|
+
interface View extends InstanceType$1<typeof ViewSchema> {}
|
|
9604
9753
|
declare const View: Obj$1<View>;
|
|
9605
9754
|
//#endregion
|
|
9606
9755
|
//#region ../echo/dist/types/src/Dataset.d.ts
|
|
9607
9756
|
/**
|
|
9608
|
-
*
|
|
9757
|
+
* Abstract set of objects, represented by a view, feed, or collection.
|
|
9758
|
+
* Schema-level union of the underlying type entities (rebuilt via
|
|
9759
|
+
* `Type.getSchema`) so this can still be consumed by Schema-side APIs such
|
|
9760
|
+
* as `Filter.type(...)` on a union.
|
|
9609
9761
|
*/
|
|
9610
|
-
|
|
9762
|
+
type Dataset = Feed | Collection | View;
|
|
9763
|
+
declare const Dataset: Union<[Schema<{
|
|
9611
9764
|
readonly name?: string | undefined;
|
|
9612
9765
|
readonly kind?: string | undefined;
|
|
9613
9766
|
readonly namespace?: "data" | "trace" | undefined;
|
|
9614
|
-
}
|
|
9767
|
+
} & OfKind<EntityKind.Object>, {
|
|
9615
9768
|
readonly name?: string | undefined;
|
|
9616
|
-
readonly
|
|
9617
|
-
|
|
9618
|
-
|
|
9769
|
+
readonly kind?: string | undefined;
|
|
9770
|
+
readonly namespace?: "data" | "trace" | undefined;
|
|
9771
|
+
} & OfKind<EntityKind.Object>, never>, Schema<{
|
|
9772
|
+
readonly name?: string | undefined;
|
|
9773
|
+
readonly objects: readonly Ref<Unknown$1>[];
|
|
9774
|
+
} & OfKind<EntityKind.Object>, {
|
|
9775
|
+
readonly name?: string | undefined;
|
|
9776
|
+
readonly objects: readonly Ref<Unknown$1>[];
|
|
9777
|
+
} & OfKind<EntityKind.Object>, never>, Schema<View & OfKind<EntityKind.Object>, View & OfKind<EntityKind.Object>, never>]>;
|
|
9619
9778
|
declare namespace Order_d_exports {
|
|
9620
9779
|
export { Any$2 as Any, Order, natural, property, rank };
|
|
9621
9780
|
}
|
|
@@ -9644,28 +9803,28 @@ interface Query<T$1> {
|
|
|
9644
9803
|
'~Query': {
|
|
9645
9804
|
value: T$1;
|
|
9646
9805
|
};
|
|
9647
|
-
ast: Query$
|
|
9806
|
+
ast: Query$1;
|
|
9648
9807
|
/**
|
|
9649
9808
|
* Filter the current selection based on a filter.
|
|
9650
9809
|
* @param filter - Filter to select the objects.
|
|
9651
9810
|
* @returns Query for the selected objects.
|
|
9652
9811
|
*/
|
|
9653
9812
|
'select'(filter: Filter<T$1>): Query<T$1>;
|
|
9654
|
-
'select'(props: Props<T$1>): Query<T$1>;
|
|
9813
|
+
'select'(props: Props$1<T$1>): Query<T$1>;
|
|
9655
9814
|
/**
|
|
9656
9815
|
* Traverse an outgoing reference.
|
|
9657
9816
|
* @param key - Property path inside T that is a reference or optional reference.
|
|
9658
9817
|
* @returns Query for the target of the reference.
|
|
9659
9818
|
*/
|
|
9660
|
-
'reference'<K$1 extends RefPropKey<T$1>>(key: K$1): Query<T$1[K$1] extends Unknown$2 ? Target<T$1[K$1]> : T$1[K$1] extends Unknown$2 | undefined ? Target<Exclude<T$1[K$1], undefined>> : never>;
|
|
9819
|
+
'reference'<K$1 extends RefPropKey<T$1>>(key: K$1): Query<T$1[K$1] extends Unknown$2 ? Target$1<T$1[K$1]> : T$1[K$1] extends Unknown$2 | undefined ? Target$1<Exclude<T$1[K$1], undefined>> : never>;
|
|
9661
9820
|
/**
|
|
9662
9821
|
* Find objects referencing this object.
|
|
9663
9822
|
* @param target - Schema of the referencing object. If not provided, matches any type.
|
|
9664
9823
|
* @param key - Property path inside the referencing object that is a reference. If not provided, matches any property.
|
|
9665
9824
|
* @returns Query for the referencing objects.
|
|
9666
9825
|
*/
|
|
9667
|
-
'referencedBy'<S$1 extends
|
|
9668
|
-
'referencedBy'<S$1 extends
|
|
9826
|
+
'referencedBy'<S$1 extends AnyEntity$1>(target: S$1 | string, key: RefPropKey<InstanceType$1<S$1>>): Query<InstanceType$1<S$1>>;
|
|
9827
|
+
'referencedBy'<S$1 extends AnyEntity$1>(target: S$1 | string): Query<InstanceType$1<S$1>>;
|
|
9669
9828
|
'referencedBy'(): Query<any>;
|
|
9670
9829
|
/**
|
|
9671
9830
|
* Find relations where this object is the source.
|
|
@@ -9673,14 +9832,14 @@ interface Query<T$1> {
|
|
|
9673
9832
|
* @param relation - Schema of the relation.
|
|
9674
9833
|
* @param predicates - Predicates to filter the relation objects.
|
|
9675
9834
|
*/
|
|
9676
|
-
'sourceOf'<
|
|
9835
|
+
'sourceOf'<R$1 extends AnyRelation>(relation?: R$1 | string, predicates?: Props$1<InstanceType$1<R$1>>): Query<InstanceType$1<R$1>>;
|
|
9677
9836
|
/**
|
|
9678
9837
|
* Find relations where this object is the target.
|
|
9679
9838
|
* @returns Query for the relation objects.
|
|
9680
|
-
* @param relation -
|
|
9839
|
+
* @param relation - Type entity of the relation.
|
|
9681
9840
|
* @param predicates - Predicates to filter the relation objects.
|
|
9682
9841
|
*/
|
|
9683
|
-
'targetOf'<
|
|
9842
|
+
'targetOf'<R$1 extends AnyRelation>(relation?: R$1 | string, predicates?: Props$1<InstanceType$1<R$1>>): Query<InstanceType$1<R$1>>;
|
|
9684
9843
|
/**
|
|
9685
9844
|
* For a query for relations, get the source objects.
|
|
9686
9845
|
* @returns Query for the source objects.
|
|
@@ -9775,9 +9934,19 @@ interface Query<T$1> {
|
|
|
9775
9934
|
*/
|
|
9776
9935
|
'from'(query: Any$1): Query<T$1>;
|
|
9777
9936
|
/**
|
|
9778
|
-
* Query from
|
|
9937
|
+
* Query from one or more raw scopes.
|
|
9938
|
+
*
|
|
9939
|
+
* Use the {@link Scope} constructors rather than raw tagged objects:
|
|
9940
|
+
*
|
|
9941
|
+
* ```ts
|
|
9942
|
+
* Query.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry());
|
|
9943
|
+
* ```
|
|
9944
|
+
*/
|
|
9945
|
+
'from'(...scopes: Scope[]): Query<T$1>;
|
|
9946
|
+
/**
|
|
9947
|
+
* Query from a raw scope or array of scopes.
|
|
9779
9948
|
*/
|
|
9780
|
-
'from'(scope: Scope): Query<T$1>;
|
|
9949
|
+
'from'(scope: Scope | Scope[]): Query<T$1>;
|
|
9781
9950
|
/**
|
|
9782
9951
|
* Add options to a query.
|
|
9783
9952
|
*/
|
|
@@ -9791,7 +9960,7 @@ type Any$1 = Query<any>;
|
|
|
9791
9960
|
type Type$1<Q extends Any$1> = Q extends Query<infer T> ? T : never;
|
|
9792
9961
|
declare const is: (value: unknown) => value is Any$1;
|
|
9793
9962
|
/** Construct a query from an ast. */
|
|
9794
|
-
declare const fromAst: (ast: Query$
|
|
9963
|
+
declare const fromAst: (ast: Query$1) => Any$1;
|
|
9795
9964
|
/**
|
|
9796
9965
|
* Select objects based on a filter.
|
|
9797
9966
|
* @param filter - Filter to select the objects.
|
|
@@ -9807,8 +9976,10 @@ declare const select: <F extends Any$3>(filter: F) => Query<Type$2<F>>;
|
|
|
9807
9976
|
* Shorthand for: `Query.select(Filter.type(schema, predicates))`.
|
|
9808
9977
|
*/
|
|
9809
9978
|
declare const type$1: {
|
|
9810
|
-
<
|
|
9811
|
-
(schema:
|
|
9979
|
+
<T$1 extends AnyEntity$1>(type: T$1, predicates?: Props$1<InstanceType$1<T$1>>): Query<InstanceType$1<T$1>>;
|
|
9980
|
+
<S$1 extends UnknownTypeSchema<any, any>>(schema: S$1, predicates?: Props$1<Schema.Type<S$1>>): Query<Schema.Type<S$1>>;
|
|
9981
|
+
<S$1 extends Union<readonly Schema.AnyNoContext[]>>(union: S$1, predicates?: Props$1<Schema.Type<S$1>>): Query<Schema.Type<S$1>>;
|
|
9982
|
+
(schema: string, predicates?: Props$1<unknown>): Query<any>;
|
|
9812
9983
|
};
|
|
9813
9984
|
/**
|
|
9814
9985
|
* Combine results of multiple queries.
|
|
@@ -9830,14 +10001,169 @@ declare const without: <T$1>(source: Query<T$1>, exclude: Query<T$1>) => Query<T
|
|
|
9830
10001
|
* @param source - Data source: database, feed, 'all-accessible-spaces', or another query.
|
|
9831
10002
|
* @returns Query scoped to the given source.
|
|
9832
10003
|
*/
|
|
9833
|
-
declare const from: (
|
|
10004
|
+
declare const from: (...args: [(Database | Database[] | Feed | Feed[] | Any$1 | Scope | Scope[] | 'all-accessible-spaces'), {
|
|
9834
10005
|
includeFeeds?: boolean;
|
|
9835
|
-
}) => Any$1;
|
|
10006
|
+
}?] | Scope[]) => Any$1;
|
|
9836
10007
|
/**
|
|
9837
10008
|
* Returns a human-readable string representation of a Query AST.
|
|
9838
10009
|
*/
|
|
9839
10010
|
declare const pretty: (query: Any$1) => string;
|
|
9840
10011
|
//#endregion
|
|
10012
|
+
//#region ../echo/dist/types/src/Registry.d.ts
|
|
10013
|
+
/**
|
|
10014
|
+
* Identifier denoting an ECHO Registry.
|
|
10015
|
+
*/
|
|
10016
|
+
declare const TypeId$1: unique symbol;
|
|
10017
|
+
type TypeId$1 = typeof TypeId$1;
|
|
10018
|
+
/**
|
|
10019
|
+
* Composable, in-memory registry of keyed ECHO entities.
|
|
10020
|
+
*
|
|
10021
|
+
* Entities are stored by id and queried via the standard ECHO Query API.
|
|
10022
|
+
* A registry may delegate to an optional upstream registry: results from the local
|
|
10023
|
+
* registry take precedence and upstream results fill in anything not found locally.
|
|
10024
|
+
*
|
|
10025
|
+
* Intended use cases include caches of schemas, operations, blueprints, routines, plugins,
|
|
10026
|
+
* etc., sourced from 3rd-party plugins, local code, or local space objects.
|
|
10027
|
+
*
|
|
10028
|
+
* Types (schema-definition entities produced by `Type.makeObject` / `Type.makeRelation`) are
|
|
10029
|
+
* stored the same way as any other entity — via `add()`. Use `list().filter(Type.isType)` to
|
|
10030
|
+
* retrieve them.
|
|
10031
|
+
*
|
|
10032
|
+
* Scope: a Registry is independent of any ECHO space or Hypergraph — it is a process-local,
|
|
10033
|
+
* in-memory cache. Wire one per space (e.g. as a Layer scoped to the space's Effect runtime)
|
|
10034
|
+
* or share a single instance across spaces depending on the use case.
|
|
10035
|
+
*
|
|
10036
|
+
* The concrete implementation (and the `makeRegistry` / `registryLayer` factories) lives in
|
|
10037
|
+
* `@dxos/echo-db`; this module declares only the interface so that the `@dxos/echo` API surface
|
|
10038
|
+
* stays free of query-matching dependencies.
|
|
10039
|
+
*/
|
|
10040
|
+
interface Registry {
|
|
10041
|
+
readonly [TypeId$1]: TypeId$1;
|
|
10042
|
+
/**
|
|
10043
|
+
* Stable per-instance identifier. Used to key process-local resources (e.g. memoized
|
|
10044
|
+
* reactive atoms) to a specific registry instance, analogous to {@link Database.spaceId}.
|
|
10045
|
+
*/
|
|
10046
|
+
readonly id: string;
|
|
10047
|
+
/**
|
|
10048
|
+
* Fires whenever local registry contents change (add, remove, or clear).
|
|
10049
|
+
*/
|
|
10050
|
+
readonly changed: ReadOnlyEvent<void>;
|
|
10051
|
+
/**
|
|
10052
|
+
* All locally-stored entities.
|
|
10053
|
+
* Does not include upstream entities — use {@link list} for that.
|
|
10054
|
+
*/
|
|
10055
|
+
readonly local: readonly Unknown[];
|
|
10056
|
+
/**
|
|
10057
|
+
* Add or replace one or more entities in the local registry.
|
|
10058
|
+
* Existing entries with the same id are replaced.
|
|
10059
|
+
* Also indexes type entities by DXN for fast lookup.
|
|
10060
|
+
*/
|
|
10061
|
+
add(entities: readonly Unknown[]): void;
|
|
10062
|
+
/**
|
|
10063
|
+
* Remove an entity by id from the local registry.
|
|
10064
|
+
* @returns true if an entity was removed, false if it was not found.
|
|
10065
|
+
*/
|
|
10066
|
+
remove(id: string): boolean;
|
|
10067
|
+
/**
|
|
10068
|
+
* Remove all locally-stored entities.
|
|
10069
|
+
* Does not affect the upstream registry.
|
|
10070
|
+
*/
|
|
10071
|
+
clear(): void;
|
|
10072
|
+
/**
|
|
10073
|
+
* Get an entity by id.
|
|
10074
|
+
* Searches the local registry first, then falls back to the upstream registry.
|
|
10075
|
+
*/
|
|
10076
|
+
get(id: string): Unknown | undefined;
|
|
10077
|
+
/**
|
|
10078
|
+
* Get an entity by one of its addressing URIs — a type entity by its typename DXN (or, when
|
|
10079
|
+
* persisted, its identifier EID), a keyed entity by its `dxn:<key>[:<version>]`. Accepts legacy
|
|
10080
|
+
* DXN forms (normalized internally). Searches the local registry first, then falls back to the
|
|
10081
|
+
* upstream registry. Narrow the result with `Type.isType` when a type entity is required.
|
|
10082
|
+
*/
|
|
10083
|
+
getByURI(uri: string): Unknown | undefined;
|
|
10084
|
+
/**
|
|
10085
|
+
* List all entities.
|
|
10086
|
+
* Local entities take precedence over upstream entities with the same id.
|
|
10087
|
+
*/
|
|
10088
|
+
list(): Unknown[];
|
|
10089
|
+
/**
|
|
10090
|
+
* Run an ECHO query against the registry's entities (implements {@link Database.Queryable}).
|
|
10091
|
+
*
|
|
10092
|
+
* Matching happens in-memory over {@link list}. Scope (`from`) clauses are unwrapped and
|
|
10093
|
+
* ignored — a direct registry query always targets the registry's own entities. The primary
|
|
10094
|
+
* way to query registry contents is still through the database (`db.query(...).from(Scope.registry())`),
|
|
10095
|
+
* which fans the database and registry together; this method is for querying a registry directly.
|
|
10096
|
+
*
|
|
10097
|
+
* Only locally-evaluable AST nodes are supported: `select`, `filter`, `limit`, `from`, `options`,
|
|
10098
|
+
* and boolean combinators. Server-side concerns (order, traversal, text/timestamp filters) throw.
|
|
10099
|
+
*/
|
|
10100
|
+
query: QueryFn;
|
|
10101
|
+
}
|
|
10102
|
+
//#endregion
|
|
10103
|
+
//#region ../echo/dist/types/src/Hypergraph.d.ts
|
|
10104
|
+
/**
|
|
10105
|
+
* Resolution context.
|
|
10106
|
+
* Affects how non-absolute DXNs are resolved.
|
|
10107
|
+
*/
|
|
10108
|
+
interface RefResolutionContext {
|
|
10109
|
+
/**
|
|
10110
|
+
* Space that the resolution is happening from.
|
|
10111
|
+
*/
|
|
10112
|
+
space?: SpaceId;
|
|
10113
|
+
/**
|
|
10114
|
+
* Feed that the resolution is happening from.
|
|
10115
|
+
* This feed will be searched first, and then the space it belongs to.
|
|
10116
|
+
*/
|
|
10117
|
+
feed?: URI;
|
|
10118
|
+
}
|
|
10119
|
+
interface RefResolverOptions {
|
|
10120
|
+
/**
|
|
10121
|
+
* Resolution context.
|
|
10122
|
+
* Affects how non-absolute DXNs are resolved.
|
|
10123
|
+
*/
|
|
10124
|
+
context?: RefResolutionContext;
|
|
10125
|
+
/**
|
|
10126
|
+
* Middleware to change the resolved object before returning it.
|
|
10127
|
+
* @deprecated On track to be removed.
|
|
10128
|
+
*/
|
|
10129
|
+
middleware?: (obj: AnyProperties) => AnyProperties;
|
|
10130
|
+
}
|
|
10131
|
+
/**
|
|
10132
|
+
* Manages cross-space database interactions.
|
|
10133
|
+
*/
|
|
10134
|
+
interface Hypergraph extends Queryable {
|
|
10135
|
+
/**
|
|
10136
|
+
* In-process registry of keyed objects and static schema types.
|
|
10137
|
+
* Populated at startup via `registry.add(objects)` / `registry.add(schemas)`.
|
|
10138
|
+
* Queries that include no explicit from() clause will fan out to this registry automatically.
|
|
10139
|
+
*/
|
|
10140
|
+
get registry(): Registry;
|
|
10141
|
+
/**
|
|
10142
|
+
* Query objects.
|
|
10143
|
+
*/
|
|
10144
|
+
query: QueryFn;
|
|
10145
|
+
/**
|
|
10146
|
+
* Creates a reference to an existing object in the database.
|
|
10147
|
+
*
|
|
10148
|
+
* NOTE: The reference may be dangling if the object is not present in the database.
|
|
10149
|
+
* NOTE: Difference from `Ref.fromURI`
|
|
10150
|
+
* `Ref.fromURI(dxn)` returns an unhydrated reference. The `.load` and `.target` APIs will not work.
|
|
10151
|
+
* `db.makeRef(dxn)` is preferable in cases with access to the database.
|
|
10152
|
+
*/
|
|
10153
|
+
makeRef<T$1 extends Unknown = Unknown>(uri: URI): Ref$1<T$1>;
|
|
10154
|
+
/**
|
|
10155
|
+
* @param hostDb Host database for reference resolution.
|
|
10156
|
+
* @param middleware Called with the loaded object. The caller may change the object.
|
|
10157
|
+
* @returns Result of `onLoad`.
|
|
10158
|
+
*/
|
|
10159
|
+
createRefResolver(options: RefResolverOptions): Resolver;
|
|
10160
|
+
/**
|
|
10161
|
+
* Get a database by space ID.
|
|
10162
|
+
* @returns The database for the given space ID, or undefined if not found.
|
|
10163
|
+
*/
|
|
10164
|
+
getDatabase(spaceId: SpaceId): Database | undefined;
|
|
10165
|
+
}
|
|
10166
|
+
//#endregion
|
|
9841
10167
|
//#region ../echo/dist/types/src/Database.d.ts
|
|
9842
10168
|
/**
|
|
9843
10169
|
* `query` API function declaration.
|
|
@@ -9867,6 +10193,17 @@ type AddOptions = {
|
|
|
9867
10193
|
*/
|
|
9868
10194
|
placeIn?: ObjectPlacement;
|
|
9869
10195
|
};
|
|
10196
|
+
/**
|
|
10197
|
+
* Rejects Type entities from {@link Database.add} at compile time via their `[KindId]` brand. Used
|
|
10198
|
+
* as `T & RejectTypeEntity<T>` to preserve inference of `T`. Bounding `add` on
|
|
10199
|
+
* `Obj.Unknown | Relation.Unknown` instead would reject broadly-typed instance adds (e.g.
|
|
10200
|
+
* `Entity.Any`, `Obj.OfShape<T>`), forcing casts repo-wide.
|
|
10201
|
+
*/
|
|
10202
|
+
type RejectTypeEntity<T$1> = T$1 extends {
|
|
10203
|
+
readonly [KindId$1]: EntityKind.Type;
|
|
10204
|
+
} ? {
|
|
10205
|
+
__error: 'Type entities must be persisted via db.addType(), not db.add().';
|
|
10206
|
+
} : T$1;
|
|
9870
10207
|
type FlushOptions = {
|
|
9871
10208
|
/**
|
|
9872
10209
|
* Write any pending changes to disk.
|
|
@@ -9895,8 +10232,13 @@ type TypeId = typeof TypeId;
|
|
|
9895
10232
|
interface Database extends Queryable {
|
|
9896
10233
|
readonly [TypeId]: TypeId;
|
|
9897
10234
|
get spaceId(): SpaceId;
|
|
9898
|
-
get schemaRegistry(): SchemaRegistry;
|
|
9899
10235
|
get graph(): Hypergraph;
|
|
10236
|
+
/**
|
|
10237
|
+
* Registry for this database. Delegates type lookups to the shared hypergraph registry.
|
|
10238
|
+
* To persist a schema so it replicates to other clients, add the type entity with
|
|
10239
|
+
* {@link addType} (e.g. `await db.addType(Type.makeObjectFromJsonSchema(...))`).
|
|
10240
|
+
*/
|
|
10241
|
+
readonly registry: Registry;
|
|
9900
10242
|
toJSON(): object;
|
|
9901
10243
|
/**
|
|
9902
10244
|
* Return object by local ID.
|
|
@@ -9910,15 +10252,26 @@ interface Database extends Queryable {
|
|
|
9910
10252
|
* Creates a reference to an existing object in the database.
|
|
9911
10253
|
*
|
|
9912
10254
|
* NOTE: The reference may be dangling if the object is not present in the database.
|
|
9913
|
-
* NOTE: Difference from `Ref.
|
|
9914
|
-
* `Ref.
|
|
10255
|
+
* NOTE: Difference from `Ref.fromURI`
|
|
10256
|
+
* `Ref.fromURI(dxn)` returns an unhydrated reference. The `.load` and `.target` APIs will not work.
|
|
9915
10257
|
* `db.makeRef(dxn)` is preferable in cases with access to the database.
|
|
9916
10258
|
*/
|
|
9917
|
-
makeRef<T$1 extends Unknown = Unknown>(
|
|
10259
|
+
makeRef<T$1 extends Unknown = Unknown>(uri: URI): Ref<T$1>;
|
|
9918
10260
|
/**
|
|
9919
|
-
* Adds object to the database.
|
|
10261
|
+
* Adds an object or relation to the database.
|
|
10262
|
+
*
|
|
10263
|
+
* Only Object and Relation entities are accepted. To persist a Type definition use
|
|
10264
|
+
* {@link addType} — passing a Type entity is rejected at compile time (and at runtime).
|
|
9920
10265
|
*/
|
|
9921
|
-
add<T$1 extends Unknown = Unknown>(obj: T$1
|
|
10266
|
+
add<T$1 extends Unknown = Unknown>(obj: T$1 & RejectTypeEntity<T$1>, opts?: AddOptions): T$1;
|
|
10267
|
+
/**
|
|
10268
|
+
* Persists a Type definition (clones/forks the entity) so it replicates to other peers.
|
|
10269
|
+
*
|
|
10270
|
+
* Runs a conflict query first: if a type with the same typename + version already exists in
|
|
10271
|
+
* this space, the existing persisted entity is returned and no duplicate is created. This is
|
|
10272
|
+
* the only supported way to add Type entities — {@link add} rejects them.
|
|
10273
|
+
*/
|
|
10274
|
+
addType<T$1 extends AnyEntity$1>(type: T$1): Promise<T$1>;
|
|
9922
10275
|
/**
|
|
9923
10276
|
* Removes object from the database.
|
|
9924
10277
|
*/
|
|
@@ -9931,24 +10284,9 @@ interface Database extends Queryable {
|
|
|
9931
10284
|
}
|
|
9932
10285
|
declare const Database: Schema<Database>;
|
|
9933
10286
|
//#endregion
|
|
9934
|
-
//#region ../echo/dist/types/src/internal/Entity/object.d.ts
|
|
9935
|
-
/**
|
|
9936
|
-
* Object schema type with kind marker.
|
|
9937
|
-
*/
|
|
9938
|
-
type EchoObjectSchema<Self extends Schema.Any, Fields extends Struct.Fields = Struct.Fields> = EchoTypeSchema<Self, {}, EntityKind.Object, Fields>;
|
|
9939
|
-
/**
|
|
9940
|
-
* Schema for Obj entity types.
|
|
9941
|
-
* Pipeable function to add ECHO object annotations to a schema.
|
|
9942
|
-
*/
|
|
9943
|
-
declare const EchoObjectSchema: {
|
|
9944
|
-
(meta: TypeMeta): <Self extends Schema.Any, Fields extends Struct.Fields = Struct.Fields>(self: Self & {
|
|
9945
|
-
fields?: Fields;
|
|
9946
|
-
}) => EchoObjectSchema<Self, Fields>;
|
|
9947
|
-
};
|
|
9948
|
-
//#endregion
|
|
9949
10287
|
//#region ../echo/dist/types/src/Entity.d.ts
|
|
9950
|
-
declare const KindId
|
|
9951
|
-
type KindId
|
|
10288
|
+
declare const KindId: "~@dxos/echo/Kind";
|
|
10289
|
+
type KindId = typeof KindId$1;
|
|
9952
10290
|
declare const Kind: typeof EntityKind;
|
|
9953
10291
|
type Kind = EntityKind;
|
|
9954
10292
|
/**
|
|
@@ -9956,13 +10294,29 @@ type Kind = EntityKind;
|
|
|
9956
10294
|
* NOTE: Needed to make `isRelation` and `isObject` checks work.
|
|
9957
10295
|
*/
|
|
9958
10296
|
interface OfKind<K$1 extends Kind> {
|
|
9959
|
-
readonly [KindId
|
|
9960
|
-
readonly id:
|
|
10297
|
+
readonly [KindId]: K$1;
|
|
10298
|
+
readonly id: EntityId;
|
|
9961
10299
|
}
|
|
9962
10300
|
/**
|
|
9963
10301
|
* Unknown Obj or Relation (reactive).
|
|
9964
10302
|
*/
|
|
9965
10303
|
interface Unknown extends OfKind<Kind> {}
|
|
10304
|
+
/**
|
|
10305
|
+
* Effect Schema for any ECHO entity (object or relation).
|
|
10306
|
+
*
|
|
10307
|
+
* Kind-agnostic counterpart to `Obj.Unknown` / `Relation.Unknown` — validates
|
|
10308
|
+
* the structural shape (id + properties) without constraining `[KindId]`. Used
|
|
10309
|
+
* in operation input schemas that accept any entity flavour (e.g.
|
|
10310
|
+
* `Schema.Array(Entity.Unknown)`).
|
|
10311
|
+
*
|
|
10312
|
+
* The cast bridges the runtime structural schema to the branded `Unknown` type:
|
|
10313
|
+
* `[KindId]` is a symbol brand that can't be expressed in a runtime `Struct`,
|
|
10314
|
+
* so the entity guarantee is carried at the type level only (same approach as
|
|
10315
|
+
* `Obj.Unknown` / `Relation.Unknown`). Unlike those, this is kind-agnostic so it
|
|
10316
|
+
* isn't an `UnknownTypeSchema<_, K>` (there's no single `K`) and carries no
|
|
10317
|
+
* `TypeAnnotation`.
|
|
10318
|
+
*/
|
|
10319
|
+
declare const Unknown: Schema<Unknown>;
|
|
9966
10320
|
//#endregion
|
|
9967
10321
|
//#region ../echo/dist/types/src/internal/common/types/base.d.ts
|
|
9968
10322
|
/**
|
|
@@ -9976,43 +10330,9 @@ type AnyProperties = Record<string, any>;
|
|
|
9976
10330
|
* @depreacted Remove, use Entity.Unknown instead.
|
|
9977
10331
|
*/
|
|
9978
10332
|
interface AnyEntity {
|
|
9979
|
-
readonly id:
|
|
9980
|
-
}
|
|
9981
|
-
//#endregion
|
|
9982
|
-
//#region ../echo/dist/types/src/internal/common/types/entity.d.ts
|
|
9983
|
-
/**
|
|
9984
|
-
* String key used to identify the kind of an entity instance (object or relation).
|
|
9985
|
-
*/
|
|
9986
|
-
declare const KindId: '~@dxos/echo/Kind';
|
|
9987
|
-
type KindId = typeof KindId;
|
|
9988
|
-
/**
|
|
9989
|
-
* String key used to identify the kind of a schema (object schema or relation schema).
|
|
9990
|
-
* Parallels KindId which identifies instance kinds.
|
|
9991
|
-
*/
|
|
9992
|
-
declare const SchemaKindId: '~@dxos/echo/SchemaKind';
|
|
9993
|
-
type SchemaKindId = typeof SchemaKindId;
|
|
9994
|
-
/**
|
|
9995
|
-
* Kinds of entities stored in ECHO: objects and relations.
|
|
9996
|
-
*/
|
|
9997
|
-
declare enum EntityKind {
|
|
9998
|
-
Object = "object",
|
|
9999
|
-
Relation = "relation",
|
|
10333
|
+
readonly id: EntityId;
|
|
10000
10334
|
}
|
|
10001
10335
|
//#endregion
|
|
10002
|
-
//#region ../echo/dist/types/src/internal/Annotation/annotations.d.ts
|
|
10003
|
-
declare const TypeMeta: Struct<{
|
|
10004
|
-
typename: refine<string, typeof String$>;
|
|
10005
|
-
version: refine<string, typeof String$>;
|
|
10006
|
-
}>;
|
|
10007
|
-
interface TypeMeta extends Schema.Type<typeof TypeMeta> {}
|
|
10008
|
-
/**
|
|
10009
|
-
* SchemaMeta.
|
|
10010
|
-
*/
|
|
10011
|
-
declare const SchemaMetaSymbol: unique symbol;
|
|
10012
|
-
type SchemaMeta = TypeMeta & {
|
|
10013
|
-
id: string;
|
|
10014
|
-
};
|
|
10015
|
-
//#endregion
|
|
10016
10336
|
//#region src/query-lite/query-lite.d.ts
|
|
10017
10337
|
declare const Order2: typeof Order_d_exports;
|
|
10018
10338
|
declare const Filter1: typeof Filter_d_exports;
|