Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: KeyboardLayoutMap.keys/values/entries should have methods type #29957

Merged
merged 19 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions files/en-us/web/api/keyboardlayoutmap/entries/index.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
---
title: "KeyboardLayoutMap: entries property"
title: "KeyboardLayoutMap: entries() method"
short-title: entries
slug: Web/API/KeyboardLayoutMap/entries
page-type: web-api-instance-property
page-type: web-api-instance-method
status:
- experimental
browser-compat: api.KeyboardLayoutMap.entries
---

{{SeeCompatTable}}{{APIRef("Keyboard API")}}

The **`entries`** read-only property
of the {{domxref("KeyboardLayoutMap")}} interface returns an array of a given object's
own enumerable property `[key, value]` pairs, in the same order as that
provided by a {{jsxref("Statements/for...in", "for...in")}} loop (the difference being
that a for-in loop enumerates properties in the prototype chain as well).
The **`entries()`** method of the {{domxref("KeyboardLayoutMap")}} interface returns a new [Iterator](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) object that contains the `[key, value]` pairs, in the same order as that provided by a {{jsxref("Statements/for...in", "for...in")}} loop (the difference being that a `for-in` loop enumerates properties in the prototype chain as well).
skyclouds2001 marked this conversation as resolved.
Show resolved Hide resolved

The method is otherwise the same as {{jsxref("Map.prototype.entries()")}}.

## Value

An array of the given `KeyboardLayoutMap` object's own enumerable property
`[key, value]` pairs.
A new [Iterator](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) object.

## Specifications

Expand All @@ -28,3 +25,7 @@ An array of the given `KeyboardLayoutMap` object's own enumerable property
## Browser compatibility

{{Compat}}

## See also

- {{jsxref("Map.prototype.entries()")}}
6 changes: 6 additions & 0 deletions files/en-us/web/api/keyboardlayoutmap/foreach/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ The **`forEach()`** method of the
{{domxref('KeyboardLayoutMap')}} interface executes a provided function once for
each element of the map.

The method is otherwise the same as {{jsxref("Map.prototype.forEach()")}}.

## Syntax

```js-nolint
Expand Down Expand Up @@ -49,3 +51,7 @@ None ({{jsxref("undefined")}}).
## Browser compatibility

{{Compat}}

## See also

- {{jsxref("Map.prototype.forEach()")}}
6 changes: 6 additions & 0 deletions files/en-us/web/api/keyboardlayoutmap/get/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ key.

A list of valid keys is found in the [UI Events KeyboardEvent code Values](https://www.w3.org/TR/uievents-code/#key-alphanumeric-writing-system) spec.

The method is otherwise the same as {{jsxref("Map.prototype.get()")}}.

## Syntax

```js-nolint
Expand Down Expand Up @@ -51,3 +53,7 @@ keyboard.getLayoutMap().then((keyboardLayoutMap) => {
## Browser compatibility

{{Compat}}

## See also

- {{jsxref("Map.prototype.get()")}}
6 changes: 6 additions & 0 deletions files/en-us/web/api/keyboardlayoutmap/has/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ object has an element with the specified key.
A list of valid keys is found in
the [UI Events KeyboardEvent code Values](https://www.w3.org/TR/uievents-code/#key-alphanumeric-writing-system) spec.

The method is otherwise the same as {{jsxref("Map.prototype.keys()")}}.

## Syntax

```js-nolint
Expand All @@ -39,3 +41,7 @@ A {{jsxref('Boolean')}} indicating whether the specified key was found.
## Browser compatibility

{{Compat}}

## See also

- {{jsxref("Map.prototype.has()")}}
14 changes: 7 additions & 7 deletions files/en-us/web/api/keyboardlayoutmap/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ A list of valid keys is found in the [UI Events KeyboardEvent code Values](https

## Instance properties

- {{domxref('KeyboardLayoutMap.entries')}} {{ReadOnlyInline}} {{experimental_inline}}
- : Returns an array of a given object's own enumerable property `[key, value]` pairs, in the same order as that provided by a {{jsxref("Statements/for...in", "for...in")}} loop (the difference being that a `for-in` loop enumerates properties in the prototype chain as well).
- {{domxref('KeyboardLayoutMap.keys')}} {{ReadOnlyInline}} {{experimental_inline}}
- : Returns a new _array iterator_ object that contains the keys for each index in the array.
- {{domxref('KeyboardLayoutMap.size')}} {{ReadOnlyInline}} {{experimental_inline}}
- : Returns the number of elements in the `KeyboardLayoutMap` object.
- {{domxref('KeyboardLayoutMap.values')}} {{ReadOnlyInline}} {{experimental_inline}}
- : Returns a new _array iterator_ object that contains the values for each index in the `KeyboardLayoutMap` object.

## Instance methods

- {{domxref('KeyboardLayoutMap.forEach()')}} {{ReadOnlyInline}} {{experimental_inline}}
- {{domxref('KeyboardLayoutMap.entries()')}} {{experimental_inline}}
- : Returns a new [Iterator](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) object that contains the `[key, value]` pairs, in the same order as that provided by a {{jsxref("Statements/for...in", "for...in")}} loop (the difference being that a `for-in` loop enumerates properties in the prototype chain as well).
- {{domxref('KeyboardLayoutMap.forEach()')}} {{experimental_inline}}
- : Executes a provided function once for each element of `KeyboardLayoutMap`.
- {{domxref('KeyboardLayoutMap.get()')}} {{experimental_inline}}
- : Returns the element with the given key from the `KeyboardLayoutMap` object.
- {{domxref('KeyboardLayoutMap.has()')}} {{experimental_inline}}
- : Returns a boolean indicating whether the `KeyboardLayoutMap` object has an element with the specified key.
- {{domxref('KeyboardLayoutMap.keys()')}} {{experimental_inline}}
- : Returns a new [Iterator](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) object that contains the keys for each index in the array.
- {{domxref('KeyboardLayoutMap.values()')}} {{experimental_inline}}
- : Returns a new [Iterator](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) object that contains the values for each index in the `KeyboardLayoutMap` object.

## Examples

Expand Down
17 changes: 10 additions & 7 deletions files/en-us/web/api/keyboardlayoutmap/keys/index.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
---
title: "KeyboardLayoutMap: keys property"
title: "KeyboardLayoutMap: keys() method"
short-title: keys
slug: Web/API/KeyboardLayoutMap/keys
page-type: web-api-instance-property
page-type: web-api-instance-method
status:
- experimental
browser-compat: api.KeyboardLayoutMap.keys
---

{{SeeCompatTable}}{{APIRef("Keyboard API")}}

The **`keys`** read-only property of
the {{domxref("KeyboardLayoutMap")}} interface returns a new Array
Iterator object that contains the keys for each index in the
array.
The **`keys()`** method of the {{domxref("KeyboardLayoutMap")}} interface returns a new [Iterator](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) object that contains the keys for each index in the array.

The method is otherwise the same as {{jsxref("Map.prototype.keys()")}}.

## Value

An iterator.
A new [Iterator](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) object.

## Specifications

Expand All @@ -26,3 +25,7 @@ An iterator.
## Browser compatibility

{{Compat}}

## See also

- {{jsxref("Map.prototype.keys()")}}
6 changes: 6 additions & 0 deletions files/en-us/web/api/keyboardlayoutmap/size/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ The **`size`** read-only property of
the {{domxref("KeyboardLayoutMap")}} interface returns the number of elements in the
map.

The property is otherwise the same as {{jsxref("Map.prototype.size")}}.

## Value

A number.
Expand All @@ -25,3 +27,7 @@ A number.
## Browser compatibility

{{Compat}}

## See also

- {{jsxref("Map.prototype.size")}}
17 changes: 10 additions & 7 deletions files/en-us/web/api/keyboardlayoutmap/values/index.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
---
title: "KeyboardLayoutMap: values property"
title: "KeyboardLayoutMap: values() method"
short-title: values
slug: Web/API/KeyboardLayoutMap/values
page-type: web-api-instance-property
page-type: web-api-instance-method
status:
- experimental
browser-compat: api.KeyboardLayoutMap.values
---

{{SeeCompatTable}}{{APIRef("Keyboard API")}}

The **`values`** read-only property of
the {{domxref("KeyboardLayoutMap")}} interface returns a new Array
Iterator object that contains the values for each index in the
map.
The **`values()`** method of the {{domxref("KeyboardLayoutMap")}} interface returns a new [Iterator](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) object that contains the values for each index in the `KeyboardLayoutMap` object.

The method is otherwise the same as {{jsxref("Map.prototype.values()")}}.

## Value

An iterator.
A new [Iterator](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator) object.

## Specifications

Expand All @@ -26,3 +25,7 @@ An iterator.
## Browser compatibility

{{Compat}}

## See also

- {{jsxref("Map.prototype.values()")}}