Skip to content

Commit ef652c0

Browse files
committed
Reorg layout exports
Only export en_US directly, the rest in a collection
1 parent 6f3d9be commit ef652c0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/keyboard/src/index.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@
1515
import { IKeyboardLayout } from './core';
1616
export { IKeyboardLayout, KeycodeLayout } from './core';
1717

18+
export { EN_US } from './layouts';
1819
import { EN_US } from './layouts';
19-
export * from './layouts';
20+
import * as Layouts from './layouts';
21+
22+
export const KeyboardLayouts = Object.values(Layouts);
2023

2124
/**
2225
* Get the global application keyboard layout instance.

packages/keyboard/tests/src/index.spec.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ import { expect } from 'chai';
1111

1212
import {
1313
EN_US,
14-
FR_FR,
1514
getKeyboardLayout,
15+
KeyboardLayouts,
1616
KeycodeLayout,
17-
NB_NO,
1817
setKeyboardLayout
1918
} from '@lumino/keyboard';
2019

20+
const FR_FR = KeyboardLayouts.find(layout => layout.name === 'fr-FR');
21+
const NB_NO = KeyboardLayouts.find(layout => layout.name === 'nb-NO');
22+
2123
describe('@lumino/keyboard', () => {
2224
describe('getKeyboardLayout()', () => {
2325
it('should return the global keyboard layout', () => {

0 commit comments

Comments
 (0)