# createFormatter

<!-- DO NOT EDIT: this page is autogenerated from the type comments -->

```ts
function createFormatter<TFormat>(
   format, 
   getPlatform, 
   getLayoutMap
): TFormat;
```

Defined in: [adapter.ts:667](https://github.com/TanStack/hotkeys/blob/main/packages/hotkeys/src/adapter.ts#L667)

Returns `format`, such as `formatForDisplay` or `formatForAria`, with a
provider's platform and keyboard layout used when the call doesn't pass
them. Only a hotkey that names a physical key reads `getLayoutMap`, so
other hotkeys don't depend on the layout.

## Type Parameters

### TFormat

`TFormat` *extends* (`hotkey`, `options?`) => `unknown`

## Parameters

### format

`TFormat`

### getPlatform

() => `HotkeyPlatform` \| `undefined`

### getLayoutMap

() => `KeyboardLayoutMap` \| `null` \| `undefined`

## Returns

`TFormat`

## Example

```ts
const format = createFormatter(formatForAria, () => provider.platform, () => layoutMap)
```
