UNPKG

6.49 kBTypeScriptView Raw
1export interface BrowserNodeGlobal {
2 Object: typeof Object;
3 Array: typeof Array;
4 Map: typeof Map;
5 Set: typeof Set;
6 Date: DateConstructor;
7 RegExp: RegExpConstructor;
8 JSON: typeof JSON;
9 Math: any;
10 assert(condition: any): void;
11 Reflect: any;
12 getAngularTestability: Function;
13 getAllAngularTestabilities: Function;
14 getAllAngularRootElements: Function;
15 frameworkStabilizers: Array<Function>;
16 setTimeout: Function;
17 clearTimeout: Function;
18 setInterval: Function;
19 clearInterval: Function;
20 encodeURI: Function;
21}
22export declare function scheduleMicroTask(fn: Function): void;
23export declare const IS_DART: boolean;
24declare var _global: BrowserNodeGlobal;
25export { _global as global };
26export declare var Type: FunctionConstructor;
27/**
28 * Runtime representation a type that a Component or other object is instances of.
29 *
30 * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by
31 * the `MyCustomComponent` constructor function.
32 */
33export interface Type extends Function {
34}
35/**
36 * Runtime representation of a type that is constructable (non-abstract).
37 */
38export interface ConcreteType extends Type {
39 new (...args: any[]): any;
40}
41export declare function getTypeNameForDebugging(type: Type): string;
42export declare var Math: any;
43export declare var Date: DateConstructor;
44export declare function lockMode(): void;
45/**
46 * Disable Angular's development mode, which turns off assertions and other
47 * checks within the framework.
48 *
49 * One important assertion this disables verifies that a change detection pass
50 * does not result in additional changes to any bindings (also known as
51 * unidirectional data flow).
52 * @stable
53 */
54export declare function enableProdMode(): void;
55export declare function assertionsEnabled(): boolean;
56export declare function isPresent(obj: any): boolean;
57export declare function isBlank(obj: any): boolean;
58export declare function isBoolean(obj: any): boolean;
59export declare function isNumber(obj: any): boolean;
60export declare function isString(obj: any): obj is String;
61export declare function isFunction(obj: any): boolean;
62export declare function isType(obj: any): boolean;
63export declare function isStringMap(obj: any): boolean;
64export declare function isStrictStringMap(obj: any): boolean;
65export declare function isPromise(obj: any): boolean;
66export declare function isArray(obj: any): boolean;
67export declare function isDate(obj: any): obj is Date;
68export declare function noop(): void;
69export declare function stringify(token: any): string;
70export declare function serializeEnum(val: any): number;
71export declare function deserializeEnum(val: any, values: Map<number, any>): any;
72export declare function resolveEnumToken(enumValue: any, val: any): string;
73export declare class StringWrapper {
74 static fromCharCode(code: number): string;
75 static charCodeAt(s: string, index: number): number;
76 static split(s: string, regExp: RegExp): string[];
77 static equals(s: string, s2: string): boolean;
78 static stripLeft(s: string, charVal: string): string;
79 static stripRight(s: string, charVal: string): string;
80 static replace(s: string, from: string, replace: string): string;
81 static replaceAll(s: string, from: RegExp, replace: string): string;
82 static slice<T>(s: string, from?: number, to?: number): string;
83 static replaceAllMapped(s: string, from: RegExp, cb: Function): string;
84 static contains(s: string, substr: string): boolean;
85 static compare(a: string, b: string): number;
86}
87export declare class StringJoiner {
88 parts: string[];
89 constructor(parts?: string[]);
90 add(part: string): void;
91 toString(): string;
92}
93export declare class NumberParseError extends Error {
94 message: string;
95 name: string;
96 constructor(message: string);
97 toString(): string;
98}
99export declare class NumberWrapper {
100 static toFixed(n: number, fractionDigits: number): string;
101 static equal(a: number, b: number): boolean;
102 static parseIntAutoRadix(text: string): number;
103 static parseInt(text: string, radix: number): number;
104 static parseFloat(text: string): number;
105 static NaN: number;
106 static isNaN(value: any): boolean;
107 static isInteger(value: any): boolean;
108}
109export declare var RegExp: RegExpConstructor;
110export declare class RegExpWrapper {
111 static create(regExpStr: string, flags?: string): RegExp;
112 static firstMatch(regExp: RegExp, input: string): RegExpExecArray;
113 static test(regExp: RegExp, input: string): boolean;
114 static matcher(regExp: RegExp, input: string): {
115 re: RegExp;
116 input: string;
117 };
118 static replaceAll(regExp: RegExp, input: string, replace: Function): string;
119}
120export declare class RegExpMatcherWrapper {
121 static next(matcher: {
122 re: RegExp;
123 input: string;
124 }): RegExpExecArray;
125}
126export declare class FunctionWrapper {
127 static apply(fn: Function, posArgs: any): any;
128 static bind(fn: Function, scope: any): Function;
129}
130export declare function looseIdentical(a: any, b: any): boolean;
131export declare function getMapKey<T>(value: T): T;
132export declare function normalizeBlank(obj: Object): any;
133export declare function normalizeBool(obj: boolean): boolean;
134export declare function isJsObject(o: any): boolean;
135export declare function print(obj: Error | Object): void;
136export declare function warn(obj: Error | Object): void;
137export declare class Json {
138 static parse(s: string): Object;
139 static stringify(data: Object): string;
140}
141export declare class DateWrapper {
142 static create(year: number, month?: number, day?: number, hour?: number, minutes?: number, seconds?: number, milliseconds?: number): Date;
143 static fromISOString(str: string): Date;
144 static fromMillis(ms: number): Date;
145 static toMillis(date: Date): number;
146 static now(): Date;
147 static toJson(date: Date): string;
148}
149export declare function setValueOnPath(global: any, path: string, value: any): void;
150export declare function getSymbolIterator(): string | symbol;
151export declare function evalExpression(sourceUrl: string, expr: string, declarations: string, vars: {
152 [key: string]: any;
153}): any;
154export declare function isPrimitive(obj: any): boolean;
155export declare function hasConstructor(value: Object, type: Type): boolean;
156export declare function bitWiseOr(values: number[]): number;
157export declare function bitWiseAnd(values: number[]): number;
158export declare function escape(s: string): string;