forked from roblox-aurora/rbxts-transform-debug
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
84 lines (77 loc) · 2.5 KB
/
index.d.ts
File metadata and controls
84 lines (77 loc) · 2.5 KB
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
/**
* The debug information in a `$dbg` custom call
*
* If you're referencing this in your code, import it as:
* ```ts
* import type { $DebugInfo } from "rbxts-transform-debug";
* ```
* to get around the import stripping
*/
export interface $DebugInfo {
file: string;
lineNumber: number;
rawText: string;
}
/**
* Creates a debug print for the supplied expression
*
* The expression will only be wrapped with the debug information if `enabled` (true by default) is set
* or `environmentRequires` is fulfilled.
*
* @param expression The expression to make a debug statement of
* @param customHandler A custom IIFE handler for debugging this expression
*/
export function $dbg<T>(expression: T): T;
export function $dbg<T>(expression: T, customHandler: (value: Readonly<T>, debug: $DebugInfo) => void): T;
/**
* Same as `print`, but includes the source information
* Will be prefixed with something like `[src/shared/module.ts:11]`
*
* This can be optionally enabled/disabled in emit using `enabled` and `environmentRequires`.
*/
export function $print(...params: unknown[]): void;
/**
* Same as `warn`, but includes the source information
* Will be prefixed with something like `[src/shared/module.ts:11]`
*
* This can be optionally enabled/disabled in emit using `enabled` and `environmentRequires`.
*/
export function $warn(...params: unknown[]): void;
/**
* Same as `error`, but includes the source information
* Will be prefixed with something like `[src/shared/module.ts:11]`
*
* This can be optionally enabled/disabled in emit using `enabled` and `environmentRequires`.
*/
export function $error(text: string, level?: number): void;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
/**
* A macro that gets replaced with the specified type or value
* @param T An interface, type or class type
* @param value A value of which to get the name for
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function $nameof<T>(): string;
export function $nameof(value: unknown): string;
export interface $git {
/**
* The name of the branch this project is on
*/
readonly Branch: string;
/**
* The current short commit hash (7 characters)
*/
readonly Commit: string;
/**
* The current full commit hash
*/
readonly CommitHash: string;
/**
* The latest tag this project has (will be an empty string, if no tags have ever been applied)
*/
readonly LatestTag: string;
}
/**
* Macro that returns an object containing git information
*/
export function $git(): $git;