fix(ivy): removing no longer needed QueryReadType (#26314) (#26314)

PR Close #26314

PR Close #26314
This commit is contained in:
Andrew Kushnir 2018-10-08 16:33:04 -07:00 committed by Jason Aden
parent 7ea5161d4d
commit 69b9758ab8
2 changed files with 6 additions and 9 deletions

View File

@ -69,11 +69,9 @@ export interface LQueries {
*/ */
track<T>( track<T>(
queryList: QueryList<T>, predicate: Type<any>|string[], descend?: boolean, queryList: QueryList<T>, predicate: Type<any>|string[], descend?: boolean,
read?: QueryReadType<T>|Type<T>): void; read?: Type<T>): void;
} }
export class QueryReadType<T> { private defeatStructuralTyping: any; }
// Note: This hack is necessary so we don't erroneously get a circular dependency // Note: This hack is necessary so we don't erroneously get a circular dependency
// failure based on types. // failure based on types.
export const unusedValueExportToPlacateAjd = 1; export const unusedValueExportToPlacateAjd = 1;

View File

@ -24,7 +24,7 @@ import {DirectiveDef, unusedValueExportToPlacateAjd as unused1} from './interfac
import {unusedValueExportToPlacateAjd as unused2} from './interfaces/injector'; import {unusedValueExportToPlacateAjd as unused2} from './interfaces/injector';
import {TContainerNode, TElementContainerNode, TElementNode, TNode, TNodeFlags, TNodeType, unusedValueExportToPlacateAjd as unused3} from './interfaces/node'; import {TContainerNode, TElementContainerNode, TElementNode, TNode, TNodeFlags, TNodeType, unusedValueExportToPlacateAjd as unused3} from './interfaces/node';
import {LQueries, QueryReadType, unusedValueExportToPlacateAjd as unused4} from './interfaces/query'; import {LQueries, QueryReadType, unusedValueExportToPlacateAjd as unused4} from './interfaces/query';
import {LViewData, TVIEW} from './interfaces/view'; import {DIRECTIVES, LViewData, TVIEW} from './interfaces/view';
import {flatten, isContentQueryHost} from './util'; import {flatten, isContentQueryHost} from './util';
import {createElementRef, createTemplateRef} from './view_engine_compatibility'; import {createElementRef, createTemplateRef} from './view_engine_compatibility';
@ -48,7 +48,7 @@ export interface QueryPredicate<T> {
/** /**
* Indicates which token should be read from DI for this query. * Indicates which token should be read from DI for this query.
*/ */
read: QueryReadType<T>|Type<T>|null; read: Type<T>|null;
} }
/** /**
@ -95,7 +95,7 @@ export class LQueries_ implements LQueries {
track<T>( track<T>(
queryList: viewEngine_QueryList<T>, predicate: Type<T>|string[], descend?: boolean, queryList: viewEngine_QueryList<T>, predicate: Type<T>|string[], descend?: boolean,
read?: QueryReadType<T>|Type<T>): void { read?: Type<T>): void {
if (descend) { if (descend) {
this.deep = createQuery(this.deep, queryList, predicate, read != null ? read : null); this.deep = createQuery(this.deep, queryList, predicate, read != null ? read : null);
} else { } else {
@ -337,8 +337,7 @@ function addMatch(query: LQuery<any>, matchingValue: any): void {
query.list.setDirty(); query.list.setDirty();
} }
function createPredicate<T>( function createPredicate<T>(predicate: Type<T>| string[], read: Type<T>| null): QueryPredicate<T> {
predicate: Type<T>| string[], read: QueryReadType<T>| Type<T>| null): QueryPredicate<T> {
const isArray = Array.isArray(predicate); const isArray = Array.isArray(predicate);
return { return {
type: isArray ? null : predicate as Type<T>, type: isArray ? null : predicate as Type<T>,
@ -349,7 +348,7 @@ function createPredicate<T>(
function createQuery<T>( function createQuery<T>(
previous: LQuery<any>| null, queryList: QueryList<T>, predicate: Type<T>| string[], previous: LQuery<any>| null, queryList: QueryList<T>, predicate: Type<T>| string[],
read: QueryReadType<T>| Type<T>| null): LQuery<T> { read: Type<T>| null): LQuery<T> {
return { return {
next: previous, next: previous,
list: queryList, list: queryList,