-
Notifications
You must be signed in to change notification settings - Fork 30.3k
/
Copy pathindex.d.ts
91 lines (85 loc) · 3.74 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Type definitions for non-npm package @ember/debug 3.16
// Project: https://emberjs.com/api/ember/3.16/modules/@ember%2Fdebug
// Definitions by: Mike North <https://github.com/mike-north>
// Chris Krycho <https://github.com/chriskrycho>
// Dan Freeman <https://github.com/dfreeman>
// James C. Davis <https://github.com/jamescdavis>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.7
/**
* Define an assertion that will throw an exception if the condition is not met.
*/
export function assert(desc: string): never;
export function assert(desc: string, test: unknown): asserts test;
/**
* Display a debug notice.
*/
export function debug(message: string): void;
/**
* Convenience method to inspect an object. This method will attempt to
* convert the object into a useful string description.
*/
export function inspect(obj: any): string;
/**
* Allows for runtime registration of handler functions that override the default deprecation behavior.
* Deprecations are invoked by calls to [Ember.deprecate](http://emberjs.com/api/classes/Ember.html#method_deprecate).
* The following example demonstrates its usage by registering a handler that throws an error if the
* message contains the word "should", otherwise defers to the default handler.
*/
export function registerDeprecationHandler(handler: (message: string, options: { id: string, until: string }, next: () => void) => void): void;
/**
* Allows for runtime registration of handler functions that override the default warning behavior.
* Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn).
* The following example demonstrates its usage by registering a handler that does nothing overriding Ember's
* default warning behavior.
*/
export function registerWarnHandler(handler: (message: string, options: { id: string }, next: (message?: string, options?: { id: string }) => void) => void): void;
/**
* Run a function meant for debugging.
*/
export function runInDebug(func: () => any): void;
/**
* Display a warning with the provided message.
*/
export function warn(message: string, test: boolean, options: { id: string }): void;
export function warn(message: string, options: { id: string }): void;
/**
* @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options
*/
export function warn(message: string, test: boolean, options?: { id?: string }): void;
/**
* @deprecated Missing deprecation options: https://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options
*/
export function warn(message: string, options?: { id?: string }): void;
/**
* Display a deprecation warning with the provided message and a stack trace
* (Chrome and Firefox only).
*
* In a production build, this method is defined as an empty function (NOP).
* Uses of this method in Ember itself are stripped from the ember.prod.js build.
*
* @param message A description of the deprecation.
* @param test If falsy, the deprecation will be displayed.
* @param options The deprecation options.
*/
export function deprecate(
message: string,
test: boolean,
options: {
/**
* A unique id for this deprecation. The id can be used by Ember debugging
* tools to change the behavior (raise, log or silence) for that specific
* deprecation. The id should be namespaced by dots, e.g.
* `"view.helper.select"`.
*/
id: string;
/**
* The version of Ember when this deprecation warning will be removed.
*/
until: string;
/**
* An optional url to the transition guide on the emberjs.com website.
*/
url?: string;
},
): void;