UNPKG

2.85 kBTypeScriptView Raw
1declare module '@ember/debug' {
2 import type { DeprecateFunc, DeprecationOptions } from '@ember/debug/lib/deprecate';
3 import type { WarnFunc } from '@ember/debug/lib/warn';
4 import { assert } from '@ember/debug/lib/assert';
5 export { registerHandler as registerWarnHandler } from '@ember/debug/lib/warn';
6 export {
7 registerHandler as registerDeprecationHandler,
8 type DeprecationOptions,
9 } from '@ember/debug/lib/deprecate';
10 export { default as inspect } from '@ember/debug/lib/inspect';
11 export { isTesting, setTesting } from '@ember/debug/lib/testing';
12 export { default as captureRenderTree } from '@ember/debug/lib/capture-render-tree';
13 export type DebugFunctionType =
14 | 'assert'
15 | 'info'
16 | 'warn'
17 | 'debug'
18 | 'deprecate'
19 | 'debugSeal'
20 | 'debugFreeze'
21 | 'runInDebug'
22 | 'deprecateFunc';
23 export type DebugFunc = (message: string) => void;
24 export type DebugSealFunc = (obj: object) => void;
25 export type DebugFreezeFunc = (obj: object) => void;
26 export type InfoFunc = (message: string, options?: object) => void;
27 export type RunInDebugFunc = (func: () => void) => void;
28 export type DeprecateFuncFunc = (
29 message: string,
30 options: DeprecationOptions,
31 func: Function
32 ) => Function;
33 export type GetDebugFunction = {
34 (type: 'assert'): typeof assert;
35 (type: 'info'): InfoFunc;
36 (type: 'warn'): WarnFunc;
37 (type: 'debug'): DebugFunc;
38 (type: 'debugSeal'): DebugSealFunc;
39 (type: 'debugFreeze'): DebugFreezeFunc;
40 (type: 'deprecateFunc'): DeprecateFuncFunc;
41 (type: 'deprecate'): DeprecateFunc;
42 (type: 'runInDebug'): RunInDebugFunc;
43 };
44 export type SetDebugFunction = {
45 (type: 'assert', func: typeof assert): typeof assert;
46 (type: 'info', func: InfoFunc): InfoFunc;
47 (type: 'warn', func: WarnFunc): WarnFunc;
48 (type: 'debug', func: DebugFunc): DebugFunc;
49 (type: 'debugSeal', func: DebugSealFunc): DebugSealFunc;
50 (type: 'debugFreeze', func: DebugFreezeFunc): DebugFreezeFunc;
51 (type: 'deprecateFunc', func: DeprecateFuncFunc): DeprecateFuncFunc;
52 (type: 'deprecate', func: DeprecateFunc): DeprecateFunc;
53 (type: 'runInDebug', func: RunInDebugFunc): RunInDebugFunc;
54 };
55 let info: InfoFunc;
56 let warn: WarnFunc;
57 let debug: DebugFunc;
58 let debugSeal: DebugSealFunc;
59 let debugFreeze: DebugFreezeFunc;
60 let runInDebug: RunInDebugFunc;
61 let setDebugFunction: SetDebugFunction;
62 let getDebugFunction: GetDebugFunction;
63 let deprecateFunc: DeprecateFuncFunc;
64 export function deprecate(...args: Parameters<DeprecateFunc>): ReturnType<DeprecateFunc>;
65 let _warnIfUsingStrippedFeatureFlags: any;
66 export {
67 assert,
68 info,
69 warn,
70 debug,
71 debugSeal,
72 debugFreeze,
73 runInDebug,
74 deprecateFunc,
75 setDebugFunction,
76 getDebugFunction,
77 _warnIfUsingStrippedFeatureFlags,
78 };
79}