forked from capricorn86/happy-dom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INamedNodeMap.ts
70 lines (62 loc) · 1.46 KB
/
INamedNodeMap.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
import IAttr from '../nodes/attr/IAttr';
/**
* NamedNodeMap.
*
* Reference:
* https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap.
*/
export default interface INamedNodeMap extends Iterable<IAttr> {
[index: number]: IAttr;
[Symbol.toStringTag]: string;
readonly length: number;
/**
* Returns attribute by index.
*
* @param index Index.
*/
item: (index: number) => IAttr;
/**
* Returns attribute by name.
*
* @param qualifiedName Name.
* @returns Attribute.
*/
getNamedItem: (qualifiedName: string) => IAttr;
/**
* Returns attribute by name and namespace.
*
* @param namespace Namespace.
* @param localName Local name of the attribute.
* @returns Attribute.
*/
getNamedItemNS: (namespace: string, localName: string) => IAttr;
/**
* Adds a new attribute node.
*
* @param attr Attribute.
* @returns Replaced attribute.
*/
setNamedItem: (attr: IAttr) => IAttr;
/**
* Adds a new namespaced attribute node.
*
* @param attr Attribute.
* @returns Replaced attribute.
*/
setNamedItemNS: (attr: IAttr) => IAttr;
/**
* Removes an attribute.
*
* @param qualifiedName Name of the attribute.
* @returns Removed attribute.
*/
removeNamedItem: (qualifiedName: string) => IAttr;
/**
* Removes a namespaced attribute.
*
* @param namespace Namespace.
* @param localName Local name of the attribute.
* @returns Removed attribute.
*/
removeNamedItemNS: (namespace: string, localName: string) => IAttr;
}