@omegup/msync 0.1.51 → 0.1.53
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/index.d.ts +22 -7
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -421,7 +421,9 @@ declare const $getField: {
|
|
|
421
421
|
<T, K extends StrKey<T>, D, C = unknown>(expr: Expr<T, D, C>, field: K): Expr<T[K], D, C>;
|
|
422
422
|
<T, K extends StrKey<T>, D, C = unknown>(expr: Expr<T | N, D, C>, field: K): Expr<T[K] | null, D, C>;
|
|
423
423
|
};
|
|
424
|
-
type AddO<T> = T extends notObj ? T : T extends Array<infer U> ? Arr<AddO<U>> : O<
|
|
424
|
+
type AddO<T> = T extends notObj ? T : T extends Array<infer U> ? Arr<AddO<U>> : O<{
|
|
425
|
+
[K in keyof T]: AddO<T[K]>;
|
|
426
|
+
}>;
|
|
425
427
|
declare const func: <T extends jsonItem, A extends readonly jsonItem[], D, C = unknown>(f: (...args: A) => T, ...args: { [X in keyof A]: Expr<AddO<A[X]>, D, C>; }) => Expr<AddO<T>, D, C>;
|
|
426
428
|
declare const rand: () => string;
|
|
427
429
|
declare const $rand: Expr<string, unknown, unknown>;
|
|
@@ -438,7 +440,12 @@ declare const $sum: <D extends O, C = unknown>(expr: Expr<number | N, D, C>) =>
|
|
|
438
440
|
declare const $accumulator: <D, T, Ctx, A extends readonly unknown[]>(init: () => T, accumulateArgs: AppMap<ExprHKT<Part<D>, Ctx>, AddOs<A>>, accumulate: (a: T, ...args: A) => T, merge: (...args: [T | N, T]) => T) => DeltaAccumulator<D, AddO<T>, Ctx>;
|
|
439
441
|
declare const $countDict: <D extends O, K extends string = string, C = unknown>(expr: Expr<AddO<K>, D, C>) => DeltaAccumulator<D, AddO<PRRec<K, number>>, C>;
|
|
440
442
|
declare const $countDictArray: <D extends O, K extends string = string, C = unknown>(expr: Expr<AddO<K[]>, D, C>) => DeltaAccumulator<D, AddO<PRRec<K, number>>, C>;
|
|
441
|
-
declare const $pushDict: <D extends O, V, C = unknown>(key: Expr<string, D, C>, value: Expr<AddO<V>, D, C>) => DeltaAccumulator<D, O<
|
|
443
|
+
declare const $pushDict: <D extends O, V, C = unknown>(key: Expr<string, D, C>, value: Expr<AddO<V>, D, C>) => DeltaAccumulator<D, O<{
|
|
444
|
+
[x: string]: O<{
|
|
445
|
+
0: Arr<AddO<V>>;
|
|
446
|
+
1: Arr<AddO<V>>;
|
|
447
|
+
}> | undefined;
|
|
448
|
+
}>, C>;
|
|
442
449
|
declare const $keys: <D extends O, K extends string = string, C = unknown>(expr: Expr<AddO<PRRec<K, number>>, D, C>) => Expr<AddO<K[]>, D, C>;
|
|
443
450
|
declare const $entries: <D extends O, V, C = unknown>(expr: Expr<AddO<PushDict<V>>, D, C>) => Expr<AddO<{
|
|
444
451
|
k: string;
|
|
@@ -526,9 +533,15 @@ type MergedInput<Out, VV, Grp, GG extends string, EE> = OrReplace<Replace<Replac
|
|
|
526
533
|
|
|
527
534
|
type Denied<GID = never> = keyof (TS & ID) | GID;
|
|
528
535
|
type GI<GG> = Exclude<GG, keyof TS>;
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
536
|
+
type GroupMergeOut<Grp extends notArr, V extends O, GG extends string, EE = {}, Out extends Loose<Grp, V, GG> = Loose<Grp, V, GG>> = MergeInto<Strict<Grp, V, GG, EE>, Out, WriteonlyCollection<MergedInput<Out, V, Grp, GG, EE>>>;
|
|
537
|
+
type GroupMergeCollection<WhenNotMatched extends MergeInto<never, never>['whenNotMatched'], Grp extends notArr, V extends O, GG extends string, EE = {}, Out extends Loose<Grp, V, GG> = Loose<Grp, V, GG>> = (GroupMergeOut<Grp, V, GG, EE, Out> & {
|
|
538
|
+
whenNotMatched: WhenNotMatched;
|
|
539
|
+
})['into'];
|
|
540
|
+
declare const $groupMerge: <T extends O, Grp extends notArr, V extends O, GG extends string, EE = {}, Out extends Loose<Grp, V, GG> = Loose<Grp, V, GG>>(id: Expr<Grp, T>, args: DeltaAccumulators<T, O & Omit<V, Denied<GI<GG>>>>, out: GroupMergeOut<Grp, V, GG, EE, Out>, gid: AsLiteral<GI<GG>>, extra: ExprsExact<Extra<EE, V, GG>, V_Grp<V, GG, Grp>>, idPrefix?: string) => StreamRunnerParam<Delta<T>, "out">;
|
|
541
|
+
type GroupIdCollection<V extends O, EE = {}, Out extends Loose<string, V, '_id'> = Loose<string, V, '_id'>> = RWCollection<MergedInput<Out, V, string, '_id', EE>, Out>;
|
|
542
|
+
declare const $groupId: <T extends O, V extends O, EE = {}, Out extends Loose<string, V, "_id"> = Loose<string, V, "_id">>(id: Expr<string, T>, args: DeltaAccumulators<T, O & Omit<V, Denied>>, out: GroupIdCollection<V, EE, Out>, extra: ExprsExact<Omit<EE, IdAndTsKeys | keyof Omit<V, IdAndTsKeys>>, doc & Omit<V, IdAndTsKeys>>) => StreamRunnerParam<Delta<T>, "out">;
|
|
543
|
+
type GroupCollection<Grp extends notArr, V extends O, EE = {}, Out extends Loose<Grp, V, '_grp'> = Loose<Grp, V, '_grp'>> = RWCollection<MergedInput<Out, V, Grp, '_grp', EE> | Strict<Grp, V, '_grp', EE>, Out>;
|
|
544
|
+
declare const $group: <T extends O, Grp extends notArr, V extends O, EE = {}, Out extends Loose<Grp, V, "_grp"> = Loose<Grp, V, "_grp">>(id: Expr<Grp, T>, args: DeltaAccumulators<T, O & Omit<V, Denied<"_grp">>>, out: GroupCollection<Grp, V, EE, Out>, extra: ExprsExact<Omit<EE, IdAndTsKeys | "_grp" | Exclude<keyof V, IdAndTsKeys | "_grp">>, Rec<"_grp", Grp> & Omit<V, IdAndTsKeys | "_grp">>, idPrefix?: string) => StreamRunnerParam<Delta<T>, "out">;
|
|
532
545
|
|
|
533
546
|
type Params<As extends string, LQ extends O, RQ extends O, RE extends RQ, S extends notArr> = {
|
|
534
547
|
from: SnapshotStreamExecutionResult<RQ, RE>;
|
|
@@ -635,7 +648,9 @@ declare const createIndex: (collection: {
|
|
|
635
648
|
}, indexSpec: IndexSpecification, op?: CreateIndexesOptions) => Promise<void>;
|
|
636
649
|
|
|
637
650
|
declare const noop: () => void;
|
|
638
|
-
declare const map1: <K extends string, Im>(k: AsLiteral<K>, to: Im) =>
|
|
651
|
+
declare const map1: <K extends string, Im>(k: AsLiteral<K>, to: Im) => { readonly [P in K]: [P, Im]; } & {
|
|
652
|
+
readonly [_: string]: [K, Im];
|
|
653
|
+
};
|
|
639
654
|
|
|
640
655
|
declare const $group_: <V extends O>() => <ID, T extends O, C = unknown>(id: Expr<ID, T, C>, args: Accumulators<T, V, C>) => RawStages<O, T, Rec<"_id", ID> & V, C, 1>;
|
|
641
656
|
|
|
@@ -828,4 +843,4 @@ declare const prepare: (testName?: string) => Promise<MongoClient$1>;
|
|
|
828
843
|
declare const makeCol: <T extends ID>(docs: readonly OptionalUnlessRequiredId<T>[], database: Db, name?: string) => Promise<Collection<T>>;
|
|
829
844
|
|
|
830
845
|
export { $accumulator, $and, $countDict, $countDictArray, $entries, $eq, $exists, $expr, $getField, $group, $groupId, $groupMerge, $group_, $gt, $gtTs, $gte, $gteTs, $ifNull, $in, $insert, $insertPart, $insertX, $keys, $let, $lookup, $lt, $lte, $map, $map0, $map1, $match, $matchDelta, $merge, $merge2, $mergeId, $mergePart, $merge_, $ne, $nin, $nor, $or, $outerLookup, $pushDict, $rand, $reduce, $replaceWith, $set, $simpleInsert, $simpleMerge, $simpleMergePart, $substr, $sum, $type, $unwind, $unwindDelta, Expr, Field, Machine, Type, add, and, anyElementTrue, array, ceil, comp, concat, concatArray, createIndex, ctx, current, dateAdd, dateDiff, dateLt, datePart, dayAndMonthPart, divide, emptyDelta, enablePreAndPostImages, eq, eqExtends, eqPar, eqTyped, except, excludeIdem, exprMapVal, field, fieldF, fieldM, filter, filterDefined, first, firstSure, floor, from, fromEq, func, getWhenMatched, getWhenMatchedForMerge, gt, gte, inArray, isArray, ite, joinIdOf, last, literalsEqaul, log, lt, lte, makeCol, map, map1, mapExact, mapExact0, mapExact1, mapExactToObject, mapExactToObject0, mapExactToObject1, mapFromPlainDateTime, mapToPlainDateTime, mapVal, matchDelta, max, maxDate, mergeExact, mergeExact0, mergeExpr, mergeObjects, minDate, monthPart, multiply, ne, nil, noop, not, notExtendExcluded, notNull, now, omitExclude, omitPick, omitRORec, or, padLeft, pair, prepare, rand, range, reflex, regex, renamedFields, root, set, setField, single, size, slice, sortArray, spread, spread0, staging, startOf, str, sub, subtract, sym, to, toInt, translateOmit, val, weekPart, wrap, year };
|
|
831
|
-
export type { Accumulators, AddO, And, App, AppMap, AppMapRW, ApplyHKT, Arr, ArrHKT, AsLiteral, ConstHKT, DeepFieldHKT, Delta, DeltaAccumulator, DeltaAccumulatorHKT, DeltaAccumulators, DeltaStages, Equal, Exact, ExactKeys, ExactPart, ExactPart1, ExprHKT, Exprs, ExprsExact, ExprsExactHKT, ExprsPart, FieldHKT, HKT, I, ID, IdHKT, JoinId, Loose, MapK, MapKDom, MapKPart1, MapO, MapOPart, MappedHKT, Merge, MergeArgs, MergeHKT, MergeInto, MergeMapOArgs, Model, MongoTypeNames, N, NullToOBJ, O, OPick, OPickD, Patch, PromiseHKT, RConstHKT, RORec, RawStages, Rec, RecHKT, RecordHKT, Replace, SnapshotStreamExecutionResult, StrKey, Strict, TS, UBeforeHKT, WithKey1, WriteonlyCollection, doc, jsonPrim, notArr, µ };
|
|
846
|
+
export type { Accumulators, AddO, And, App, AppMap, AppMapRW, ApplyHKT, Arr, ArrHKT, AsLiteral, ConstHKT, DeepFieldHKT, Delta, DeltaAccumulator, DeltaAccumulatorHKT, DeltaAccumulators, DeltaStages, Equal, Exact, ExactKeys, ExactPart, ExactPart1, ExprHKT, Exprs, ExprsExact, ExprsExactHKT, ExprsPart, FieldHKT, GroupCollection, GroupIdCollection, GroupMergeCollection, HKT, I, ID, IdHKT, JoinId, Loose, MapK, MapKDom, MapKPart1, MapO, MapOPart, MappedHKT, Merge, MergeArgs, MergeHKT, MergeInto, MergeMapOArgs, MergedInput, Model, MongoTypeNames, N, NullToOBJ, O, OPick, OPickD, Patch, PromiseHKT, RConstHKT, RORec, RWCollection, RawStages, Rec, RecHKT, RecordHKT, Replace, SnapshotStreamExecutionResult, StrKey, Strict, TS, UBeforeHKT, WithKey1, WriteonlyCollection, doc, jsonPrim, notArr, µ };
|