build: extract interface and util sub compilation from core (#28028)
PR Close #28028
This commit is contained in:

committed by
Andrew Kushnir

parent
b05baa59e0
commit
885f1af509
16
packages/core/src/interface/BUILD.bazel
Normal file
16
packages/core/src/interface/BUILD.bazel
Normal 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",
|
||||
)
|
29
packages/core/src/interface/type.ts
Normal file
29
packages/core/src/interface/type.ts
Normal 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];
|
||||
};
|
Reference in New Issue
Block a user