build: extract interface and util sub compilation from core (#28028)

PR Close #28028
This commit is contained in:
Misko Hevery
2019-01-09 13:49:16 -08:00
committed by Andrew Kushnir
parent b05baa59e0
commit 885f1af509
140 changed files with 773 additions and 363 deletions

View File

@ -0,0 +1,16 @@
package(default_visibility = [
"//packages/core:__subpackages__",
"//tools/public_api_guard:__pkg__",
])
load("//tools:defaults.bzl", "ts_library")
ts_library(
name = "interface",
srcs = glob(
[
"*.ts",
],
),
module_name = "@angular/core/interface",
)

View File

@ -0,0 +1,29 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @description
*
* Represents a type that a Component or other object is instances of.
*
* An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by
* the `MyCustomComponent` constructor function.
*
* @publicApi
*/
export const Type = Function;
export function isType(v: any): v is Type<any> {
return typeof v === 'function';
}
export interface Type<T> extends Function { new (...args: any[]): T; }
export type Mutable<T extends{[x: string]: any}, K extends string> = {
[P in K]: T[P];
};