@types/babel__code-frame 7.0.2 → 7.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,9 +6,67 @@ This package contains type definitions for @babel/code-frame (https://github.com
6
6
 
7
7
  # Details
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__code-frame.
9
+ ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__code-frame/index.d.ts)
10
+ ````ts
11
+ // Type definitions for @babel/code-frame 7.0
12
+ // Project: https://github.com/babel/babel/tree/master/packages/babel-code-frame, https://babeljs.io
13
+ // Definitions by: Mohsen Azimi <https://github.com/mohsen1>
14
+ // Forbes Lindesay <https://github.com/ForbesLindesay>
15
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
16
+
17
+ export interface SourceLocation {
18
+ start: { line: number; column?: number | undefined };
19
+ end?: { line: number; column?: number | undefined } | undefined;
20
+ }
21
+ export function codeFrameColumns(
22
+ rawLines: string,
23
+ location: SourceLocation,
24
+ options?: BabelCodeFrameOptions,
25
+ ): string;
26
+
27
+ export interface BabelCodeFrameOptions {
28
+ /** Syntax highlight the code as JavaScript for terminals. default: false */
29
+ highlightCode?: boolean | undefined;
30
+ /** The number of lines to show above the error. default: 2 */
31
+ linesAbove?: number | undefined;
32
+ /** The number of lines to show below the error. default: 3 */
33
+ linesBelow?: number | undefined;
34
+ /**
35
+ * Forcibly syntax highlight the code as JavaScript (for non-terminals);
36
+ * overrides highlightCode.
37
+ * default: false
38
+ */
39
+ forceColor?: boolean | undefined;
40
+ /**
41
+ * Pass in a string to be displayed inline (if possible) next to the
42
+ * highlighted location in the code. If it can't be positioned inline,
43
+ * it will be placed above the code frame.
44
+ * default: nothing
45
+ */
46
+ message?: string | undefined;
47
+ }
48
+
49
+ /**
50
+ * Generate errors that contain a code frame that point to source locations.
51
+ *
52
+ * @param rawLines Raw lines to frame
53
+ * @param lineNumber Line number (1 indexed)
54
+ * @param colNumber Column number
55
+ * @param options Additional options
56
+ *
57
+ * @returns Framed code
58
+ */
59
+ export default function codeFrame(
60
+ rawLines: string,
61
+ lineNumber: number,
62
+ colNumber: number,
63
+ options?: BabelCodeFrameOptions,
64
+ ): string;
65
+
66
+ ````
9
67
 
10
68
  ### Additional Details
11
- * Last updated: Fri, 25 Sep 2020 23:55:29 GMT
69
+ * Last updated: Fri, 15 Sep 2023 19:06:48 GMT
12
70
  * Dependencies: none
13
71
  * Global values: none
14
72
 
@@ -5,35 +5,35 @@
5
5
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6
6
 
7
7
  export interface SourceLocation {
8
- start: { line: number; column?: number };
9
- end?: { line: number; column?: number };
8
+ start: { line: number; column?: number | undefined };
9
+ end?: { line: number; column?: number | undefined } | undefined;
10
10
  }
11
11
  export function codeFrameColumns(
12
12
  rawLines: string,
13
13
  location: SourceLocation,
14
- options?: BabelCodeFrameOptions
14
+ options?: BabelCodeFrameOptions,
15
15
  ): string;
16
16
 
17
17
  export interface BabelCodeFrameOptions {
18
18
  /** Syntax highlight the code as JavaScript for terminals. default: false */
19
- highlightCode?: boolean;
19
+ highlightCode?: boolean | undefined;
20
20
  /** The number of lines to show above the error. default: 2 */
21
- linesAbove?: number;
21
+ linesAbove?: number | undefined;
22
22
  /** The number of lines to show below the error. default: 3 */
23
- linesBelow?: number;
23
+ linesBelow?: number | undefined;
24
24
  /**
25
25
  * Forcibly syntax highlight the code as JavaScript (for non-terminals);
26
26
  * overrides highlightCode.
27
27
  * default: false
28
28
  */
29
- forceColor?: boolean;
29
+ forceColor?: boolean | undefined;
30
30
  /**
31
31
  * Pass in a string to be displayed inline (if possible) next to the
32
32
  * highlighted location in the code. If it can't be positioned inline,
33
33
  * it will be placed above the code frame.
34
34
  * default: nothing
35
35
  */
36
- message?: string;
36
+ message?: string | undefined;
37
37
  }
38
38
 
39
39
  /**
@@ -50,5 +50,5 @@ export default function codeFrame(
50
50
  rawLines: string,
51
51
  lineNumber: number,
52
52
  colNumber: number,
53
- options?: BabelCodeFrameOptions
53
+ options?: BabelCodeFrameOptions,
54
54
  ): string;
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@types/babel__code-frame",
3
- "version": "7.0.2",
3
+ "version": "7.0.4",
4
4
  "description": "TypeScript definitions for @babel/code-frame",
5
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__code-frame",
5
6
  "license": "MIT",
6
7
  "contributors": [
7
8
  {
@@ -24,6 +25,6 @@
24
25
  },
25
26
  "scripts": {},
26
27
  "dependencies": {},
27
- "typesPublisherContentHash": "698686beb4a32cd9c28b129906c106d97632965f919400c4be88633fc157bf91",
28
- "typeScriptVersion": "3.2"
28
+ "typesPublisherContentHash": "d34b16c8b272ca1fa401cb111581efd10e48a3b8a64c4de5daa985b314b2f4bc",
29
+ "typeScriptVersion": "4.5"
29
30
  }