🤖 Merge PR #44341 hast: update hast property type by @ChristianMurphy

* update hast property type

documented at https://github.com/syntax-tree/hast#properties
properties are primitive types or a list of number or string.

discussed at https://github.com/rehypejs/rehype-document/pull/9#discussion_r417123004

* add more tests for properties
This commit is contained in:
Christian Murphy 2020-04-29 09:10:58 -07:00 committed by GitHub
parent a095649c04
commit 0504976c2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -73,6 +73,9 @@ const properties: Properties = {
propertyName2: ['propertyValue2', 'propertyValue3'],
propertyName3: true,
propertyName4: 47,
propertyName5: [4, "4"],
propertyName6: null,
propertyName7: undefined
};
function getElement(): Element {

View File

@ -2,6 +2,7 @@
// Project: https://github.com/syntax-tree/hast
// Definitions by: lukeggchapman <https://github.com/lukeggchapman>
// Junyoung Choi <https://github.com/rokt33r>
// Christian Murphy <https://github.com/ChristianMurphy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0
@ -72,7 +73,7 @@ export interface Element extends Parent {
* Represents information associated with an element.
*/
export interface Properties {
[PropertyName: string]: any;
[PropertyName: string]: boolean | number | string | null | undefined | Array<string | number>;
}
/**