-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherr-import-attribute-missing.ts
89 lines (83 loc) · 2.32 KB
/
err-import-attribute-missing.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
/**
* @file Errors - ERR_IMPORT_ATTRIBUTE_MISSING
* @module errnode/errors/ERR_IMPORT_ATTRIBUTE_MISSING
* @see https://github.com/nodejs/node/blob/v22.7.0/lib/internal/errors.js#L1340-L1341
*/
import E from '#e'
import { codes } from '#src/enums'
import type {
NodeError,
NodeErrorConstructor,
Stringifiable
} from '#src/interfaces'
/**
* `ERR_IMPORT_ATTRIBUTE_MISSING` schema.
*
* @see {@linkcode NodeError}
* @see https://nodejs.org/api/errors.html#err_import_attribute_missing
*
* @extends {NodeError<codes.ERR_IMPORT_ATTRIBUTE_MISSING>}
* @extends {TypeError}
*/
interface ErrImportAttributeMissing
extends NodeError<codes.ERR_IMPORT_ATTRIBUTE_MISSING>, TypeError {}
/**
* `ERR_IMPORT_ATTRIBUTE_MISSING` message arguments.
*
* @see {@linkcode Stringifiable}
*/
type Args = [id: Stringifiable, key: Stringifiable, value: Stringifiable]
/**
* `ERR_IMPORT_ATTRIBUTE_MISSING` constructor.
*
* @see {@linkcode Args}
* @see {@linkcode ErrImportAttributeMissing}
* @see {@linkcode NodeErrorConstructor}
*
* @extends {NodeErrorConstructor<ErrImportAttributeMissing,Args>}
*/
interface ErrImportAttributeMissingConstructor
extends NodeErrorConstructor<ErrImportAttributeMissing, Args> {
/**
* Create a new `ERR_IMPORT_ATTRIBUTE_MISSING` error.
*
* @see {@linkcode ErrImportAttributeMissing}
* @see {@linkcode Stringifiable}
*
* @param {Stringifiable} id
* Module id
* @param {Stringifiable} key
* The required import attribute key
* @param {Stringifiable} value
* The required import attribute value
* @return {ErrImportAttributeMissing}
*/
new (
id: Stringifiable,
key: Stringifiable,
value: Stringifiable
): ErrImportAttributeMissing
}
/**
* `ERR_IMPORT_ATTRIBUTE_MISSING` model.
*
* Thrown when an import attribute is missing, thus preventing the specified
* module from being imported.
*
* @see {@linkcode ErrImportAttributeMissingConstructor}
*
* @type {ErrImportAttributeMissingConstructor}
*
* @class
*/
const ERR_IMPORT_ATTRIBUTE_MISSING: ErrImportAttributeMissingConstructor = E(
codes.ERR_IMPORT_ATTRIBUTE_MISSING,
TypeError,
'Module "%s" needs an import attribute of "%s: %s"'
)
export {
ERR_IMPORT_ATTRIBUTE_MISSING as default,
type ErrImportAttributeMissing,
type Args as ErrImportAttributeMissingArgs,
type ErrImportAttributeMissingConstructor
}