linqx 0.2.0 → 0.3.2

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.
Files changed (144) hide show
  1. package/README.md +181 -87
  2. package/dist/core/dictionary.d.ts +14 -0
  3. package/dist/core/enumerable.d.ts +9 -0
  4. package/dist/core/enumerator.d.ts +10 -0
  5. package/dist/core/grouping.d.ts +11 -0
  6. package/dist/core/lookup.d.ts +12 -0
  7. package/dist/core/memoized-enumerable.d.ts +12 -0
  8. package/dist/core/ordered-enumerable.d.ts +14 -0
  9. package/dist/core/shared-enumerable.d.ts +10 -0
  10. package/dist/extensions.d.ts +18 -0
  11. package/dist/extensions.js +13 -0
  12. package/dist/factories/choice.d.ts +8 -0
  13. package/dist/factories/cycle.d.ts +8 -0
  14. package/dist/factories/defer.d.ts +8 -0
  15. package/dist/factories/empty.d.ts +3 -0
  16. package/dist/factories/from.d.ts +46 -0
  17. package/dist/factories/generate.d.ts +9 -0
  18. package/dist/factories/make.d.ts +8 -0
  19. package/dist/factories/matches.d.ts +14 -0
  20. package/dist/factories/range-down.d.ts +10 -0
  21. package/dist/factories/range-to.d.ts +12 -0
  22. package/dist/factories/range.d.ts +10 -0
  23. package/dist/factories/repeat-with-finalize.d.ts +9 -0
  24. package/dist/factories/repeat.d.ts +9 -0
  25. package/dist/factories/to-infinity.d.ts +9 -0
  26. package/dist/factories/to-negative-infinity.d.ts +9 -0
  27. package/dist/factories/unfold.d.ts +9 -0
  28. package/dist/index.d.ts +87 -3
  29. package/dist/index.js +2 -4
  30. package/dist/internal/create-enumerable.d.ts +3 -0
  31. package/dist/internal/functions.d.ts +6 -0
  32. package/dist/internal/to-iterable.d.ts +2 -0
  33. package/dist/operators/aggregate-by.d.ts +2 -0
  34. package/dist/operators/aggregate.d.ts +2 -0
  35. package/dist/operators/all.d.ts +2 -0
  36. package/dist/operators/alternate.d.ts +2 -0
  37. package/dist/operators/any.d.ts +2 -0
  38. package/dist/operators/append.d.ts +2 -0
  39. package/dist/operators/as-enumerable.d.ts +2 -0
  40. package/dist/operators/average.d.ts +2 -0
  41. package/dist/operators/buffer.d.ts +2 -0
  42. package/dist/operators/cast.d.ts +2 -0
  43. package/dist/operators/catch-error.d.ts +2 -0
  44. package/dist/operators/choose.d.ts +2 -0
  45. package/dist/operators/chunk.d.ts +2 -0
  46. package/dist/operators/concat.d.ts +2 -0
  47. package/dist/operators/contains.d.ts +2 -0
  48. package/dist/operators/count-by.d.ts +2 -0
  49. package/dist/operators/count.d.ts +2 -0
  50. package/dist/operators/create-ordered-enumerable.d.ts +2 -0
  51. package/dist/operators/default-if-empty.d.ts +2 -0
  52. package/dist/operators/distinct-by.d.ts +2 -0
  53. package/dist/operators/distinct-until-changed.d.ts +2 -0
  54. package/dist/operators/distinct.d.ts +2 -0
  55. package/dist/operators/do-action.d.ts +3 -0
  56. package/dist/operators/element-at-or-default.d.ts +2 -0
  57. package/dist/operators/element-at.d.ts +2 -0
  58. package/dist/operators/except-by.d.ts +2 -0
  59. package/dist/operators/except.d.ts +2 -0
  60. package/dist/operators/finally-action.d.ts +2 -0
  61. package/dist/operators/first-or-default.d.ts +2 -0
  62. package/dist/operators/first.d.ts +2 -0
  63. package/dist/operators/flatten.d.ts +2 -0
  64. package/dist/operators/for-each.d.ts +3 -0
  65. package/dist/operators/force.d.ts +2 -0
  66. package/dist/operators/group-by.d.ts +2 -0
  67. package/dist/operators/group-join.d.ts +2 -0
  68. package/dist/operators/index-of.d.ts +2 -0
  69. package/dist/operators/index.d.ts +2 -0
  70. package/dist/operators/insert.d.ts +2 -0
  71. package/dist/operators/intersect-by.d.ts +2 -0
  72. package/dist/operators/intersect.d.ts +2 -0
  73. package/dist/operators/is-empty.d.ts +2 -0
  74. package/dist/operators/join-with.d.ts +2 -0
  75. package/dist/operators/join.d.ts +2 -0
  76. package/dist/operators/last-index-of.d.ts +2 -0
  77. package/dist/operators/last-or-default.d.ts +2 -0
  78. package/dist/operators/last.d.ts +2 -0
  79. package/dist/operators/left-join.d.ts +2 -0
  80. package/dist/operators/let-bind.d.ts +2 -0
  81. package/dist/operators/log.d.ts +2 -0
  82. package/dist/operators/map.d.ts +2 -0
  83. package/dist/operators/max-by.d.ts +2 -0
  84. package/dist/operators/max.d.ts +2 -0
  85. package/dist/operators/memoize.d.ts +2 -0
  86. package/dist/operators/merge.d.ts +2 -0
  87. package/dist/operators/min-by.d.ts +2 -0
  88. package/dist/operators/min.d.ts +2 -0
  89. package/dist/operators/of-type.d.ts +2 -0
  90. package/dist/operators/operators.d.ts +208 -0
  91. package/dist/operators/order-by-descending.d.ts +2 -0
  92. package/dist/operators/order-by.d.ts +2 -0
  93. package/dist/operators/page.d.ts +2 -0
  94. package/dist/operators/pairwise.d.ts +2 -0
  95. package/dist/operators/partition-by.d.ts +2 -0
  96. package/dist/operators/position.d.ts +2 -0
  97. package/dist/operators/prepend.d.ts +2 -0
  98. package/dist/operators/reverse.d.ts +2 -0
  99. package/dist/operators/right-join.d.ts +2 -0
  100. package/dist/operators/scan.d.ts +2 -0
  101. package/dist/operators/select-many.d.ts +2 -0
  102. package/dist/operators/select.d.ts +2 -0
  103. package/dist/operators/sequence-equal.d.ts +2 -0
  104. package/dist/operators/share.d.ts +2 -0
  105. package/dist/operators/shuffle.d.ts +2 -0
  106. package/dist/operators/single-or-default.d.ts +2 -0
  107. package/dist/operators/single.d.ts +2 -0
  108. package/dist/operators/skip-last.d.ts +2 -0
  109. package/dist/operators/skip-while.d.ts +2 -0
  110. package/dist/operators/skip.d.ts +2 -0
  111. package/dist/operators/sum.d.ts +2 -0
  112. package/dist/operators/take-except-last.d.ts +2 -0
  113. package/dist/operators/take-from-last.d.ts +2 -0
  114. package/dist/operators/take-last.d.ts +2 -0
  115. package/dist/operators/take-while.d.ts +2 -0
  116. package/dist/operators/take.d.ts +2 -0
  117. package/dist/operators/then-by-descending.d.ts +2 -0
  118. package/dist/operators/then-by.d.ts +2 -0
  119. package/dist/operators/to-array.d.ts +2 -0
  120. package/dist/operators/to-dictionary.d.ts +2 -0
  121. package/dist/operators/to-joined-string.d.ts +2 -0
  122. package/dist/operators/to-json-string.d.ts +2 -0
  123. package/dist/operators/to-lookup.d.ts +2 -0
  124. package/dist/operators/to-map.d.ts +2 -0
  125. package/dist/operators/to-object.d.ts +2 -0
  126. package/dist/operators/to-set.d.ts +2 -0
  127. package/dist/operators/trace.d.ts +2 -0
  128. package/dist/operators/traverse-breadth-first.d.ts +2 -0
  129. package/dist/operators/traverse-depth-first.d.ts +2 -0
  130. package/dist/operators/union-by.d.ts +2 -0
  131. package/dist/operators/union.d.ts +2 -0
  132. package/dist/operators/weighted-sample.d.ts +2 -0
  133. package/dist/operators/where-if.d.ts +2 -0
  134. package/dist/operators/where.d.ts +2 -0
  135. package/dist/operators/with-neighbors.d.ts +2 -0
  136. package/dist/operators/zip.d.ts +2 -0
  137. package/dist/src-D_Mk3oMP.js +1597 -0
  138. package/dist/types.d.ts +1154 -0
  139. package/dist/utils.d.ts +56 -0
  140. package/package.json +18 -11
  141. package/dist/linq.d.ts +0 -256
  142. package/dist/linq.js +0 -3085
  143. package/dist/linqx.d.ts +0 -36
  144. package/dist/linqx.js +0 -153
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable, IGrouping } from '../types.js';
2
+ export declare function partitionBy<T, TKey, TElement = T, TResult = IGrouping<TKey, TElement>>(this: IEnumerable<T>, keySelector: (element: T) => TKey, elementSelector?: (element: T) => TElement, resultSelector?: ((key: TKey, elements: IEnumerable<TElement>) => TResult) | undefined, compareSelector?: (key: TKey) => unknown): IEnumerable<TResult>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable, Positioned } from '../types.js';
2
+ export declare function position<T>(this: IEnumerable<T>): IEnumerable<Positioned<T>>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function prepend<T>(this: IEnumerable<T>, element: T): IEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function reverse<T>(this: IEnumerable<T>): IEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { EnumerableInput, IEnumerable } from '../types.js';
2
+ export declare function rightJoin<TOuter, TInner, TKey, TResult>(this: IEnumerable<TOuter>, inner: EnumerableInput<TInner>, outerKeySelector: (outer: TOuter) => TKey, innerKeySelector: (inner: TInner) => TKey, resultSelector: (outer: TOuter | null, inner: TInner) => TResult, compareSelector?: (key: TKey) => unknown): IEnumerable<TResult>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function scan<T, TAccumulate>(this: IEnumerable<T>, seedOrFunc: TAccumulate | ((prev: T, current: T) => T), optionalFunc?: (prev: TAccumulate, current: T) => TAccumulate): IEnumerable<T | TAccumulate>;
@@ -0,0 +1,2 @@
1
+ import type { EnumerableInput, IEnumerable } from '../types.js';
2
+ export declare function selectMany<T, TCollection, TResult = TCollection>(this: IEnumerable<T>, collectionSelector: (element: T, index: number) => EnumerableInput<TCollection>, resultSelector?: (outer: T, inner: TCollection) => TResult): IEnumerable<TCollection | TResult>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function select<T, TResult>(this: IEnumerable<T>, selector: (element: T, index: number) => TResult): IEnumerable<TResult>;
@@ -0,0 +1,2 @@
1
+ import type { EnumerableInput, IEnumerable } from '../types.js';
2
+ export declare function sequenceEqual<T, TCompare>(this: IEnumerable<T>, second: EnumerableInput<T>, compareSelector?: (element: T) => TCompare): boolean;
@@ -0,0 +1,2 @@
1
+ import type { IDisposableEnumerable, IEnumerable } from '../types.js';
2
+ export declare function share<T>(this: IEnumerable<T>): IDisposableEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function shuffle<T>(this: IEnumerable<T>): IEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function singleOrDefault<T, TDefault>(this: IEnumerable<T>, predicateOrDefault?: ((element: T, index: number) => boolean) | TDefault, defaultValue?: TDefault): T | TDefault | undefined;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function single<T>(this: IEnumerable<T>, predicate?: (element: T, index: number) => boolean): T;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function skipLast<T>(this: IEnumerable<T>, count: number): IEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function skipWhile<T>(this: IEnumerable<T>, predicate: (element: T, index: number) => boolean): IEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function skip<T>(this: IEnumerable<T>, count: number): IEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function sum<T>(this: IEnumerable<T>, selector?: (element: T) => number): number;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function takeExceptLast<T>(this: IEnumerable<T>, count?: number): IEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function takeFromLast<T>(this: IEnumerable<T>, count: number): IEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function takeLast<T>(this: IEnumerable<T>, count: number): IEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function takeWhile<T>(this: IEnumerable<T>, predicate: (element: T, index: number) => boolean): IEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function take<T>(this: IEnumerable<T>, count: number): IEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { Comparer, IOrderedEnumerable } from '../types.js';
2
+ export declare function thenByDescending<T, TKey>(this: IOrderedEnumerable<T>, keySelector: (element: T) => TKey, comparer?: Comparer<TKey>): IOrderedEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { Comparer, IOrderedEnumerable } from '../types.js';
2
+ export declare function thenBy<T, TKey>(this: IOrderedEnumerable<T>, keySelector: (element: T) => TKey, comparer?: Comparer<TKey>): IOrderedEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function toArray<T>(this: IEnumerable<T>): T[];
@@ -0,0 +1,2 @@
1
+ import type { IDictionary, IEnumerable } from '../types.js';
2
+ export declare function toDictionary<T, TKey, TValue = T>(this: IEnumerable<T>, keySelector: (element: T) => TKey, elementSelector?: (element: T) => TValue, compareSelector?: (key: TKey) => unknown): IDictionary<TKey, TValue>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function toJoinedString<T, TResult = T>(this: IEnumerable<T>, separator?: string, selector?: (element: T, index: number) => TResult): string;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function toJSONString<T>(this: IEnumerable<T>, replacer?: ((key: string, value: unknown) => unknown) | (string | number)[], space?: string | number): string;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable, ILookup } from '../types.js';
2
+ export declare function toLookup<T, TKey, TElement = T>(this: IEnumerable<T>, keySelector: (element: T) => TKey, elementSelector?: (element: T) => TElement, compareSelector?: (key: TKey) => unknown): ILookup<TKey, TElement>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function toMap<T, TKey, TValue>(this: IEnumerable<T>, keySelector: (element: T) => TKey, valueSelector: (element: T) => TValue): Map<TKey, TValue>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function toObject<T, TKey extends PropertyKey, TElement = T>(this: IEnumerable<T>, keySelector: (element: T) => TKey, elementSelector?: (element: T) => TElement): Record<TKey, TElement>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function toSet<T>(this: IEnumerable<T>): Set<T>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function trace<T, TValue = T>(this: IEnumerable<T>, message?: string, selector?: (element: T) => TValue): IEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function traverseBreadthFirst<T, TResult = T>(this: IEnumerable<T>, childrenSelector: (element: T) => IEnumerable<T>, resultSelector?: (element: T, nestLevel: number) => TResult): IEnumerable<TResult>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function traverseDepthFirst<T, TResult = T>(this: IEnumerable<T>, childrenSelector: (element: T) => IEnumerable<T>, resultSelector?: (element: T, nestLevel: number) => TResult): IEnumerable<TResult>;
@@ -0,0 +1,2 @@
1
+ import type { EnumerableInput, IEnumerable } from '../types.js';
2
+ export declare function unionBy<T, TKey, TCompare = TKey>(this: IEnumerable<T>, second: EnumerableInput<T>, keySelector: (element: T) => TKey, compareSelector?: (key: TKey) => TCompare): IEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { EnumerableInput, IEnumerable } from '../types.js';
2
+ export declare function union<T, TCompare>(this: IEnumerable<T>, second: EnumerableInput<T>, compareSelector?: (element: T) => TCompare): IEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function weightedSample<T>(this: IEnumerable<T>, weightSelector: (element: T) => number): IEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function whereIf<T>(this: IEnumerable<T>, flag: boolean | string | undefined | null, filter: (element: T) => boolean): IEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function where<T>(this: IEnumerable<T>, predicate: (element: T, index: number) => boolean): IEnumerable<T>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable, Neighbors } from '../types.js';
2
+ export declare function withNeighbors<T>(this: IEnumerable<T>): IEnumerable<Neighbors<T>>;
@@ -0,0 +1,2 @@
1
+ import type { IEnumerable } from '../types.js';
2
+ export declare function zip<T, TResult>(this: IEnumerable<T>, ...params: unknown[]): IEnumerable<TResult>;