Skip to content

Commit

Permalink
remove duplicate interface declarations. Extend for array and read on…
Browse files Browse the repository at this point in the history
…ly array
  • Loading branch information
dibiancoj committed Dec 9, 2016
1 parent 1180c26 commit 2ef77dd
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 55 deletions.
1 change: 1 addition & 0 deletions Linq4Javascript/Scripts/ConfigForWorkingAsync.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Linq4Javascript/Scripts/JLinq.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Linq4Javascript/Scripts/JLinq.js.map

Large diffs are not rendered by default.

60 changes: 6 additions & 54 deletions Linq4Javascript/Scripts/JLinq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4123,8 +4123,9 @@ module ToracTechnologies {

//#region Array Interface

interface Array<T> {

//interface so we don't have to duplicate code off of Array and ReadonlyArray
interface ILinqExtensionMethods<T>
{
AsQueryable(): ToracTechnologies.JLinq.Queryable<T>;

Where(WhereClauseSelector: (ItemToTest: T) => boolean): ToracTechnologies.JLinq.WhereIterator<T>;
Expand Down Expand Up @@ -4178,59 +4179,10 @@ interface Array<T> {
DefaultIfEmpty<T>(DefaultValue: T): ToracTechnologies.JLinq.DefaultIfEmptyIterator<T>;
}

interface ReadonlyArray<T> {

AsQueryable(): ToracTechnologies.JLinq.Queryable<T>;

Where(WhereClauseSelector: (ItemToTest: T) => boolean): ToracTechnologies.JLinq.WhereIterator<T>;

First(WhereClauseSelector?: (ItemToTest: T) => boolean): T;
FirstOrDefault(WhereClauseSelector?: (ItemToTest: T) => boolean): T;
Single(WhereClauseSelector?: (ItemToTest: T) => boolean): T;
SingleOrDefault(WhereClauseSelector?: (ItemToTest: T) => boolean): T;

Select<TNewObject>(Creator: (ItemToSelect: T) => TNewObject): ToracTechnologies.JLinq.SelectIterator<T, TNewObject>;
SelectMany<TCollectionType>(CollectionPropertySelector: (thisCollectionProperty: T) => Array<TCollectionType>): ToracTechnologies.JLinq.SelectManyIterator<T, TCollectionType>;
Distinct<TPropertyType>(PropertySelector: (ItemToTest: T) => TPropertyType): ToracTechnologies.JLinq.DistinctIterator<T, TPropertyType>;

Take(HowManyToTake: number): ToracTechnologies.JLinq.TakeIterator<T>;
TakeWhile(PredicateToTakeWhile: (ItemToTest: T) => boolean): ToracTechnologies.JLinq.TakeWhileIterator<T>;

Skip(HowManyToSkip: number): ToracTechnologies.JLinq.SkipIterator<T>;
SkipWhile(PredicateToSkipUntil: (ItemToTest: T) => boolean): ToracTechnologies.JLinq.SkipWhileIterator<T>;

Aggregate(AggregatePredicate: (WorkingT: T, NextT: T) => T): T;
All(WhereClauseSelector: (ItemToTest: T) => boolean): boolean;

Any(WhereClauseSelector?: (ItemToTest: T) => boolean): boolean;
Last(WhereClauseSelector?: (ItemToTest: T) => boolean): T;


Concat(ArrayToConcat: Array<T> | ToracTechnologies.JLinq.Iterator<T>): ToracTechnologies.JLinq.ConcatIterator<T>;
Union(ArrayToUnion: Array<T> | ToracTechnologies.JLinq.Iterator<T>): ToracTechnologies.JLinq.UnionIterator<T>;

Count(): number;
Count(WhereClauseSelector?: (ItemToTest: T) => boolean): number;
Min(): number;
Max(): number;
Sum(): number;
Average(): number;

GroupBy<TKey>(GroupBySelector: (ItemKeyToTest: T) => TKey): Array<ToracTechnologies.JLinq.IGrouping<TKey, T>>;
ToDictionary<TKey>(KeySelector: (PropertyToKeyOn: T) => TKey): ToracTechnologies.JLinq.IDictionary<TKey, T>;
ToHashSet(): ToracTechnologies.JLinq.IHashSet<T>;
Paginate(CurrentPageNumber: number, HowManyRecordsPerPage: number): ToracTechnologies.JLinq.TakeIterator<T>;

OrderBy<TSortPropertyType>(SortPropertySelector: (thisPropertyToSortOn: T) => TSortPropertyType): ToracTechnologies.JLinq.OrderByIterator<T>;
OrderByDescending<TSortPropertyType>(SortPropertySelector: (thisPropertyToSortOn: T) => TSortPropertyType): ToracTechnologies.JLinq.OrderByIterator<T>;

ElementAt(Index: number): T;
ElementAtDefault(Index: number): T;

Join<T, TOuterArrayType, TSelectorDataType, TResultDataType>(OuterJoinArray: TOuterArrayType[] | ToracTechnologies.JLinq.Iterator<TOuterArrayType>, InnerKeySelector: (InnerRecord: T) => TSelectorDataType, OuterKeySelector: (OuterRecord: TOuterArrayType) => TSelectorDataType, JoinSelector: (InnerRecord: T, OuterRecord: TOuterArrayType) => TResultDataType): ToracTechnologies.JLinq.JoinIterator<T, TOuterArrayType, TSelectorDataType, TResultDataType>;
GroupJoin<T, TOuterArrayType, TSelectorDataType, TResultDataType>(OuterJoinArray: TOuterArrayType[] | ToracTechnologies.JLinq.Iterator<TOuterArrayType>, InnerKeySelector: (InnerRecord: T) => TSelectorDataType, OuterKeySelector: (OuterRecord: TOuterArrayType) => TSelectorDataType, JoinSelector: (InnerRecord: T, OuterRecord: TOuterArrayType[]) => TResultDataType): ToracTechnologies.JLinq.GroupJoinIterator<T, TOuterArrayType, TSelectorDataType, TResultDataType>;
interface Array<T> extends ILinqExtensionMethods<T> {
}

DefaultIfEmpty<T>(DefaultValue: T): ToracTechnologies.JLinq.DefaultIfEmptyIterator<T>;
interface ReadonlyArray<T> extends ILinqExtensionMethods<T> {
}

//#endregion
Expand Down
1 change: 1 addition & 0 deletions Linq4Javascript/Scripts/UnitTestsAsync.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Linq4Javascript/Scripts/UnitTestsImmutableArray.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Linq4Javascript/Scripts/UnitTestsRegular.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Linq4Javascript/Scripts/unittestframework.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2ef77dd

Please sign in to comment.