Skip to content

Commit cd392e1

Browse files
committed
fix: update api docs for SetAttribute to show correct sub-types
Resolves #57
1 parent cd90dda commit cd392e1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

docs/plugin-api.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,17 @@ This means that a single edit can either consist in a sequence of other edits or
118118
> Intent to set or remove (if null) attributes on `element`.
119119
120120
```typescript
121+
/** Record from attribute names to attribute values */
122+
export type AttributesV2 = Partial<Record<string, string | null>>;
123+
124+
/** Record from namespace URIs to `Attributes` records */
125+
export type AttributesNS = Partial<Record<string, AttributesV2>>;
126+
127+
/** Intent to set or remove (if `null`) `attributes`(-`NS`) on `element` */
121128
export type SetAttributes = {
122129
element: Element;
123-
attributes: Partial<Record<string, string | null>>;
124-
attributesNS: Partial<Record<string, Partial<Record<string, string | null>>>>;
130+
attributes?: AttributesV2;
131+
attributesNS?: AttributesNS;
125132
};
126133
```
127134

0 commit comments

Comments
 (0)